예제 #1
0
        public async System.Threading.Tasks.Task <CPhyShape> CreateShapeTriMesh(CPhyMaterial material, RName geomName, Vector3 scale, Quaternion scaleRot)
        {
            var geoms = await CEngine.Instance.PhyGeomManager.GetPhyGeomsAsync(geomName);

            if (geoms == null)
            {
                return(null);
            }
            var blob = geoms.TriMesh;

            if (blob == null)
            {
                return(null);
            }
            unsafe
            {
                var ptr = SDK_PhyContext_CreateShapeTriMesh(CoreObject, material.CoreObject, blob.CoreObject, &scale, &scaleRot);
                if (ptr.GetPointer() == IntPtr.Zero)
                {
                    return(null);
                }
                var result = new CPhyShape(ptr, material, geomName);
                result.TriGeom = geoms;
                return(result);
            }
        }
예제 #2
0
 //public bool Overlap(ref BoundingBox box, ref GamePlay.SceneGraph.VHitResult hitResult)
 //{
 //    unsafe
 //    {
 //        fixed (BoundingBox* pbox = &box)
 //        fixed (GamePlay.SceneGraph.VHitResult* phitResult = &hitResult)
 //        {
 //            return SDK_PhyScene_Overlap(CoreObject, pbox, phitResult);
 //        }
 //    }
 //}
 public bool Overlap(CPhyShape shape, Vector3 postion, Quaternion rotation, ref GamePlay.SceneGraph.VHitResult hitResult)
 {
     unsafe
     {
         fixed(GamePlay.SceneGraph.VHitResult *phitResult = &hitResult)
         {
             return(SDK_PhyScene_Overlap(CoreObject, shape.CoreObject, &postion, &rotation, phitResult));
         }
     }
 }
예제 #3
0
 public bool Sweep(CPhyShape shape, Vector3 position, Vector3 unitDir, float maxDistance, ref GamePlay.SceneGraph.VHitResult hitResult)
 {
     unsafe
     {
         fixed(GamePlay.SceneGraph.VHitResult *phitResult = &hitResult)
         {
             return(SDK_PhyScene_Sweep(CoreObject, shape.CoreObject, &position, &unitDir, maxDistance, phitResult));
         }
     }
 }
예제 #4
0
 public bool OverlapWithFilter(CPhyShape shape, Vector3 postion, Quaternion rotation, ref PhyQueryFilterData queryFilterData, ref GamePlay.SceneGraph.VHitResult hitResult)
 {
     unsafe
     {
         fixed(PhyQueryFilterData *pqueryFilterData = &queryFilterData)
         fixed(GamePlay.SceneGraph.VHitResult * phitResult = &hitResult)
         {
             return(SDK_PhyScene_OverlapWithFilter(CoreObject, shape.CoreObject, &postion, &rotation, pqueryFilterData, phitResult));
         }
     }
 }
예제 #5
0
 public bool SweepWithFilter(CPhyShape shape, Vector3 position, Vector3 unitDir, float maxDistance, ref PhyQueryFilterData queryFilterData, ref GamePlay.SceneGraph.VHitResult hitResult)
 {
     unsafe
     {
         fixed(PhyQueryFilterData *pqueryFilterData = &queryFilterData)
         fixed(GamePlay.SceneGraph.VHitResult * phitResult = &hitResult)
         {
             return(SDK_PhyScene_SweepWithFilter(CoreObject, shape.CoreObject, &position, &unitDir, maxDistance, pqueryFilterData, phitResult));
         }
     }
 }
예제 #6
0
 public Editor_PhysicsSphereShape(CPhyShape shape) : base(shape)
 {
 }
예제 #7
0
 public Editor_PhysicsCapsuleShape(CPhyShape shape) : base(shape)
 {
 }