H3DNetworkingUtils::CollisionGeometry Class Reference

The CollisionGeometry class is an abstract base class for a piece of simple geometry used to represent a complex geometry for the purposes of inter object collision - not rendered. More...

#include <H3DNetworkingUtils/CollisionGeometry.h>

Inheritance diagram for H3DNetworkingUtils::CollisionGeometry:

Inheritance graph

List of all members.

Public Member Functions

 CollisionGeometry ()
 Constructor.
virtual void initialize ()
 Initialize.
virtual void setDyn (CollidableDynamic *ptr)
 Set the Dynamic that contai9ns this CollisionGeometry.
CollidableDynamicgetDyn ()
 Get the Dynamic that contai9ns this CollisionGeometry.
H3D::Matrix4f getLocalToGlobal ()
 Return a matrfix to convert local to global coords.
H3D::Matrix4f getGlobalToLocal ()
 Return a matrfix to convert global to local coords.
H3D::Vec3f getLocalPosition ()
 Get the local center position.
H3D::Vec3f getGlobalPosition ()
 Get the global center position.
virtual CollisionGeometryclone ()
 Create a CollisionGeometry (can be overridden).
virtual void copy (CollisionGeometry *newP)
 Copy contents into newP.
void setLayer (u_int l)
 Set the hierarchy layer of this geometry.
void setLocalOffset (H3D::Vec3f offs)
 Set the offset of the bounding sphere within the coordin system of the object.

Static Public Attributes

static H3D::H3DNodeDatabase database
 Datbase.


Detailed Description

The CollisionGeometry class is an abstract base class for a piece of simple geometry used to represent a complex geometry for the purposes of inter object collision - not rendered.

The CollisionGroup class contains the algorithm for testing collisions between CollidableDynamic nodes.

The transform of this node provides the coordinate system of the object. Within that the points of the object it surrounds may not be centered on this, in that case the local_offset is displaced from the origin.

It holds 2 lists, collidingChildrenA and collidingChildrenB. It checks for inter-object collision between each object in collidingChildrenA against each object in collidingChildrenB. Objects can be in both groups. An object is not checked against itself. This collision testing uses the collidables field of each CollidableDynamic in the lists. The collidables field holds a hierarchy of CollidableSpheres in layers. For each layer, the spheres are checked for intersection, and if they intersect, the spheres in the next layer are then checked. If two spheres in the loweest layer intersect, the amount of intersection along with the CollidableDynamics' current momentum, are used to apply forces to both CollidabelDynamics to represent the reaction to the collision. Once two spheres in the hierarchy have been found to collide, no more spheres are tested. This algorithm is designed to provide an approximate, but efficient collision mechanism. However if the system frame rate is found to be too slow, it may be due to having too many CollidableSpheres in the hierarchies of the CollidableDynamics. TO solve this, the collidabl;eDynamic's collisionResolution field should be increased.
Examples:


Member Function Documentation

void H3DNetworkingUtils::CollisionGeometry::setLocalOffset ( H3D::Vec3f  offs  )  [inline]

Set the offset of the bounding sphere within the coordin system of the object.

This may be different if the points are not distributed around the origin.


The documentation for this class was generated from the following files:

Generated on Fri Mar 12 10:23:06 2010 for H3DNetworkingUtils by  doxygen 1.5.6