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); } }
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)); }
public static extern bool BoxCast(IntPtr scene, PxVec3 origin, PxVec3 direction, PxVec3 halfExtents, PxVec4 orientation, float maxDistance, int layerMask, out PxRaycastHit hitInfo);
public bool Equals(PxVec4 other) { return(w.EqualsEx(other.w) && x.EqualsEx(other.x) && y.EqualsEx(other.y) && z.EqualsEx(other.z)); }
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); }
public static extern void SetActorTransform(IntPtr p, PxVec3 position, PxVec4 rotation);
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);
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);
public static extern bool CapsuleCast(IntPtr scene, int axis, PxVec3 origin, PxVec3 direction, float radius, float halfHeight, PxVec4 orientation, float maxDistance);
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); }
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)); }
public static extern bool BoxCast(IntPtr scene, PxVec3 origin, PxVec3 direction, PxVec3 halfExtents, PxVec4 orientation, float maxDistance);