示例#1
0
 public static extern IntPtr SceneManager_addCamera(
     vector3df position,
     vector3df lookat,
     vector3df up,
     float near,
     float far,
     float fov);
示例#2
0
        public vector3df GetAxisDir(E_AXIS axis)
        {
            vector3df v = new vector3df();

            CoordSceneNode_getDir(pointer, axis, out v);
            return(v);
        }
示例#3
0
        public vector3df GetCenter()
        {
            vector3df v = new vector3df();

            WDTSceneNode_getCenter(pointer, out v);
            return(v);
        }
示例#4
0
        vector3df getRotationRadians()
        {
            matrix4   mat      = this;
            vector3df scale    = getScale();
            vector3df invScale = new vector3df(1.0f / scale.X, 1.0f / scale.Y, 1.0f / scale.Z);

            float Y = -NewMath.FASin(mat[2] * invScale.X);
            float C = NewMath.FCos(Y);

            float rotx, roty, X, Z;

            if (Math.Abs(C) > 0.0005f)
            {
                float invC = 1.0f / C;
                rotx = mat[10] * invC * invScale.Z;
                roty = mat[6] * invC * invScale.Y;
                X    = NewMath.FATan2(roty, rotx);
                rotx = mat[0] * invC * invScale.X;
                roty = mat[1] * invC * invScale.X;
                Z    = NewMath.FATan2(roty, rotx);
            }
            else
            {
                X    = 0;
                rotx = mat[5] * invScale.Y;
                roty = -mat[4] * invScale.Y;
                Z    = NewMath.FATan2(roty, rotx);
            }

            // fix values that get below zero
            // before it would set (!) values to 360
            // that were above 360:
            if (X < 0.0)
            {
                X += 2 * NewMath.PI;
            }
            if (Y < 0.0)
            {
                Y += 2 * NewMath.PI;
            }
            if (Z < 0.0)
            {
                Z += 2 * NewMath.PI;
            }

            return(new vector3df(X, Y, Z));
        }
示例#5
0
        void setScale(vector3df scale)
        {
            if (isIdentity())
            {
                M[0]  = scale.X;
                M[5]  = scale.Y;
                M[10] = scale.Z;
            }

            matrix4 mat = new matrix4(true);

            mat[0]  = scale.X;
            mat[5]  = scale.Y;
            mat[10] = scale.Z;

            matrix4 self = this;

            setByProduct(ref self, ref mat);
        }
示例#6
0
        void setRotationRadians(vector3df rotation)
        {
            float cr = NewMath.FCos(rotation.X);
            float sr = NewMath.FSin(rotation.X);
            float cp = NewMath.FCos(rotation.Y);
            float sp = NewMath.FSin(rotation.Y);
            float cy = NewMath.FCos(rotation.Z);
            float sy = NewMath.FSin(rotation.Z);

            M[0] = (float)(cp * cy);
            M[1] = (float)(cp * sy);
            M[2] = (float)(-sp);

            double srsp = sr * sp;
            double crsp = cr * sp;

            M[4] = (float)(srsp * cy - cr * sy);
            M[5] = (float)(srsp * sy + cr * cy);
            M[6] = (float)(sr * cp);

            M[8]  = (float)(crsp * cy + sr * sy);
            M[9]  = (float)(crsp * sy - sr * cy);
            M[10] = (float)(cr * cp);
        }
示例#7
0
 public static extern void MapTileSceneNode_getCenter(
     IntPtr node,
     out vector3df pos);
示例#8
0
 public static extern void m2Move_setScale(
     IntPtr m2move,
     ref vector3df scale);
示例#9
0
 public static extern void m2Move_getScale(
     IntPtr m2move,
     out vector3df scale);
示例#10
0
 public static extern void m2Move_setPos(
     IntPtr m2move,
     ref vector3df pos);
示例#11
0
 public static extern void m2Move_getPos(
     IntPtr m2move,
     out vector3df pos);
示例#12
0
 public static extern void m2Move_setDir(
     IntPtr m2move,
     ref vector3df dir);
示例#13
0
 public static extern void m2Move_getDir(
     IntPtr m2move,
     out vector3df dir);
示例#14
0
 public static extern void Camera_getDir(
     IntPtr cam,
     out vector3df dir);
示例#15
0
 public static extern void Camera_getPosition(
     IntPtr cam,
     out vector3df pos);
示例#16
0
 public static extern void SceneEnvironment_setLightDir(vector3df dir);
示例#17
0
 public static extern void Camera_getLookat(
     IntPtr cam,
     out vector3df lookat);
示例#18
0
 void setTranslation(vector3df translation)
 {
     M[12] = translation.X;
     M[13] = translation.Y;
     M[14] = translation.Z;
 }
示例#19
0
 void setRotationDegrees(vector3df rotation)
 {
     setRotationRadians(rotation * NewMath.DEGTORAD);
 }
示例#20
0
 public static extern void Camera_getUp(
     IntPtr cam,
     out vector3df up);
示例#21
0
 public static extern void CoordSceneNode_getDir(IntPtr node,
                                                 E_AXIS axis,
                                                 out vector3df dir);
示例#22
0
        public Camera AddCamera(vector3df position, vector3df lookat, vector3df up, float near, float far, float fov)
        {
            IntPtr raw = SceneManager_addCamera(position, lookat, up, near, far, fov);

            return(new Camera(raw));
        }
示例#23
0
 public void SetAxisDir(E_AXIS axis, vector3df dir)
 {
     CoordSceneNode_setDir(pointer, axis, dir);
 }
示例#24
0
 public static extern void SceneEnvrionment_getLightDir(out vector3df dir);
示例#25
0
 public static extern void Camera_setUp(
     IntPtr cam,
     vector3df up);