Bullet implementation details
From H3D.org
[edit]
General
- btDbvtBroadphase is used for broad phase collision detection.
- btSequentialImpulseConstraintSolver is used for constraint resolving.
[edit]
BallJoint (not implemented)
[edit]
CollidableOffset (not implemented)
[edit]
CollidableShape
- metadata
- bboxCenter
- bboxSize
- shape - Box, Sphere, Cone and Cylinder go directly to its Bullet equivalents. Nothing else supported at this time. Cone and Cylinder does not work properly at this time either.
[edit]
Unimplemented fields
- enabled
- rotation
- translation
[edit]
CollisionCollection
- metadata
- collidables
- bounce - gContactAddedCallback used to change the m_combinedRestitution parameter.
[edit]
Partially implemented fields
- frictionCoefficients - gContactAddedCallback used to change the m_combinedFriction parameter to frictionCoefficients.x. frictionCoefficients.y is ignored.
[edit]
Unimplemented fields
- enabled
- appliedParameters
- minBounceSpeed
- slipFactors
- softnessConstantForceMix
- softnessErrorCorrection
- surfaceSpeed
[edit]
CollisionSensor
- metadata
- collider
- enabled
- contacts
- isActive
[edit]
Unimplemented fields
- intersections - don't know exactly what the output should be. Checked xj3d code but seems they don't set it either.
[edit]
CollisionSpace
[edit]
Contact
Contacts are found by finding contact manifolds using m_dynamicsWorld->getDispatcher()->getManifoldsByIndexInternal().
- metadata
- body1 - contactManifold->getBody0()
- body2 - contactManifold->getBody1()
- contactNormal - contactManifold->getContactPoint(j).m_normalWorldOnB
- depth - m_normalWorldOnB.getDistance()???
- position - contactManifold->getContactPoint(j).getPositionWorldOnB()
[edit]
Unimplemented fields
- slipCoefficients
- softnessConstantForceMix
- softnessErrorCorrection
- surfaceSpeed
- frictionCoefficients
- frictionDirection
- minbounceSpeed
- bounce
- appliedParameters
- geometry1
- geometry2
[edit]
DoubleAxisHingeJoint (not implemented)
[edit]
MotorJoint (not implemented)
[edit]
RigidBody
- metadata
- geometry
- autoDamp
- angularDampingFactor - body->setDamping( params->getLinearDampingFactor(), params->getAngularDampingFactor() );
- linearDampingFactor - body->setDamping( params->getLinearDampingFactor(), params->getAngularDampingFactor() );
- autoDisable
- disableAngularSpeed - body->setSleepingThresholds( params->getDisableLinearSpeed(), params->getDisableAngularSpeed() );
- disableLinearSpeed - body->setSleepingThresholds( params->getDisableLinearSpeed(), params->getDisableAngularSpeed() );
- fixed - body->setMassProps( 0, btVector3( 0, 0, 0 ) ) if fixed
- forces - body->applyForce( force, center_of_mass );
- torques - body->applyTorque( torque )
- orientation
- position
- angularVelocity - body->getAngularVelocity/setAngularVelocity
- linearVelocity - body->getLinearVelocity/setLinearVelocity
- mass - setMassProps( mass, inertia )
- massDensityModel - setMassProps( mass, inertia ) - Box, Sphere working. Cone, Cylinder implemented but collision not working for them so tests have not been done yet.
- enabled - if a body is not enabled it is treated the same as fixed, i.e. it participates in collision detection but it will not move.
[edit]
Unimplemented fields
- centerOfMass - undocumented in X3D spec.
- disableTime - don't know how to do this in Bullet
- finiteRotationAxis - don't know how to do this in Bullet
- inertia - Bullet excepts a 3d vector as inertia. Don't really know if possible to convert the inertia tensor matrix to this vector. Tried to use the diagonal values from the matrix but it does not behave at all like ODE so for now we just use a box with sides 0.1 as default as massDensityModel if nothing set by user.
- useFiniteRotation - don't know how to do this in Bullet.
- useGlobalGravity - tried to use body->setGravity but it does not seem to work.
[edit]
RigidBodyCollection
- bodies
- joints
- metadata
- collider
- enabled - if not enabled we do not step the simulation
- iterations - btDynamicsWorld::stepSimulation( physics_thread->getStepSize(), world_params.getIterations() + 1, physics_thread->getStepSize() / world_params.getIterations() );
- gravity - btDynamicsWorld::setGravity
- autoDisable - autoDisable set to false will set the linear and angular sleeping threshold to 0
- disableAngularSpeed - btRigidBody::setSleepingThresholds (btScalar linear, btScalar angular)
- disableLinearSpeed - btRigidBody::setSleepingThresholds (btScalar linear, btScalar angular)
[edit]
Unimplemented fields
- set_contacts - don't know what it is supposed to do
- constantForceMix - don't know how to do this in Bullet
- contactSurfaceThickness - don't know how to do this in Bullet
- disableTime - don't know how to do this in Bullet
- errorCorrection - don't know how to do this in Bullet
- maxCorrectionSpeed - don't know how to do this in Bullet
- preferAccuracy - don't know how to do this in Bullet
[edit]
SingleAxisHingeJoint
We use btHingeConstraint with two bodies if two bodies specified and one body otherwise to connect the joint to the world. The parameters can only be set in the constructor of the constraint in Bullet so updates to the anchorPoint and axis fields will currently be ignored after initialization. Maybe it can be solved by removing the old joint and adding a new one with new parameters if they change.
- metadata
- body1
- body2
- forceOutput
- anchorPoint - as parameter to btHingeConstraint constructor.
- axis - as parameter to btHingeConstraint constructor.
- body1AnchorPoint - rigid body transform * joint->getAFrame().getOrigin()
- body2AnchorPoint - rigid body transform * joint->getBFrame().getOrigin()
[edit]
Unimplemented fields
All the angle fields have to match the X3D spec. and the functions for angles in Bullet use some other measurement of angles that I do not know how it works. There is not much documentation in Bullet.
- angle - can get an angle with joint->getHingeAngle(); but not sure what this angle is. It must match with what is to be reported in X3D spec and it does not at this moment.
- maxAngle - joint->setLimit( sparams->getMinAngle(), sparams->getMaxAngle() );
- minAngle - joint->setLimit( sparams->getMinAngle(), sparams->getMaxAngle() );
- angleRate - we must calculate this ourselves.
- stopBounce -
- stopErrorCorrection -
[edit]
SliderJoint (not implemented)
[edit]

