From Physics Simulation Wiki

Jump to: navigation, search

Random definitions provided by the community

.*when possible please provide a link for the knowledge source of your definitions

.*if the definitions are collected from the Bullet forum and the original text is slightly modified please show your changes italic font

btGhostObject::rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, btCollisionWorld::RayResultCallback& resultCallback) const

Description: performs ray casting on the objects that overlap our btGhostObject.


  • rayFromWorld - the origin of the ray
  • rayToWorld - the end of the ray
  • resultCallback - the callback that will store the results of the casting

struct ClosestConvexResultCallback : public ConvexResultCallback

Description: The callback that stores the result of a sweep for collision test for a convex object .


  • btVector3 m_convexFromWorld - the origin of the convex cast/sweep
  • btVector3 m_convexToWorld - the destination of the convex cast/sweep
  • btVector3 m_hitPointWorld - World coordinates of the detected hit point
  • btVector3 m_hitNormalWorld - Normal of surface that was hit (if the surface is the floor, this is a vector pointing up)
  • btScalar m_closestHitFraction - This is a number between 0.0 and 1.0 where 0.0 is origin and 1.0 is destination. If the hit fraction is 0.33333, it means hitPointWorld is located 1/3 of the way between convexFromWorld and convexToWorld
  • btCollisionObject* m_hitCollisionObject - Pointer to the collision object that was hit

ERP: [2]error reduction parameter

  • The ERP specifies what proportion of the joint error will be fixed during the next simulation step.

If ERP=0 then no correcting force is applied and the bodies will eventually drift apart as the simulation proceeds.

If ERP=1 then the simulation will attempt to fix all joint error during the next time step. However, setting ERP=1 is not recommended, as the joint error will not be completely fixed due to various internal approximations.

A value of ERP=0.1 to 0.8 is recommended (0.2 is the default).

CFM: [3] constraint force mixing

  • If CFM is set to zero (which is the default value), the constraint will be hard.

If CFM is set to a positive value, it will be possible to violate the constraint by "pushing on it" (for example, for contact constraints by forcing the two contacting objects together). In other words the constraint will be soft, and the softness will increase as CFM increases. What is actually happening here is that the constraint is allowed to be violated by an amount proportional to CFM times the restoring force that is needed to enforce the constraint. Note that setting CFM to a negative value can have undesirable bad effects, such as instability. Don't do it.

  • [4] CFM is exactly the same as some Newton-like methods -- adding a scaled identity matrix to the Jacobian before inversion to make it more well-behaved. I think the ODE docs even suggest that adding some CFM has the same effect -- adding a bit will help probablematic systems converge/avoid blowing up.
  • [5] Is the ODE approach for regularization
Personal tools