Пример #1
0
 // Add camera at end of camera array
 void addCamera(Camera3ds c)
 {
     _cameras.Add(c);
 }
Пример #2
0
        private void read_CAM_RANGES(Camera3ds cam)
        {
            cam.mNearPlane = ReadFloat();
            cam.mFarPlane = ReadFloat();

            if (mDecode != null)
            {
                mDecode.enter();
                mDecode.println("Near plane:" + Utils3ds.floatToString(cam.mNearPlane, 14));
                mDecode.println("Far plane: " + Utils3ds.floatToString(cam.mFarPlane, 14));
                mDecode.leave();
            }
        }
Пример #3
0
        private void read_N_CAMERA(string name, int chunk_len)
        {
            long chunk_end = filePos() + chunk_len;

            Camera3ds cam = new Camera3ds();
            cam.mName = name;

            addCamera(cam);

            cam.mPosition.X = ReadFloat();
            cam.mPosition.Z = ReadFloat();
            cam.mPosition.Y = ReadFloat();
            cam.mTarget.X = ReadFloat();
            cam.mTarget.Z = ReadFloat();
            cam.mTarget.Y = ReadFloat();
            cam.mRoll = ReadFloat();
            cam.mLens = ReadFloat();

            if (mDecode != null)
            {
                mDecode.enter();
                mDecode.println("Position: " + cam.mPosition);
                mDecode.println("Target:   " + cam.mTarget);
                mDecode.println("Roll: " + Utils3ds.floatToString(cam.mRoll, 12));
                mDecode.println("Lens: " + Utils3ds.floatToString(cam.mLens, 12));
            }

            while (filePos() < chunk_end)
            {
                Head head = read_HEAD();
                switch (head.id)
                {
                    case CHUNK_CAM_RANGES:
                        read_CAM_RANGES(cam);
                        break;
                    case CHUNK_CAM_SEE_CONE:
                    default:
                        SkipChunk(head.length - 6);
                        break;
                }
            }

            if (mDecode != null)
            {
                mDecode.leave();
            }
        }