/* */ package quicktime.qd3d.camera;
/* */
/* */ import java.io.IOException;
/* */ import java.io.ObjectInputStream;
/* */ import java.io.ObjectOutputStream;
/* */ import quicktime.QTRuntimeException;
/* */ import quicktime.QTSession;
/* */ import quicktime.qd3d.math.Point3D;
/* */ import quicktime.qd3d.math.Vector3D;
/* */ import quicktime.util.EndianDescriptor;
/* */ import quicktime.util.EndianOrder;
/* */ import quicktime.util.QTByteObject;
/* */
/* */ public final class CameraPlacement extends QTByteObject
/* */ {
/* 32 */ private static boolean apriori = QTSession.apriori();
/* */ public static final int kNativeSize = 36;
/* */ private static final long serialVersionUID = -2481353228250322010L;
/* */
/* */ public static final EndianDescriptor getEndianDescriptor()
/* */ {
/* 56 */ return EndianDescriptor.flipAll32;
/* */ }
/* */
/* */ public CameraPlacement()
/* */ {
/* 64 */ super(36);
/* */ }
/* */
/* */ public CameraPlacement(Point3D paramPoint3D1, Point3D paramPoint3D2, Vector3D paramVector3D)
/* */ {
/* 75 */ this();
/* */
/* 77 */ setCameraLocation(paramPoint3D1);
/* 78 */ setPointOfInterest(paramPoint3D2);
/* 79 */ setUpVector(paramVector3D);
/* */ }
/* */
/* */ private CameraPlacement(byte[] paramArrayOfByte) {
/* 83 */ super(paramArrayOfByte);
/* */ }
/* */
/* */ private void readObject(ObjectInputStream paramObjectInputStream)
/* */ throws IOException
/* */ {
/* 91 */ this.bytes = new byte[36];
/* */
/* 94 */ byte[] arrayOfByte = new byte[36];
/* 95 */ paramObjectInputStream.read(arrayOfByte);
/* */
/* 97 */ for (int i = 0; i < 36; i += 4) {
/* 98 */ int j = getIntFromArray(arrayOfByte, i);
/* 99 */ int k = EndianOrder.flipBigEndianToNative32(j);
/* 100 */ setIntInArray(getBytes(), i, k);
/* */ }
/* */ }
/* */
/* */ private void writeObject(ObjectOutputStream paramObjectOutputStream) throws IOException
/* */ {
/* 106 */ byte[] arrayOfByte = getBytes();
/* */
/* 109 */ for (int i = 0; i < 36; i += 4) {
/* 110 */ int j = getIntFromArray(getBytes(), i);
/* 111 */ int k = EndianOrder.flipNativeToBigEndian32(j);
/* 112 */ setIntInArray(arrayOfByte, i, k);
/* */ }
/* */
/* 115 */ paramObjectOutputStream.write(arrayOfByte);
/* */ }
/* */
/* */ public Point3D getCameraLocation()
/* */ {
/* 120 */ Point3D localPoint3D = new Point3D();
/* 121 */ System.arraycopy(getBytes(), 0, localPoint3D.getBytes(), 0, localPoint3D.getBytes().length);
/* 122 */ return localPoint3D;
/* */ }
/* */
/* */ public Point3D getPointOfInterest()
/* */ {
/* 127 */ Point3D localPoint3D = new Point3D();
/* 128 */ System.arraycopy(getBytes(), 12, localPoint3D.getBytes(), 0, localPoint3D.getBytes().length);
/* 129 */ return localPoint3D;
/* */ }
/* */
/* */ public Vector3D getUpVector()
/* */ {
/* 134 */ return new Vector3D(getFloatAt(24), getFloatAt(28), getFloatAt(32));
/* */ }
/* */
/* */ public void setCameraLocation(Point3D paramPoint3D)
/* */ {
/* 140 */ setFloatAt(0, paramPoint3D.getX());
/* 141 */ setFloatAt(4, paramPoint3D.getY());
/* 142 */ setFloatAt(8, paramPoint3D.getZ());
/* */ }
/* */
/* */ public void setPointOfInterest(Point3D paramPoint3D)
/* */ {
/* 147 */ setFloatAt(12, paramPoint3D.getX());
/* 148 */ setFloatAt(16, paramPoint3D.getY());
/* 149 */ setFloatAt(20, paramPoint3D.getZ());
/* */ }
/* */
/* */ public void setUpVector(Vector3D paramVector3D)
/* */ {
/* 154 */ setFloatAt(24, paramVector3D.getX());
/* 155 */ setFloatAt(28, paramVector3D.getY());
/* 156 */ setFloatAt(32, paramVector3D.getZ());
/* */ }
/* */
/* */ public Object clone() {
/* 160 */ return new CameraPlacement(this.bytes);
/* */ }
/* */
/* */ public String toString() {
/* 164 */ return super.toString() + "[location=" + getCameraLocation() + ",interest=" + getPointOfInterest() + ",upVector=" + getUpVector() + "]";
/* */ }
/* */
/* */ private static native int getIntFromArray(byte[] paramArrayOfByte, int paramInt);
/* */
/* */ private static native void setIntInArray(byte[] paramArrayOfByte, int paramInt1, int paramInt2);
/* */
/* */ static
/* */ {
/* 35 */ if (QTSession.isCurrentOS(4))
/* 36 */ throw new QTRuntimeException("Unsupported OS");
/* */ }
/* */ }
/* Location: Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name: quicktime.qd3d.camera.CameraPlacement
* JD-Core Version: 0.6.2
*/