Proxies
A proxy in the d-collide terminology is simply an object in the 3d-world that can collide with other objects. For example a car and a wall would both be proxies (usually two separate proxies).The term "proxy" stems from the fact that usually you have a very detailed base object that is used for (e.g.) rendering the object, but you want to use a different, much less detailed object for collision detection, to improve the collision detection speed. This less detailed object therefore serves as a "proxy" for the actual object.
Attention: The Proxy constructors are protected. Use World::createProxy methods to create them for a given world.
dcollide::Proxy objects can build a hierarchy. They can be added
- to the dcollide::World as "top-level-proxies" - see World::addProxy
- to other existing proxies as children - see Proxy::addChild This hierarchy is also called a scene graph, with the dcollide::World beeing the root node.
The dcollide::Proxy object defines the position and orientation (i.e. a rotation matrix), the dcollide::Shape of the object, it's type (rigid or deformable, see Rigid versus Deformable objects/proxies) as well as some other properties (self-collidable, moving, ...) of the object.
Proxies can have a dcollide::Shape defining how it looks like, i.e. whether it is a dcollide::Box, a dcollide::Sphere or even an arbitrary triangle dcollide::Mesh. A Proxy cannot have more than one dcollide::Shape, but as mentioned before, Proxies can act as containers for other proxies. Making use of the hierarchy, it is possible to model a complex object using basic geometrical shapes (which is important for the speed of the collision detection).
A dcollide::Shape object itself cannot have children and also cannot change its position or orientation (both are usually defined by the class itself, e.g. the center of a dcollide::Sphere is always at (0,0,0)). These parameters are always defined by the parent proxy.
Whenever a dcollide::Proxy is moved or rotated, the whole hierarchy moves or rotates along, i.e. the Proxy objects behave like a scenegraph. When a child of a dcollide::Proxy is moved or rotated, it does not influence the position or orientation of its parent.