protected override void duplicateTo(ref Object3D ret) { base.duplicateTo(ref ret); Transformable transformable = (Transformable)ret; float[] values1 = new float[3]; this.getTranslation(ref values1); transformable.setTranslation(values1[0], values1[1], values1[2]); float[] values2 = new float[3]; this.getScale(ref values2); transformable.setScale(values2[0], values2[1], values2[2]); int[] values3 = new int[4]; this.getOrientationQuatx(ref values3); transformable.setOrientationQuatx(values3[0], values3[1], values3[2], values3[3]); transformable.setTransform(this.m_transform); }
private static void loadTransformable( Transformable @object, ref DataInputStream @in, ref List <Object3D> objectList, ref List <Object3D> rootObjectList) { Loader.loadObject3D((Object3D)@object, ref @in, ref objectList, ref rootObjectList); if (@in.readBoolean()) { float x1 = Loader.readFloatLE(ref @in); float y1 = Loader.readFloatLE(ref @in); float z1 = Loader.readFloatLE(ref @in); @object.setTranslation(x1, y1, z1); float sx = Loader.readFloatLE(ref @in); float sy = Loader.readFloatLE(ref @in); float sz = Loader.readFloatLE(ref @in); @object.setScale(sx, sy, sz); float degrees = Loader.readFloatLE(ref @in); float x2 = Loader.readFloatLE(ref @in); float y2 = Loader.readFloatLE(ref @in); float z2 = Loader.readFloatLE(ref @in); @object.setOrientation(degrees, x2, y2, z2); } if ([email protected]()) { return; } float[] matrix = new float[16]; for (int index = 0; index < 16; ++index) { matrix[index] = Loader.readFloatLE(ref @in); } Transform transform = new Transform(); transform.set(matrix); @object.setTransform(transform); }