A PxAggregate object is a collection of PxActors, which will exist as a single entry in the broad-phase structures. This has 3 main benefits:
1) it reduces "broad phase pollution" by allowing a collection of spatially coherent broad-phase entries to be replaced by a single aggregated entry (e.g. a ragdoll or a single actor with a large number of attached shapes).
2) it reduces broad-phase memory usage
3) filtering can be optimized a lot if self-collisions within an aggregate are not needed. For example if you don't need collisions between ragdoll bones, it's faster to simply disable filtering once and for all, for the aggregate containing the ragdoll, rather than filtering out each bone-bone collision in the filter shader.
-
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 TypeMethodDescriptionbooleanAdds an actor to the aggregate object.booleanAdds an actor to the aggregate object.booleanaddArticulation(PxArticulationReducedCoordinate articulation) Adds an articulation to the aggregate object.static PxAggregatearrayGet(long baseAddress, int index) intRetrieves max amount of actors that can be contained in the aggregate.intRetrieves max amount of shapes that can be contained in the aggregate.intReturns the number of actors contained in the aggregate.getScene()Retrieves the scene which this aggregate belongs to.booleanRetrieves aggregate's self-collision flag.booleanremoveActor(PxActor actor) Removes an actor from the aggregate object.booleanremoveArticulation(PxArticulationReducedCoordinate articulation) Removes an articulation from the aggregate object.static PxAggregatewrapPointer(long address) Methods inherited from class physx.common.PxBase
getBaseFlags, getConcreteType, getConcreteTypeName, isReleasable, release, setBaseFlag, setBaseFlagsMethods 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
-
PxAggregate
protected PxAggregate() -
PxAggregate
protected PxAggregate(long address)
-
-
Method Details
-
wrapPointer
-
arrayGet
-
addActor
Adds an actor to the aggregate object.A warning is output if the total number of actors is reached, or if the incoming actor already belongs to an aggregate.
If the aggregate belongs to a scene, adding an actor to the aggregate also adds the actor to that scene.
If the actor already belongs to a scene, a warning is output and the call is ignored. You need to remove the actor from the scene first, before adding it to the aggregate.
Note: When a BVH is provided the actor shapes are grouped together. The scene query pruning structure inside PhysX SDK will store/update one bound per actor. The scene queries against such an actor will query actor bounds and then make a local space query against the provided BVH, which is in actor's local space.
return true if success
-
addActor
Adds an actor to the aggregate object.A warning is output if the total number of actors is reached, or if the incoming actor already belongs to an aggregate.
If the aggregate belongs to a scene, adding an actor to the aggregate also adds the actor to that scene.
If the actor already belongs to a scene, a warning is output and the call is ignored. You need to remove the actor from the scene first, before adding it to the aggregate.
Note: When a BVH is provided the actor shapes are grouped together. The scene query pruning structure inside PhysX SDK will store/update one bound per actor. The scene queries against such an actor will query actor bounds and then make a local space query against the provided BVH, which is in actor's local space.
return true if success
-
removeActor
Removes an actor from the aggregate object.A warning is output if the incoming actor does not belong to the aggregate. Otherwise the actor is removed from the aggregate. If the aggregate belongs to a scene, the actor is reinserted in that scene. If you intend to delete the actor, it is best to call #PxActor::release() directly. That way the actor will be automatically removed from its aggregate (if any) and not reinserted in a scene.
return true if success
-
addArticulation
Adds an articulation to the aggregate object.A warning is output if the total number of actors is reached (every articulation link counts as an actor), or if the incoming articulation already belongs to an aggregate.
If the aggregate belongs to a scene, adding an articulation to the aggregate also adds the articulation to that scene.
If the articulation already belongs to a scene, a warning is output and the call is ignored. You need to remove the articulation from the scene first, before adding it to the aggregate.
return true if success
-
removeArticulation
Removes an articulation from the aggregate object.A warning is output if the incoming articulation does not belong to the aggregate. Otherwise the articulation is removed from the aggregate. If the aggregate belongs to a scene, the articulation is reinserted in that scene. If you intend to delete the articulation, it is best to call #PxArticulationReducedCoordinate::release() directly. That way the articulation will be automatically removed from its aggregate (if any) and not reinserted in a scene.
return true if success
-
getNbActors
public int getNbActors()Returns the number of actors contained in the aggregate.You can use #getActors() to retrieve the actor pointers.
- Returns:
- Number of actors contained in the aggregate.
- See Also:
-
getMaxNbActors
public int getMaxNbActors()Retrieves max amount of actors that can be contained in the aggregate.- Returns:
- Max actor size.
-
getMaxNbShapes
public int getMaxNbShapes()Retrieves max amount of shapes that can be contained in the aggregate.- Returns:
- Max shape size.
-
getScene
Retrieves the scene which this aggregate belongs to.- Returns:
- Owner Scene. NULL if not part of a scene.
- See Also:
-
getSelfCollision
public boolean getSelfCollision()Retrieves aggregate's self-collision flag.- Returns:
- self-collision flag
-