#include <H3DNetworkingUtils/CollidableDynamic.h>
Public Member Functions | |
CollidableDynamic (H3D::Inst< AddChildren > _addChildren=0, H3D::Inst< RemoveChildren > _removeChildren=0, H3D::Inst< MFChild > _children=0, H3D::Inst< H3D::SFNode > _metadata=0, H3D::Inst< SFBound > _bound=0, H3D::Inst< H3D::SFVec3f > _bboxCenter=0, H3D::Inst< H3D::SFVec3f > _bboxSize=0, H3D::Inst< SFTransformedBound > _transformedBound=0, H3D::Inst< SFMatrix4f > _matrix=0, H3D::Inst< SFMatrix4f > _accumulatedForward=0, H3D::Inst< SFMatrix4f > _accumulatedInverse=0, H3D::Inst< H3D::SFVec3f > _position=0, H3D::Inst< H3D::SFRotation > _orientation=0, H3D::Inst< SFVelocity > _velocity=0, H3D::Inst< H3D::SFVec3f > _momentum=0, H3D::Inst< H3D::SFVec3f > _force=0, H3D::Inst< SFAngularVelocity > _angularVelocity=0, H3D::Inst< H3D::SFVec3f > _angularMomentum=0, H3D::Inst< SFSpin > _spin=0, H3D::Inst< H3D::SFVec3f > _torque=0, H3D::Inst< H3D::SFFloat > _mass=0, H3D::Inst< H3D::SFMatrix3f > _inertiaTensor=0, H3D::Inst< SFMotion > _motion=0, H3D::Inst< H3D::MFVec3f > _contactForces=0, H3D::Inst< H3D::MFVec3f > _contactTorques=0, H3D::Inst< SumMFVec3f > _totalContactForce=0, H3D::Inst< CalcTorque > _totalContactTorque=0, H3D::Inst< SumForces > _externalForces=0, H3D::Inst< SumTorques > _externalTorques=0, H3D::Inst< H3D::SFVec3f > _freedom=0, H3D::Inst< H3D::SFVec3f > _angularFreedom=0, H3D::Inst< H3D::SFFloat > _linearDamping=0, H3D::Inst< H3D::SFFloat > _rotationalDamping=0, H3D::Inst< MFCollidableGeometry > _collisionSpheres=0, H3D::Inst< H3D::SFFloat > _collisionStiffness=0, H3D::Inst< H3D::SFFloat > _collisionResolution=0) | |
Constructor. | |
H3D::Matrix4f | getGlobalToLocal () const |
Return a matrfix to convert global to local coords. | |
H3D::Matrix4f | getLocalToGlobal () const |
Return a matrfix to convert local to global coords. | |
Public Attributes | |
auto_ptr< MFCollidableGeometry > | collisionSpheres |
The spheres that are used for collision testing access type: inputOutput basic type: MFNode default value:. | |
auto_ptr< H3D::SFFloat > | collisionStiffness |
The stiffness used in the rebound calculation, determines the force applied to objects when they collide access type: inputOutput basic type: SFFloat default value: 0.4. | |
auto_ptr< H3D::SFFloat > | collisionResolution |
The approximate minimum collision sphere diameter If -1, the minimum dimension of the bounding box will be used access type: inputOutput basic type: SFFloat default value: 0.02. | |
auto_ptr< H3D::SFBool > | autoGenerateCollisionSpheres |
If true, collison spheres will be generated at initialize time access type: inputOutput basic type: SFBool default value: FALSE. | |
auto_ptr< H3D::SFInt32 > | debugCollisionSphereLayer |
If non_zero, the given layer will be graphically rendered Use for debugging and setup only - it may impinge on performance access type: inputOutput basic type: SFInt32 default value: 0. | |
auto_ptr< H3D::SFFloat > | overlap |
The proportion the collision spheres overlap access type: inputOutput basic type: SFFloat default value: 0.15. |
These spheres can be used by a CollisionGroup node to detect collisions between the CollidableDynamics. The spheres can be set manually, via the collisionSpheres field. They can also be generated automatically from the geometry, if autoGenerateCollisionSpheres is true. collisionResolution gives an approximate diameter of the smallest collisionSphere automatically generated. The hierarchy starts with a sphere covering the bounding box. This is then split into 3 along each dimentsion for the next level in the hierarchy, and so on, until the collisionResolution is reached. If the enclosed geometry is an X3DComposedGeometryNode, (e.g. IndexedFaceSet) any generated spheres which do not contain any coordinates, are discarded. When CollisionGroup performs collision detection, it starts with the top layer of the hierarchy. If there is a collision at this top layer, it then itterates throught the next layer, etc. A valid collision is only returned if a collision occurs at the lowestlayer.
collisionStiffness determines the force applied to objects when they collide in much the same way as a Surface stiffness affects the feel of stylus-object collisions. Values should be between 0 & 1. Values greater than 1.0 may cause instability
collisionResoulution is the diameter of the smallest collision sphere in the hierarchy. If collisionResolution is not set, the smallest bounding box dimension is used.
debugCollisionSphereLayer provides a visual rendering of the collision spheres at a particular hierarchy layer. If this is set to 0 (the default), no visual rendering occurs (but the collision spheres are still there). This should always be the case when not debugging, as rendering uses resources unnecessarily. If debugCollisionSphereLayer is set to 1, the outer hierarchy sphere is shown. If debugCollisionSphereLayer is set to 2, the next (smaller) spheres are shown, etc. collisionResolution cannot be less that 0.001
fields: