예제 #1
0
        public static PxVec3 GetControllerPosition(IntPtr p)
        {
            var position = new PxVec3();

            PhysXDll.GetControllerPosition(p, ref position);
            return(position);
        }
예제 #2
0
 public void OnUpdate(IntPtr colliderPtr, PxVec3 position, PxVec4 rotation)
 {
     if (this.Colliders.TryGetValue(colliderPtr, out PxCollider collider))
     {
         collider.Position = position;
         collider.Rotation = rotation;
         collider.OnTransUpdateAction?.Invoke(position, rotation);
     }
 }
예제 #3
0
        public static PxVec3 Normalize(PxVec3 value)
        {
            var num = value.magnitude;

            if (num > 9.99999974737875E-06)
            {
                return(value / num);
            }
            return(zero);
        }
예제 #4
0
        public static PxVec4 AngleAxis(float degree, PxVec3 axis)
        {
            if (axis.magnitude < 0.000001f)
            {
                return(Identity);
            }

            axis = axis.normalized;
            var cos = Mathf.Cos(Mathf.Deg2Rad(degree) / 2);
            var sin = Mathf.Sin(Mathf.Deg2Rad(degree) / 2);

            return(new PxVec4(sin * axis.x, sin * axis.y, sin * axis.z, cos));
        }
 public bool CapsuleCast(CapsuleAxis axis, PxVec3 center, float radius, float halfHeigh, PxVec3 direction, out PxRaycastHit hitInfo, PxVec4 orientation)
 {
     return(CapsuleCast(axis, center, radius, halfHeigh, direction, out hitInfo, -1, orientation));
 }
 public bool CapsuleCast(CapsuleAxis axis, PxVec3 center, float radius, float halfHeight, PxVec3 direction, float maxDistance, PxVec4 orientation)
 {
     return(PhysXDll.CapsuleCast(this.scenePtr, (int)axis, center, direction, radius, halfHeight, orientation, maxDistance));
 }
 public bool Raycast(PxVec3 origin, PxVec3 direction, out PxRaycastHit hitInfo, float maxDistance)
 {
     return(PhysXDll.Raycast(this.scenePtr, origin, direction, maxDistance, out hitInfo));
 }
 public bool CapsuleCast(CapsuleAxis axis, PxVec3 center, float radius, float halfHeight, PxVec3 direction)
 {
     return(CapsuleCast(axis, center, radius, halfHeight, direction, PxVec4.Identity));
 }
 public int CapsuleCastAll(CapsuleAxis axis, PxVec3 center, float radius, float halfHeigh, PxVec3 direction, float maxDistance, int layerMask, PxVec4 orientation)
 {
     return(PhysXDll.CapsuleCastAll(this.scenePtr, (int)axis, center, direction, radius, halfHeigh, orientation, maxDistance, layerMask, this.RaycastHits));
 }
예제 #10
0
 public int SphereCastAll(PxVec3 origin, float radius, PxVec3 direction, float maxDistance,
                          int layerMask)
 {
     return(PhysXDll.SphereCastAll(this.scenePtr, origin, direction, radius, maxDistance, layerMask, this.RaycastHits));
 }
 public int CapsuleCastAll(CapsuleAxis axis, PxVec3 center, float radius, float halfHeigh, PxVec3 direction)
 {
     return(CapsuleCastAll(axis, center, radius, halfHeigh, direction, -1));
 }
예제 #12
0
 public bool SphereCast(PxVec3 origin, float radius, PxVec3 direction, out PxRaycastHit hitInfo, float maxDistance, int layerMask)
 {
     return(PhysXDll.SphereCast(this.scenePtr, origin, direction, radius, maxDistance, layerMask, out hitInfo));
 }
예제 #13
0
 public int SphereCastAll(PxVec3 origin, float radius, PxVec3 direction)
 {
     return(SphereCastAll(origin, radius, direction, -1));
 }
예제 #14
0
 public bool SphereCast(PxVec3 origin, float radius, PxVec3 direction, out PxRaycastHit hitInfo)
 {
     return(PhysXDll.SphereCast(this.scenePtr, origin, direction, radius, -1, out hitInfo));
 }
예제 #15
0
 public bool SphereCast(PxVec3 origin, PxVec3 direction, float radius)
 {
     return(PhysXDll.SphereCast(this.scenePtr, origin, direction, radius, -1));
 }
예제 #16
0
 public override void SetTransform(PxVec3 p, PxVec4 r)
 {
     Physics.SetActorTransform(this.ptr, p, r);
     base.SetTransform(p, r);
 }
 public bool CapsuleCast(CapsuleAxis axis, PxVec3 center, float radius, float halfHeigh, PxVec3 direction, out PxRaycastHit hitInfo, float maxDistance)
 {
     return(CapsuleCast(axis, center, radius, halfHeigh, direction, out hitInfo, maxDistance, PxVec4.Identity));
 }
예제 #18
0
 private static void OnSceneUpdate(IntPtr scenePtr, IntPtr colliderPtr, PxVec3 position, PxVec4 rotation)
 {
     NLog.Log.Assert(scenes.TryGetValue(scenePtr, out PhysicsScene scene));
     scene.OnUpdate(colliderPtr, position, rotation);
 }
 public bool CapsuleCast(CapsuleAxis axis, PxVec3 center, float radius, float halfHeigh, PxVec3 direction, out PxRaycastHit hitInfo, float maxDistance, int layerMask, PxVec4 orientation)
 {
     return(PhysXDll.CapsuleCast(this.scenePtr, (int)axis, center, direction, radius, halfHeigh, orientation, maxDistance, layerMask, out hitInfo));
 }
 public bool Raycast(PxVec3 origin, PxVec3 direction, out PxRaycastHit hitInfo)
 {
     return(Raycast(origin, direction, out hitInfo, -1));
 }
 public int CapsuleCastAll(CapsuleAxis axis, PxVec3 center, float radius, float halfHeigh, PxVec3 direction, int layerMask, PxVec4 orientation)
 {
     return(CapsuleCastAll(axis, center, radius, halfHeigh, direction, -1, layerMask, orientation));
 }
예제 #22
0
 public static CollisionFlags Move(IntPtr p, PxVec3 motion, ref PxVec3 footPos)
 {
     return((CollisionFlags)PhysXDll.MoveController(p, motion, ref footPos));
 }
 public int CapsuleCastAll(CapsuleAxis axis, PxVec3 center, float radius, float halfHeigh, PxVec3 direction, float maxDistance, int layerMask)
 {
     return(CapsuleCastAll(axis, center, radius, halfHeigh, direction, maxDistance, layerMask, PxVec4.Identity));
 }
예제 #24
0
        private bool IsValidForTriangleMesh()
        {
            PxVec3 absXYZ = this.scale.Abs;

            return(absXYZ.MaxElement <= PX_MESH_SCALE_MAX && absXYZ.MinElement >= PX_MESH_SCALE_MIN);
        }
예제 #25
0
 public override void SetTransform(PxVec3 pos, PxVec4 rot)
 {
     Physics.SetActorTransform(this.Ptr, pos, rot);
     base.SetTransform(pos, rot);
 }
 public bool Raycast(PxVec3 origin, PxVec3 direction, int layerMask)
 {
     return(Raycast(origin, direction, -1, layerMask));
 }
예제 #27
0
 public static void SetActorTransform(IntPtr p, PxVec3 position, PxVec4 rotation)
 {
     PhysXDll.SetActorTransform(p, position, rotation);
 }
 public bool Raycast(PxVec3 origin, PxVec3 direction, float maxDistance, int layerMask)
 {
     return(PhysXDll.Raycast(this.scenePtr, origin, direction, maxDistance, layerMask));
 }
 public bool CapsuleCast(CapsuleAxis axis, PxVec3 center, float radius, float halfHeigh, PxVec3 direction, int layerMask)
 {
     return(CapsuleCast(axis, center, radius, halfHeigh, direction, -1, layerMask));
 }
 public bool Linecast(PxVec3 start, PxVec3 end)
 {
     return(Raycast(start, end - start));
 }