public IntPtr AddBoxCollider(PxBoxCollider box) { IntPtr boxPtr = PhysXDll.AddBoxCollider(this.scenePtr, box.ColliderData, box.IsDynamic); this.Colliders.Add(boxPtr, box); return(boxPtr); }
public IntPtr AddCapsuleCollider(PxCapsuleCollider capsule) { IntPtr capsulePtr = PhysXDll.AddCapsuleCollider(this.scenePtr, capsule.ColliderData, capsule.IsDynamic); this.Colliders.Add(capsulePtr, capsule); return(capsulePtr); }
public static PxVec3 GetControllerPosition(IntPtr p) { var position = new PxVec3(); PhysXDll.GetControllerPosition(p, ref position); return(position); }
public IntPtr AddMeshCollider(PxMeshCollider mesh) { IntPtr meshPtr = PhysXDll.AddMeshCollider(this.scenePtr, mesh.ColliderData, mesh.ColliderData.vertices, mesh.ColliderData.triangles); this.Colliders.Add(meshPtr, mesh); return(meshPtr); }
public IntPtr AddSphereCollider(PxSphereCollider sphere) { IntPtr spherePtr = PhysXDll.AddSphereCollider(this.scenePtr, sphere.ColliderData, sphere.IsDynamic); this.Colliders.Add(spherePtr, sphere); return(spherePtr); }
public static PhysicsScene CreateScene() { IntPtr p = PhysXDll.CreateScene(); PhysicsScene scene = new PhysicsScene(p); scenes[p] = scene; return(scene); }
public static void Release() { if (isInited) { PhysXDll.Release(); } isInited = false; }
public static void Initialize() { if (!isInited) { PhysXDll.SetErrorCallback(onErrorOutput); PhysXDll.Initialize(); PhysXDll.RegistSceneUpdateCallback(onSceneUpdate); isInited = true; } }
public static IntPtr AddCharacterController(IntPtr scene, PxCapsuleController controller) { PhysXDll.OnFilterCallback filterWorld = null; PhysXDll.OnFilterCallback filterController = null; PhysXDll.OnHitCallback hitShape = null; PhysXDll.OnHitCallback hitController = null; if (controller.Filter != null) { filterWorld = onFilterWorld; filterController = onFilterController; } if (controller.HitReport != null) { hitShape = onHitShape; hitController = onHitController; } return(PhysXDll.AddCharacterController(scene, controller.ControllerData, filterWorld, filterController, hitShape, hitController)); }
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 void SetActorTransform(IntPtr p, PxVec3 position, PxVec4 rotation) { PhysXDll.SetActorTransform(p, position, rotation); }
public static void SetFilterEnabled(IntPtr p, bool enabled) { PhysXDll.SetFilterEnabled(p, enabled); }
public static void IgnoreControllerLayerCollision(int layer1, int layer2, bool ignore = true) { PhysXDll.IgnoreControllerLayerCollision(layer1, layer2, ignore); }
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 bool Raycast(PxVec3 origin, PxVec3 direction, float maxDistance, int layerMask) { return(PhysXDll.Raycast(this.scenePtr, origin, direction, maxDistance, layerMask)); }
public bool SphereCast(PxVec3 origin, PxVec3 direction, float radius) { return(PhysXDll.SphereCast(this.scenePtr, origin, direction, radius, -1)); }
public void RemoveCollider(IntPtr colliderPtr) { NLog.Log.Assert(this.Colliders.Remove(colliderPtr)); PhysXDll.RemoveCollider(this.scenePtr, colliderPtr); }
public static void ReleaseScene(IntPtr scenePtr) { NLog.Log.Assert(scenes.Remove(scenePtr)); PhysXDll.ReleaseScene(scenePtr); }
public static void SetShapeInSceneQueryEnabled(IntPtr p, bool enabled) { PhysXDll.SetShapeInSceneQueryEnabled(p, enabled); }
public static void SetActorGravity(IntPtr p, bool useGravity) { PhysXDll.SetActorGravity(p, useGravity); }
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 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 bool Raycast(PxVec3 origin, PxVec3 direction) { return(PhysXDll.Raycast(this.scenePtr, origin, direction, -1)); }
public bool Raycast(PxVec3 origin, PxVec3 direction, out PxRaycastHit hitInfo, float maxDistance) { return(PhysXDll.Raycast(this.scenePtr, origin, direction, maxDistance, out hitInfo)); }
public bool SphereCast(PxVec3 origin, float radius, PxVec3 direction, out PxRaycastHit hitInfo) { return(PhysXDll.SphereCast(this.scenePtr, origin, direction, radius, -1, out hitInfo)); }
public static CollisionFlags Move(IntPtr p, PxVec3 motion, ref PxVec3 footPos) { return((CollisionFlags)PhysXDll.MoveController(p, motion, ref footPos)); }
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 void Update(float deltaTime) { PhysXDll.Update(this.scenePtr, deltaTime); }
public int RaycastAll(PxVec3 origin, PxVec3 direction, float maxDistance) { return(PhysXDll.RaycastAll(this.scenePtr, origin, direction, maxDistance, this.RaycastHits)); }