#include <AbstractGeom.h>
Public Types | |
enum | ECopyOpts { COPY_BODIES = 0x1, COPY_CHILDREN = 0x2, COPY_ALL = 0xffffffff } |
Options for geoms and spaces copy constructors. More... | |
Public Member Functions | |
AbstractGeom () | |
osg::BoundingBox | getAABB () const |
bool | isSpace () const |
Returns true if this geom is a space. | |
virtual Space * | asSpace () |
virtual Geom * | asGeom () |
virtual const Space * | asSpace () const |
virtual const Geom * | asGeom () const |
Space * | getParentSpace () |
Returns NULL if it has no parent (top most space). | |
const Space * | getParentSpace () const |
bool | operator< (const AbstractGeom &g) const |
bool | operator== (const AbstractGeom &g) const |
Visitor methods | |
virtual void | accept (Visitor &v) |
virtual void | traverse (Visitor &v) |
Traverse children. | |
Static Public Member Functions | |
static AbstractGeom * | clone (const AbstractGeom &v, UINT opts=COPY_ALL, IGeomCollisionContainer *pGeomsContainer=NULL, TDuplicatedBodiesMap *pDuplicatedBodies=NULL) |
Copies an abstract geom (without adding it to the same parent space), whatever its type is. | |
Protected Member Functions | |
dSpaceID | asSpaceId () |
virtual | ~AbstractGeom () |
Protected destructor forces the object to be deleted by being dereferenced. | |
Protected Attributes | |
dGeomID | id |
Can be seen as a dSpaceID, with asSpaceId(). | |
Friends | |
class | Geom |
class | Space |
class | World |
Definition at line 69 of file AbstractGeom.h.
Options for geoms and spaces copy constructors.
COPY_BODIES | Copies bodies attached to a geom. |
COPY_CHILDREN | Copies spaces and geoms included into a space. |
COPY_ALL |
Definition at line 74 of file AbstractGeom.h.
Physics::AbstractGeom::AbstractGeom | ( | ) | [inline] |
Definition at line 71 of file AbstractGeom.h.
virtual Physics::AbstractGeom::~AbstractGeom | ( | ) | [inline, protected, virtual] |
Protected destructor forces the object to be deleted by being dereferenced.
Also avoids the object from beeing created on the stack.
Definition at line 145 of file AbstractGeom.h.
void Physics::AbstractGeom::accept | ( | Visitor & | v | ) | [virtual] |
Reimplemented in Physics::Geom, and Physics::Space.
Definition at line 42 of file AbstractGeom.cpp.
References Physics::Visitor::apply().
Referenced by Physics::Space::traverse().
virtual const Geom* Physics::AbstractGeom::asGeom | ( | ) | const [inline, virtual] |
virtual Geom* Physics::AbstractGeom::asGeom | ( | ) | [inline, virtual] |
Reimplemented in Physics::Geom.
Definition at line 106 of file AbstractGeom.h.
Referenced by clone(), and Physics::combinedTraversal().
virtual const Space* Physics::AbstractGeom::asSpace | ( | ) | const [inline, virtual] |
virtual Space* Physics::AbstractGeom::asSpace | ( | ) | [inline, virtual] |
Reimplemented in Physics::Space.
Definition at line 105 of file AbstractGeom.h.
Referenced by clone(), Physics::combinedTraversal(), Physics::World::resetSpaceCollideFlag(), and Physics::World::spaceCollide().
dSpaceID Physics::AbstractGeom::asSpaceId | ( | ) | [inline, protected] |
Definition at line 141 of file AbstractGeom.h.
References ASSERT.
Referenced by Physics::Space::add(), Physics::Space::init(), Physics::Space::initHash(), and Physics::World::spaceCollide().
AbstractGeom * Physics::AbstractGeom::clone | ( | const AbstractGeom & | v, | |
UINT | opts = COPY_ALL , |
|||
IGeomCollisionContainer * | pGeomsContainer = NULL , |
|||
TDuplicatedBodiesMap * | pDuplicatedBodies = NULL | |||
) | [static] |
Copies an abstract geom (without adding it to the same parent space), whatever its type is.
This can potentially copy the geoms & bodies it contains, according to opts
.
v | Abstract geom to copy. | |
opts | Copy options (says what to copy and what not). | |
pGeomsContainer | Collision container to use upon Geom copy only (does not make sense for a Space). | |
pDuplicatedBodies | Map of original bodies and corresponding duplicated bodies (used for composite object copy), or NULL. |
Definition at line 34 of file AbstractGeom.cpp.
References asGeom(), ASSERT, asSpace(), Geom, and Space.
Referenced by Physics::Space::Space().
osg::BoundingBox Physics::AbstractGeom::getAABB | ( | ) | const [inline] |
const Space* Physics::AbstractGeom::getParentSpace | ( | ) | const [inline] |
Returns NULL
if it has no parent (top most space).
There is no setParentSpace() because it is useless : just add the abstract geom to a space by calling Space::add()
Definition at line 124 of file AbstractGeom.h.
Space* Physics::AbstractGeom::getParentSpace | ( | ) | [inline] |
Returns NULL
if it has no parent (top most space).
There is no setParentSpace() because it is useless : just add the abstract geom to a space by calling Space::add()
Definition at line 118 of file AbstractGeom.h.
Referenced by Physics::Space::add(), and C3DPhy::addSpace().
bool Physics::AbstractGeom::isSpace | ( | ) | const [inline] |
Returns true
if this geom is a space.
Definition at line 104 of file AbstractGeom.h.
Referenced by Physics::combinedTraversal(), and Physics::NearCallback::operator()().
bool Physics::AbstractGeom::operator< | ( | const AbstractGeom & | g | ) | const [inline] |
bool Physics::AbstractGeom::operator== | ( | const AbstractGeom & | g | ) | const [inline] |
virtual void Physics::AbstractGeom::traverse | ( | Visitor & | v | ) | [inline, virtual] |
Traverse children.
Reimplemented in Physics::Geom, and Physics::Space.
Definition at line 113 of file AbstractGeom.h.
Referenced by Physics::Visitor::traverse().
friend class Geom [friend] |
friend class Space [friend] |
friend class World [friend] |
dGeomID Physics::AbstractGeom::id [mutable, protected] |
Can be seen as a dSpaceID, with asSpaceId().
Definition at line 140 of file AbstractGeom.h.
Referenced by Physics::Space::add(), Physics::Geom::collide(), operator<(), operator==(), and Physics::World::spaceCollide2().