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);
     }
 }
Beispiel #2
0
        public override void DrawGizmos()
        {
            PxVec4 drawRot = this.rotation;

            if (this.ColliderData.direction == 0)
            {
                //X-Axis
                PxVec4 rotationDelta = PxVec4.AngleAxis(90f, PxVec3.forward);
                drawRot *= rotationDelta;
            }
            else if (this.ColliderData.direction == 2)
            {
                //Z-Axis
                PxVec4 rotationDelta = PxVec4.AngleAxis(90f, PxVec3.right);
                drawRot *= rotationDelta;
            }

            GizmosUtil.DrawCapsule(this.position, drawRot,
                                   this.ColliderData.halfHeight * 2 + this.ColliderData.radius * 2,
                                   this.ColliderData.radius, Color.green, new Color());
        }
 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));
 }
 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));
 }
 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 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));
 }
Beispiel #8
0
 public static extern bool BoxCast(IntPtr scene, PxVec3 origin, PxVec3 direction, PxVec3 halfExtents, PxVec4 orientation, float maxDistance, int layerMask, out PxRaycastHit hitInfo);
Beispiel #9
0
 public bool Equals(PxVec4 other)
 {
     return(w.EqualsEx(other.w) && x.EqualsEx(other.x) && y.EqualsEx(other.y) && z.EqualsEx(other.z));
 }
Beispiel #10
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 override void SetTransform(PxVec3 p, PxVec4 r)
 {
     Physics.SetActorTransform(this.ptr, p, r);
     base.SetTransform(p, r);
 }
Beispiel #12
0
 public static extern void SetActorTransform(IntPtr p, PxVec3 position, PxVec4 rotation);
Beispiel #13
0
 public static extern int CapsuleCastAll(IntPtr scene, int axis, PxVec3 origin, PxVec3 direction, float radius, float halfHeight, PxVec4 orientation, float maxDistance, int layerMask, [In, Out] PxRaycastHit[] hits);
Beispiel #14
0
 public static extern bool CapsuleCast(IntPtr scene, int axis, PxVec3 origin, PxVec3 direction, float radius, float halfHeight, PxVec4 orientation, float maxDistance, int layerMask, out PxRaycastHit hitInfo);
Beispiel #15
0
 public static extern bool CapsuleCast(IntPtr scene, int axis, PxVec3 origin, PxVec3 direction, float radius, float halfHeight, PxVec4 orientation, float maxDistance);
Beispiel #16
0
 public static extern int BoxCastAll(IntPtr scene, PxVec3 origin, PxVec3 direction, PxVec3 halfExtents, PxVec4 orientation, float maxDistance, int layerMask, [In, Out] PxRaycastHit[] hits);
 public override void SetTransform(PxVec3 pos, PxVec4 rot)
 {
     Physics.SetActorTransform(this.Ptr, pos, rot);
     base.SetTransform(pos, rot);
 }
Beispiel #18
0
 public static void SetActorTransform(IntPtr p, PxVec3 position, PxVec4 rotation)
 {
     PhysXDll.SetActorTransform(p, position, rotation);
 }
 public bool CapsuleCast(CapsuleAxis axis, PxVec3 center, float radius, float halfHeight, PxVec3 direction, PxVec4 orientation)
 {
     return(CapsuleCast(axis, center, radius, halfHeight, direction, -1, orientation));
 }
Beispiel #20
0
 public static extern bool BoxCast(IntPtr scene, PxVec3 origin, PxVec3 direction, PxVec3 halfExtents, PxVec4 orientation, float maxDistance);