예제 #1
0
        public bool Equal(Box3 arg0)
        {
            bool ret = VixenLibPINVOKE.Box3_Equal(swigCPtr, Box3.getCPtr(arg0));

            if (VixenLibPINVOKE.SWIGPendingException.Pending)
            {
                throw VixenLibPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
예제 #2
0
        public Box3 Mul(Matrix arg0)
        {
            Box3 ret = new Box3(VixenLibPINVOKE.Box3_Mul(swigCPtr, Matrix.getCPtr(arg0)), false);

            if (VixenLibPINVOKE.SWIGPendingException.Pending)
            {
                throw VixenLibPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
예제 #3
0
        public Box3 Assign(Sphere arg0)
        {
            Box3 ret = new Box3(VixenLibPINVOKE.Box3_Assign__SWIG_1(swigCPtr, Sphere.getCPtr(arg0)), false);

            if (VixenLibPINVOKE.SWIGPendingException.Pending)
            {
                throw VixenLibPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
예제 #4
0
        public Vec3 WorldFromTrack2D(Vec3 p)
        {
            Scene  scene   = SharedWorld.MainScene;
            Camera cam     = scene.Camera;
            Box3   vvol    = cam.ViewVol;
            float  camdist = cam.Translation.Length;
            float  zdist   = camdist - ZOffset;
            Vec3   w       = new Vec3();
            Vec3   v       = new Vec3();
            Matrix mtx     = new Matrix();
            float  tmp     = 0.5f * vvol.Height / vvol.min.z;

            v.x = p.x * tmp * zdist;
            v.y = p.y * tmp * zdist;
            v.z = -zdist;
            cam.TotalTransform(mtx);
            mtx.Transform(v, w);
            SharedWorld.Trace(System.String.Format(Name + " Track({0}, {1}, {2}) -> World({3}, {4}, {5})\n", p.x, p.y, p.z, w.x, w.y, w.z));
            return(w);
        }
예제 #5
0
        public Vec3 WorldFromScreen(Vec3 pos)
        {
            Scene  scene = SharedWorld.MainScene;
            Camera cam   = scene.Camera;
            Box3   vv    = cam.ViewVol;
            Vec3   p     = Normalize(pos);
            Matrix mtx   = cam.GetViewTrans();
            Vec3   w     = new Vec3(vv.min.x + p.x * vv.Width,
                                    vv.max.y - p.y * vv.Height,
                                    vv.min.z - p.z * vv.Depth + ZOffset);
            float tmp = -0.5f * w.z / cam.Hither;

            tmp  = -w.z / cam.Hither;
            w.x *= tmp;
            w.y *= tmp;
            cam.TotalTransform(mtx);
            mtx.Transform(w, w);
            SharedWorld.Trace(System.String.Format(Name + " Screen({0}, {1}, {2}) -> World({3}, {4}, {5})\n", pos.x, pos.y, pos.z, w.x, w.y, w.z));
            return(w);
        }
예제 #6
0
        public Vec3 Normalize(Vec3 p)
        {
            Scene  scene    = SharedWorld.MainScene;
            Camera cam      = scene.Camera;
            Box3   viewarea = ViewArea;
            Vec3   n        = new Vec3();

            if (viewarea != null)
            {
                n.z = (p.z - viewarea.min.z) / viewarea.Depth;
            }
            else
            {
                viewarea = new Box3(0, 0, cam.Hither, scene.Viewport.Width, scene.Viewport.Height, cam.Yon);
                n.z      = cam.Translation.z / viewarea.Depth;
            }
            n.x = (p.x - viewarea.min.x) / viewarea.Width;
            n.y = (p.y - viewarea.min.y) / viewarea.Height;
            //SharedWorld.Trace(System.String.Format("HandTracker:Normalize ({0}, {1}, {2}) -> ({3}, {4}, {5})\n", p.x, p.y, p.z, n.x, n.y, n.z));
            return(n);
        }
예제 #7
0
        public virtual bool GetBound(Box3 arg0)
        {
            bool ret = VixenLibPINVOKE.Geometry_GetBound(swigCPtr, Box3.getCPtr(arg0));

            return(ret);
        }
예제 #8
0
        public virtual bool CalcBound(Box3 arg0)
        {
            bool ret = VixenLibPINVOKE.Model_CalcBound(swigCPtr, Box3.getCPtr(arg0));

            return(ret);
        }
예제 #9
0
 public virtual void SetBound(Box3 INPUT)
 {
     VixenLibPINVOKE.Model_SetBound__SWIG_0(swigCPtr, Box3.getCPtr(INPUT));
 }
예제 #10
0
        public bool GetBound(Box3 OUTPUT)
        {
            bool ret = VixenLibPINVOKE.Model_GetBound__SWIG_3(swigCPtr, Box3.getCPtr(OUTPUT));

            return(ret);
        }
예제 #11
0
        public bool GetBound(Box3 OUTPUT, int transformtype)
        {
            bool ret = VixenLibPINVOKE.Model_GetBound__SWIG_2(swigCPtr, Box3.getCPtr(OUTPUT), transformtype);

            return(ret);
        }
예제 #12
0
        public virtual Box3 GetCullVol()
        {
            Box3 ret = new Box3(VixenLibPINVOKE.Camera_GetCullVol(swigCPtr), false);

            return(ret);
        }
예제 #13
0
 public virtual void GetViewVol(Box3 arg0)
 {
     VixenLibPINVOKE.Camera_GetViewVol(swigCPtr, Box3.getCPtr(arg0));
 }
예제 #14
0
 internal static HandleRef getCPtr(Box3 obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }