Routines for converting between OSG geometric data and Bullet collision shapes. More...
Enumerations | |
| enum | osgbCollision::AXIS { X = 0, Y = 1, Z = 2 } |
Enumerant to denote the major axis of a cylinder. More... | |
Functions | |
| OSGBCOLLISION_EXPORT btBoxShape * | osgbCollision::btBoxCollisionShapeFromOSG (osg::Node *node, const osg::BoundingBox *bb=NULL) |
| Return a Bullet box collision shape that approximates the specified OSG geometry. | |
| OSGBCOLLISION_EXPORT btSphereShape * | osgbCollision::btSphereCollisionShapeFromOSG (osg::Node *node) |
| Return a Bullet sphere collision shape that approximates the specified OSG geometry. | |
| OSGBCOLLISION_EXPORT btCylinderShape * | osgbCollision::btCylinderCollisionShapeFromOSG (osg::Node *node, AXIS axis=Y) |
| Return a Bullet cylinder collision shape that approximates the specified OSG geometry. | |
| OSGBCOLLISION_EXPORT btTriangleMeshShape * | osgbCollision::btTriMeshCollisionShapeFromOSG (osg::Node *node) |
| Return a Bullet triangle mesh collision shape that approximates the specified OSG geometry. | |
| OSGBCOLLISION_EXPORT btConvexTriangleMeshShape * | osgbCollision::btConvexTriMeshCollisionShapeFromOSG (osg::Node *node) |
| Return a Bullet convex triangle mesh collision shape that approximates the specified OSG geometry. | |
| OSGBCOLLISION_EXPORT btConvexHullShape * | osgbCollision::btConvexHullCollisionShapeFromOSG (osg::Node *node) |
| Return a Bullet convex hull collision shape that approximates the specified OSG geometry. | |
| OSGBCOLLISION_EXPORT btCompoundShape * | osgbCollision::btCompoundShapeFromOSGGeodes (osg::Node *node, const BroadphaseNativeTypes shapeType, const osgbCollision::AXIS axis=Y, const unsigned int reductionLevel=0) |
| Creates a collision shape for each Geode in the scene graph, and assembles them into a single btCompoundShape. | |
|
OSGBCOLLISION_EXPORT btCompoundShape * | osgbCollision::btCompoundShapeFromOSGGeometry (osg::Node *node) |
| Currently not implemented. Creates a collision shape for each Geode in the scene graph, and assembles them into a single btCompoundShape. | |
| OSGBCOLLISION_EXPORT btCompoundShape * | osgbCollision::btCompoundShapeFromBounds (osg::Node *node, const BroadphaseNativeTypes shapeType, const osgbCollision::AXIS axis=Y) |
| Creates a transformed box, sphere, or cylinder collision shape. | |
| OSGBCOLLISION_EXPORT osg::Node * | osgbCollision::osgNodeFromBtCollisionShape (const btCollisionShape *btShape, const btTransform &trans=btTransform::getIdentity()) |
| Return an OSG representation of the given bullet collision shape. | |
| OSGBCOLLISION_EXPORT osg::Node * | osgbCollision::osgNodeFromBtCollisionShape (const btBoxShape *btShape, const btTransform &trans=btTransform::getIdentity()) |
| OSGBCOLLISION_EXPORT osg::Node * | osgbCollision::osgNodeFromBtCollisionShape (const btSphereShape *btShape, const btTransform &trans=btTransform::getIdentity()) |
| OSGBCOLLISION_EXPORT osg::Node * | osgbCollision::osgNodeFromBtCollisionShape (const btCylinderShape *btShape, const btTransform &trans=btTransform::getIdentity()) |
| OSGBCOLLISION_EXPORT osg::Node * | osgbCollision::osgNodeFromBtCollisionShape (const btTriangleMeshShape *btShape, const btTransform &trans=btTransform::getIdentity()) |
| OSGBCOLLISION_EXPORT osg::Node * | osgbCollision::osgNodeFromBtCollisionShape (const btConvexTriangleMeshShape *btShape, const btTransform &trans=btTransform::getIdentity()) |
| OSGBCOLLISION_EXPORT osg::Node * | osgbCollision::osgNodeFromBtCollisionShape (const btConvexHullShape *btShape, const btTransform &trans=btTransform::getIdentity()) |
| OSGBCOLLISION_EXPORT osg::Geometry * | osgbCollision::osgGeometryFromBtCollisionShape (const btBoxShape *btShape) |
| Returns an OSG Geometry to render the specified collision shape. | |
| OSGBCOLLISION_EXPORT osg::Geometry * | osgbCollision::osgGeometryFromBtCollisionShape (const btSphereShape *btSphere) |
| Returns an OSG Geometry to render the specified collision shape. | |
| OSGBCOLLISION_EXPORT osg::Geometry * | osgbCollision::osgGeometryFromBtCollisionShape (const btCylinderShape *btCylinder) |
| Returns an OSG Geometry to render the specified collision shape. | |
Routines for converting between OSG geometric data and Bullet collision shapes.
| enum osgbCollision::AXIS |
Enumerant to denote the major axis of a cylinder.
These are the values that btCylinderShape::getUpAxis() returns for the three different cylinder major axes.
| btBoxShape * osgbCollision::btBoxCollisionShapeFromOSG | ( | osg::Node * | node, |
| const osg::BoundingBox * | bb = NULL |
||
| ) |
Return a Bullet box collision shape that approximates the specified OSG geometry.
The box is untransformed. Bullet's box collision shape uses the box extents only. (btBoxShape is always centered on the origin. See btCompoundShapeFromBounds() to create the box as a transformed child shape within a btCompoundShape.)
If the calling code has already computed the bounding box extents, pass this information as the bb parameter, and this function will use that information to create the collision shape. If you do not pass a bb parameter, this function uses the osg::ComputeBoundsVisitor to determine the bounding box extents.
| btSphereShape * osgbCollision::btSphereCollisionShapeFromOSG | ( | osg::Node * | node ) |
Return a Bullet sphere collision shape that approximates the specified OSG geometry.
The sphere is untransformed. Bullet's sphere collision shape uses the radius only. (btSphereShape is always centered on the origin. See btCompoundShapeFromBounds() to create the sphere as a transformed child shape within a btCompoundShape.)
| btCylinderShape * osgbCollision::btCylinderCollisionShapeFromOSG | ( | osg::Node * | node, |
| AXIS | axis = Y |
||
| ) |
Return a Bullet cylinder collision shape that approximates the specified OSG geometry.
The cylinder is untransformed. Bullet's cylinder collision shape uses the specified axis and computed radius only. (btCylinderShape is always centered on the origin. See btCompoundShapeFromBounds() to create the cylinder as a transformed child shape within a btCompoundShape.)
| btTriangleMeshShape * osgbCollision::btTriMeshCollisionShapeFromOSG | ( | osg::Node * | node ) |
Return a Bullet triangle mesh collision shape that approximates the specified OSG geometry.
This function collects all triangles and transforms them by any Transforms in the subgraph rootes at node.
| btConvexTriangleMeshShape * osgbCollision::btConvexTriMeshCollisionShapeFromOSG | ( | osg::Node * | node ) |
Return a Bullet convex triangle mesh collision shape that approximates the specified OSG geometry.
This function collects all triangles and transforms them by any Transforms in the subgraph rootes at node.
| btConvexHullShape * osgbCollision::btConvexHullCollisionShapeFromOSG | ( | osg::Node * | node ) |
Return a Bullet convex hull collision shape that approximates the specified OSG geometry.
This function collects all vertices and transforms them by any Transforms in the subgraph rootes at node.
| btCompoundShape * osgbCollision::btCompoundShapeFromOSGGeodes | ( | osg::Node * | node, |
| const BroadphaseNativeTypes | shapeType, | ||
| const osgbCollision::AXIS | axis = Y, |
||
| const unsigned int | reductionLevel = 0 |
||
| ) |
Creates a collision shape for each Geode in the scene graph, and assembles them into a single btCompoundShape.
If shapeType is CYLINDER_SHAPE_PROXYTYPE, axis indicates the cylinder axis.
| reductionLevel | If shapeType is TRIANGLE_MESH_SHAPE_PROXYTYPE or CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE, a copy of the input geometry is reduced based on this value, which is in the range 0 (to reduction) to 3 (aggressive reduction). See osgbDynamics::CreationRecord::ReductionLevel. Default is 0 (no reduction). |
| btCompoundShape * osgbCollision::btCompoundShapeFromBounds | ( | osg::Node * | node, |
| const BroadphaseNativeTypes | shapeType, | ||
| const osgbCollision::AXIS | axis = Y |
||
| ) |
Creates a transformed box, sphere, or cylinder collision shape.
Bullet supports transformed box, sphere, and cylinder shapes with the btCompoundShape. This function creates a box, sphere, or cylinder collision shape, and adds it as a child shape to a btCompoundShape. The child shape transform is the bounding volume translation.
Currently, this function supports only translation. In the future, rotation and scale could also be supported.
| osg::Node * osgbCollision::osgNodeFromBtCollisionShape | ( | const btCollisionShape * | btShape, |
| const btTransform & | trans = btTransform::getIdentity() |
||
| ) |
Return an OSG representation of the given bullet collision shape.
This is useful for Bullet applications being ported to visualize the physics simulation with OSG.
| osg::Node * osgbCollision::osgNodeFromBtCollisionShape | ( | const btBoxShape * | btShape, |
| const btTransform & | trans = btTransform::getIdentity() |
||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| osg::Node * osgbCollision::osgNodeFromBtCollisionShape | ( | const btSphereShape * | btShape, |
| const btTransform & | trans = btTransform::getIdentity() |
||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| osg::Node * osgbCollision::osgNodeFromBtCollisionShape | ( | const btCylinderShape * | btShape, |
| const btTransform & | trans = btTransform::getIdentity() |
||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| osg::Node * osgbCollision::osgNodeFromBtCollisionShape | ( | const btTriangleMeshShape * | btShape, |
| const btTransform & | trans = btTransform::getIdentity() |
||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| osg::Node * osgbCollision::osgNodeFromBtCollisionShape | ( | const btConvexTriangleMeshShape * | btShape, |
| const btTransform & | trans = btTransform::getIdentity() |
||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| osg::Node * osgbCollision::osgNodeFromBtCollisionShape | ( | const btConvexHullShape * | btShape, |
| const btTransform & | trans = btTransform::getIdentity() |
||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| osg::Geometry * osgbCollision::osgGeometryFromBtCollisionShape | ( | const btBoxShape * | btShape ) |
Returns an OSG Geometry to render the specified collision shape.
Uses the osgWorks Shapes utilities to create the box Geometry.
| osg::Geometry * osgbCollision::osgGeometryFromBtCollisionShape | ( | const btSphereShape * | btSphere ) |
Returns an OSG Geometry to render the specified collision shape.
Uses the osgWorks Shapes utilities to create the sphere Geometry.
| osg::Geometry * osgbCollision::osgGeometryFromBtCollisionShape | ( | const btCylinderShape * | btCylinder ) |
Returns an OSG Geometry to render the specified collision shape.
Uses the OSG ShapeDrawable utilities to create the cylinder Geometry. When osgWorks Shapes supports cylinders, the implementation will be modified to remove the dependency on ShapeDrawable.
1.7.2