PxAggregate Class Reference
[Physics]
Class to aggregate actors into a single broad phase entry.
More...
#include <PxAggregate.h>
![Inheritance graph](classPxAggregate__inherit__graph.png)
![Collaboration graph](classPxAggregate__coll__graph.png)
Public Member Functions | |
virtual void | release ()=0 |
Deletes the aggregate object. | |
virtual bool | addActor (PxActor &actor)=0 |
Adds an actor to the aggregate object. | |
virtual bool | removeActor (PxActor &actor)=0 |
Removes an actor from the aggregate object. | |
virtual bool | addArticulation (PxArticulation &articulation)=0 |
Adds an articulation to the aggregate object. | |
virtual bool | removeArticulation (PxArticulation &articulation)=0 |
Removes an articulation from the aggregate object. | |
virtual PxU32 | getNbActors () const =0 |
Returns the number of actors contained in the aggregate. | |
virtual PxU32 | getMaxNbActors () const =0 |
Retrieves max amount of actors that can be contained in the aggregate. | |
virtual PxU32 | getActors (PxActor **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0 |
Retrieve all actors contained in the aggregate. | |
virtual PxScene * | getScene ()=0 |
Retrieves the scene which this aggregate belongs to. | |
virtual bool | getSelfCollision () const =0 |
Retrieves aggregate's self-collision flag. | |
virtual const char * | getConcreteTypeName () const |
returns string name of dynamic type. | |
Protected Member Functions | |
PxAggregate (PxRefResolver &v) | |
PxAggregate () | |
virtual | ~PxAggregate () |
virtual bool | isKindOf (const char *name) const |
Detailed Description
Class to aggregate actors into a single broad phase entry.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", where multiple objects of a single entity often overlap all the time (e.g. typically in a ragdoll).
2) it reduces broad-phase memory usage (which can be vital e.g. on SPU)
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.
- See also:
- PxActor
Constructor & Destructor Documentation
PxAggregate::PxAggregate | ( | PxRefResolver & | v | ) | [inline, protected] |
PxAggregate::PxAggregate | ( | ) | [inline, protected] |
virtual PxAggregate::~PxAggregate | ( | ) | [inline, protected, virtual] |
Member Function Documentation
virtual bool PxAggregate::addActor | ( | PxActor & | actor | ) | [pure virtual] |
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.
- Parameters:
-
[in] actor The actor that should be added to the aggregate return true if success
virtual bool PxAggregate::addArticulation | ( | PxArticulation & | articulation | ) | [pure virtual] |
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.
- Parameters:
-
[in] articulation The articulation that should be added to the aggregate return true if success
virtual PxU32 PxAggregate::getActors | ( | PxActor ** | userBuffer, | |
PxU32 | bufferSize, | |||
PxU32 | startIndex = 0 | |||
) | const [pure virtual] |
Retrieve all actors contained in the aggregate.
You can retrieve the number of actor pointers by calling getNbActors()
- Parameters:
-
[out] userBuffer The buffer to store the actor pointers. [in] bufferSize Size of provided user buffer. [in] startIndex Index of first actor pointer to be retrieved
- Returns:
- Number of actor pointers written to the buffer.
- See also:
- PxShape getNbShapes()
virtual const char* PxAggregate::getConcreteTypeName | ( | ) | const [inline, virtual] |
returns string name of dynamic type.
- Returns:
- class name of most derived type of this object.
Reimplemented from PxSerializable.
virtual PxU32 PxAggregate::getMaxNbActors | ( | ) | const [pure virtual] |
Retrieves max amount of actors that can be contained in the aggregate.
- Returns:
- Max aggregate size.
- See also:
- PxPhysics::createAggregate()
virtual PxU32 PxAggregate::getNbActors | ( | ) | const [pure virtual] |
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:
- PxActor getActors()
virtual PxScene* PxAggregate::getScene | ( | ) | [pure virtual] |
Retrieves the scene which this aggregate belongs to.
- Returns:
- Owner Scene. NULL if not part of a scene.
- See also:
- PxScene
virtual bool PxAggregate::getSelfCollision | ( | ) | const [pure virtual] |
Retrieves aggregate's self-collision flag.
- Returns:
- self-collision flag
virtual bool PxAggregate::isKindOf | ( | const char * | name | ) | const [inline, protected, virtual] |
virtual void PxAggregate::release | ( | ) | [pure virtual] |
Deletes the aggregate object.
Deleting the PxAggregate object does not delete the aggregated actors. If the PxAggregate object belongs to a scene, the aggregated actors are automatically re-inserted in that scene. If you intend to delete both the PxAggregate and its actors, it is best to release the actors first, then release the PxAggregate when it is empty.
virtual bool PxAggregate::removeActor | ( | PxActor & | actor | ) | [pure virtual] |
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.
- Parameters:
-
[in] actor The actor that should be removed from the aggregate return true if success
virtual bool PxAggregate::removeArticulation | ( | PxArticulation & | articulation | ) | [pure virtual] |
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 PxArticulation::release() directly. That way the articulation will be automatically removed from its aggregate (if any) and not reinserted in a scene.
- Parameters:
-
[in] articulation The articulation that should be removed from the aggregate return true if success
The documentation for this class was generated from the following file:
Copyright © 2008-2012 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com