public static PxVec3 GetControllerPosition(IntPtr p) { var position = new PxVec3(); PhysXDll.GetControllerPosition(p, ref position); return(position); }
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 static PxVec3 Normalize(PxVec3 value) { var num = value.magnitude; if (num > 9.99999974737875E-06) { return(value / num); } return(zero); }
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)); }
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)); }
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)); }
public int SphereCastAll(PxVec3 origin, float radius, PxVec3 direction) { return(SphereCastAll(origin, radius, direction, -1)); }
public bool SphereCast(PxVec3 origin, float radius, PxVec3 direction, out PxRaycastHit hitInfo) { return(PhysXDll.SphereCast(this.scenePtr, origin, direction, radius, -1, out hitInfo)); }
public bool SphereCast(PxVec3 origin, PxVec3 direction, float radius) { return(PhysXDll.SphereCast(this.scenePtr, origin, direction, radius, -1)); }
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)); }
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)); }
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)); }
private bool IsValidForTriangleMesh() { PxVec3 absXYZ = this.scale.Abs; return(absXYZ.MaxElement <= PX_MESH_SCALE_MAX && absXYZ.MinElement >= PX_MESH_SCALE_MIN); }
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)); }
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)); }