In addition you can use PxPhysics to set global parameters which will effect all scenes and create objects that can be shared across multiple scenes.
You can get an instance of this class by calling PxCreatePhysics().
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class physx.NativeObject
NativeObject.Allocator<T> -
Field Summary
FieldsFields inherited from class physx.NativeObject
address, isExternallyAllocated, SIZEOF_BYTE, SIZEOF_DOUBLE, SIZEOF_FLOAT, SIZEOF_INT, SIZEOF_LONG, SIZEOF_POINTER, SIZEOF_SHORT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PxPhysicsarrayGet(long baseAddress, int index) createAggregate(int maxActor, int maxShape, boolean enableSelfCollision) Creates an aggregate with the specified maximum size and filtering hint.Creates a reduced-coordinate articulation with all fields initialized to their default values.createMaterial(float staticFriction, float dynamicFriction, float restitution) Creates a new rigid body material with certain default properties.createParticleBuffer(int maxParticles, int maxVolumes, PxCudaContextManager cudaContextManager) Create particle buffer to simulate fluid/granular material.createParticleClothBuffer(int maxParticles, int maxNumVolumes, int maxNumCloths, int maxNumTriangles, int maxNumSprings, PxCudaContextManager cudaContextManager) Create a particle buffer to simulate particle cloth.createPBDMaterial(float friction, float damping, float adhesion, float viscosity, float vorticityConfinement, float surfaceTension, float cohesion, float lift, float drag) Creates a new PBD material with certain default properties.createPBDMaterial(float friction, float damping, float adhesion, float viscosity, float vorticityConfinement, float surfaceTension, float cohesion, float lift, float drag, float cflCoefficient) Creates a new PBD material with certain default properties.createPBDMaterial(float friction, float damping, float adhesion, float viscosity, float vorticityConfinement, float surfaceTension, float cohesion, float lift, float drag, float cflCoefficient, float gravityScale) Creates a new PBD material with certain default properties.createPBDParticleSystem(PxCudaContextManager cudaContextManager) Creates a particle system with a position-based dynamics (PBD) solver.createPBDParticleSystem(PxCudaContextManager cudaContextManager, int maxNeighborhood) Creates a particle system with a position-based dynamics (PBD) solver.Creates a dynamic rigid actor with the specified pose and all other fields initialized to their default values.createRigidStatic(PxTransform pose) Creates a static rigid actor with the specified pose and all other fields initialized to their default values.createScene(PxSceneDesc sceneDesc) Creates a scene.createShape(PxGeometry geometry, PxMaterial material) Creates a shape which may be attached to multiple actorscreateShape(PxGeometry geometry, PxMaterial material, boolean isExclusive) Creates a shape which may be attached to multiple actorscreateShape(PxGeometry geometry, PxMaterial material, boolean isExclusive, PxShapeFlags shapeFlags) Creates a shape which may be attached to multiple actorsvoiddestroy()Retrieves the Foundation instance.intReturn the number of shapes that currently exist.Gets PxPhysics object insertion interface.Returns the simulation tolerance parameters.voidrelease()Destroys the instance it is called on.static PxPhysicswrapPointer(long address) Methods inherited from class physx.NativeObject
checkNotNull, equals, getAddress, hashCode
-
Field Details
-
SIZEOF
public static final int SIZEOF -
ALIGNOF
public static final int ALIGNOF- See Also:
-
-
Constructor Details
-
PxPhysics
protected PxPhysics() -
PxPhysics
protected PxPhysics(long address)
-
-
Method Details
-
wrapPointer
-
arrayGet
-
destroy
public void destroy() -
release
public void release()Destroys the instance it is called on.Use this release method to destroy an instance of this class. Be sure to not keep a reference to this object after calling release. Avoid release calls while a scene is simulating (in between simulate() and fetchResults() calls).
Note that this must be called once for each prior call to PxCreatePhysics, as there is a reference counter. Also note that you mustn't destroy the PxFoundation instance (holding the allocator, error callback etc.) until after the reference count reaches 0 and the SDK is actually removed.
Releasing an SDK will also release any objects created through it (scenes, triangle meshes, convex meshes, heightfields, shapes etc.), provided the user hasn't already done so.
Note: Releasing the PxPhysics instance is a prerequisite to releasing the PxFoundation instance.
- See Also:
-
getFoundation
Retrieves the Foundation instance.- Returns:
- A reference to the Foundation object.
-
createAggregate
Creates an aggregate with the specified maximum size and filtering hint.The previous API used "bool enableSelfCollision" which should now silently evaluates to a PxAggregateType::eGENERIC aggregate with its self-collision bit.
Use PxAggregateType::eSTATIC or PxAggregateType::eKINEMATIC for aggregates that will only contain static or kinematic actors. This provides faster filtering when used in combination with PxPairFilteringMode.
- Returns:
- The new aggregate.
- See Also:
-
getTolerancesScale
Returns the simulation tolerance parameters.- Returns:
- The current simulation tolerance parameters.
-
createScene
Creates a scene.Note: Every scene uses a Thread Local Storage slot. This imposes a platform specific limit on the number of scenes that can be created.
- Returns:
- The new scene object.
- See Also:
-
createRigidStatic
Creates a static rigid actor with the specified pose and all other fields initialized to their default values.- See Also:
-
createRigidDynamic
Creates a dynamic rigid actor with the specified pose and all other fields initialized to their default values.- See Also:
-
createShape
Creates a shape which may be attached to multiple actorsThe shape will be created with a reference count of 1.
- Returns:
- The shape
Note: Shared shapes are not mutable when they are attached to an actor
- See Also:
-
createShape
Creates a shape which may be attached to multiple actorsThe shape will be created with a reference count of 1.
- Returns:
- The shape
Note: Shared shapes are not mutable when they are attached to an actor
- See Also:
-
createShape
public PxShape createShape(PxGeometry geometry, PxMaterial material, boolean isExclusive, PxShapeFlags shapeFlags) Creates a shape which may be attached to multiple actorsThe shape will be created with a reference count of 1.
- Returns:
- The shape
Note: Shared shapes are not mutable when they are attached to an actor
- See Also:
-
getNbShapes
public int getNbShapes()Return the number of shapes that currently exist.- Returns:
- Number of shapes.
-
createArticulationReducedCoordinate
Creates a reduced-coordinate articulation with all fields initialized to their default values.- Returns:
- the new articulation
- See Also:
-
createMaterial
Creates a new rigid body material with certain default properties.- Returns:
- The new rigid body material.
- See Also:
-
getPhysicsInsertionCallback
Gets PxPhysics object insertion interface.The insertion interface is needed for PxCreateTriangleMesh, PxCooking::createTriangleMesh etc., this allows runtime mesh creation.
PxCooking::createTriangleMesh PxCooking::createHeightfield PxCooking::createTetrahedronMesh PxCooking::createBVH
-
createPBDParticleSystem
Creates a particle system with a position-based dynamics (PBD) solver.A PBD particle system can be used to simulate particle systems with fluid and granular particles. It also allows simulating cloth using mass-spring constraints and rigid bodies by shape matching the bodies with particles.
- Parameters:
cudaContextManager- The PxCudaContextManager this instance is tied to.- Returns:
- the new particle system
- See Also:
-
createPBDParticleSystem
public PxPBDParticleSystem createPBDParticleSystem(PxCudaContextManager cudaContextManager, int maxNeighborhood) Creates a particle system with a position-based dynamics (PBD) solver.A PBD particle system can be used to simulate particle systems with fluid and granular particles. It also allows simulating cloth using mass-spring constraints and rigid bodies by shape matching the bodies with particles.
- Parameters:
cudaContextManager- The PxCudaContextManager this instance is tied to.maxNeighborhood- The maximum number of particles considered in neighborhood-based particle interaction calculations (e.g. fluid density constraints).- Returns:
- the new particle system
- See Also:
-
createParticleBuffer
public PxParticleBuffer createParticleBuffer(int maxParticles, int maxVolumes, PxCudaContextManager cudaContextManager) Create particle buffer to simulate fluid/granular material.- Parameters:
maxParticles- The maximum number of particles in this buffer.maxVolumes- The maximum number of volumes in this buffer. See PxParticleVolume.cudaContextManager- The PxCudaContextManager this buffer is tied to.- Returns:
- PxParticleBuffer instance
- See Also:
-
createParticleClothBuffer
public PxParticleClothBuffer createParticleClothBuffer(int maxParticles, int maxNumVolumes, int maxNumCloths, int maxNumTriangles, int maxNumSprings, PxCudaContextManager cudaContextManager) Create a particle buffer to simulate particle cloth.- Parameters:
maxParticles- The maximum number of particles in this buffer.maxNumVolumes- The maximum number of volumes in this buffer. See #PxParticleVolume.maxNumCloths- The maximum number of cloths in this buffer. See #PxParticleCloth.maxNumTriangles- The maximum number of triangles for aerodynamics.maxNumSprings- The maximum number of springs to connect particles. See #PxParticleSpring.cudaContextManager- The PxCudaContextManager this buffer is tied to.- Returns:
- PxParticleClothBuffer instance
- See Also:
-
createPBDMaterial
public PxPBDMaterial createPBDMaterial(float friction, float damping, float adhesion, float viscosity, float vorticityConfinement, float surfaceTension, float cohesion, float lift, float drag) Creates a new PBD material with certain default properties.- Returns:
- The new PBD material.
- See Also:
-
createPBDMaterial
public PxPBDMaterial createPBDMaterial(float friction, float damping, float adhesion, float viscosity, float vorticityConfinement, float surfaceTension, float cohesion, float lift, float drag, float cflCoefficient) Creates a new PBD material with certain default properties.- Returns:
- The new PBD material.
- See Also:
-
createPBDMaterial
public PxPBDMaterial createPBDMaterial(float friction, float damping, float adhesion, float viscosity, float vorticityConfinement, float surfaceTension, float cohesion, float lift, float drag, float cflCoefficient, float gravityScale) Creates a new PBD material with certain default properties.- Returns:
- The new PBD material.
- See Also:
-