Beispiel #1
0
 public aiCameraVector(aiCameraVector other) : this(AssimpPINVOKE.new_aiCameraVector__SWIG_1(aiCameraVector.getCPtr(other)), true)
 {
     if (AssimpPINVOKE.SWIGPendingException.Pending)
     {
         throw AssimpPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #2
0
 public aiCameraVectorEnumerator(aiCameraVector collection)
 {
     collectionRef = collection;
     currentIndex  = -1;
     currentObject = null;
     currentSize   = collectionRef.Count;
 }
Beispiel #3
0
    private aiCameraVector GetmCameras()
    {
        IntPtr         cPtr = AssimpPINVOKE.aiScene_GetmCameras(swigCPtr);
        aiCameraVector ret  = (cPtr == IntPtr.Zero) ? null : new aiCameraVector(cPtr, true);

        return(ret);
    }
Beispiel #4
0
        private void SetupCamera(aiCameraVector cameras)
        {
            // Get scene bounds
            var min = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue);
            var max = new Vector3(float.MinValue, float.MinValue, float.MinValue);

            CalculateBounds(scene.mRootNode, ref min, ref max, Matrix.Identity);

            // Projection Depth
            var size = (max - min);

            g_zFar = Math.Max(Math.Max(size.X, size.Y), size.Z) * 100;

            // Starting View Position
            var center   = min + size * 0.5f;
            var lookAt   = new Vector3(0, 0, 1); // Unit vector not coordinate
            var position = new Vector3(center.X, center.Y, center.Z - (size.Z * 10));
            var up       = new Vector3(0, 1, 0);

            if (cameras.Count > 0)
            {
                var camera = cameras[0];
                lookAt   = camera.mLookAt.ToVector3();
                position = camera.mPosition.ToVector3();
                up       = camera.mUp.ToVector3();
            }
            g_sCamera.vLookAt = lookAt;
            g_sCamera.vPos    = position;
            g_sCamera.vUp     = up;
        }
Beispiel #5
0
 public void SetRange(int index, aiCameraVector values)
 {
     AssimpPINVOKE.aiCameraVector_SetRange(swigCPtr, index, aiCameraVector.getCPtr(values));
     if (AssimpPINVOKE.SWIGPendingException.Pending)
     {
         throw AssimpPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #6
0
    public static aiCameraVector Repeat(aiCamera value, int count)
    {
        IntPtr         cPtr = AssimpPINVOKE.aiCameraVector_Repeat(aiCamera.getCPtr(value), count);
        aiCameraVector ret  = (cPtr == IntPtr.Zero) ? null : new aiCameraVector(cPtr, true);

        if (AssimpPINVOKE.SWIGPendingException.Pending)
        {
            throw AssimpPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Beispiel #7
0
    public aiCameraVector GetRange(int index, int count)
    {
        IntPtr         cPtr = AssimpPINVOKE.aiCameraVector_GetRange(swigCPtr, index, count);
        aiCameraVector ret  = (cPtr == IntPtr.Zero) ? null : new aiCameraVector(cPtr, true);

        if (AssimpPINVOKE.SWIGPendingException.Pending)
        {
            throw AssimpPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
Beispiel #8
0
        private void SetupCamera(aiCameraVector cameras)
        {
            // Get scene bounds
            var min = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue);
            var max = new Vector3(float.MinValue, float.MinValue, float.MinValue);
            CalculateBounds(scene.mRootNode, ref min, ref max, Matrix.Identity);

            // Projection Depth
            var size = (max-min);
            g_zFar = Math.Max(Math.Max(size.X, size.Y), size.Z) * 100;

            // Starting View Position
            var center = min + size * 0.5f;
            var lookAt = new Vector3(0,0,1); // Unit vector not coordinate
            var position = new Vector3(center.X, center.Y, center.Z-(size.Z*10));
            var up = new Vector3(0, 1, 0);
            if (cameras.Count > 0) {
                var camera = cameras[0];
                lookAt = camera.mLookAt.ToVector3();
                position = camera.mPosition.ToVector3();
                up = camera.mUp.ToVector3();
            }
            g_sCamera.vLookAt = lookAt;
            g_sCamera.vPos = position;
            g_sCamera.vUp = up;
        }
Beispiel #9
0
 internal static HandleRef getCPtr(aiCameraVector obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }