Esempio n. 1
0
 private static void loadTransformable(Transformable transformable) throws IOException {
   loadObject3D(transformable);
   if (readBoolean()) // hasComponentTransform
   {
     float tx = readFloat();
     float ty = readFloat();
     float tz = readFloat();
     transformable.setTranslation(tx, ty, tz);
     float sx = readFloat();
     float sy = readFloat();
     float sz = readFloat();
     transformable.setScale(sx, sy, sz);
     float angle = readFloat();
     float ax = readFloat();
     float ay = readFloat();
     float az = readFloat();
     transformable.setOrientation(angle, ax, ay, az);
   }
   if (readBoolean()) // hasGeneralTransform
   {
     Transform t = new Transform();
     t.set(readMatrix());
     transformable.setTransform(t);
   }
 }
 void duplicate(Transformable copy) {
   copy.translation = new Vector3(translation);
   copy.scale = new Vector3(scale);
   copy.orientation = new Transform(orientation);
   copy.transform = new Transform(transform);
 }