-- DanielSantos? - 29 Oct 2004


  • DeObject::velocity() and DeObject::acceleration() return velocities and accelerations defined in the object's local coordinate frame

Vector Operations:


  • When you begin binding properties between two materials, you need to specify ALL the bound properties. When one property is bound, then all others default to zero initially, until they are set otherwise.
    • Example:
           DeMaterial *matA, *matB;
           DeFloat _muAB, _epsAB;
           matA->epsilon( .5 );
           matA->friction( DE_FRICTION_DYNAMIC, .5 )
           matB->epsilon( 0 );
           matB->friction( DE_FRICTION_DYNAMIC, .5 )
           _epsAB = _matA->epsilon( _matB ); //returns min/max/mean(0,.5) depending on current model, b/c no binding between A and B
           _muAB = _matA->friction( DE_FRICTION_DYNAMIC, _matB ); //returns min/max/mean(.5,.5) depending on current model, b/c no binding between A and B
           matA->epsilon( 1, matB );  //begins bindings for matA and matB
           _epsAB = _matA->epsilon( _matB ); //returns 1 b/c A and B were bound above
           _muAB = _matA->friction( DE_FRICTION_DYNAMIC, _matB ); //returns 0 b/c A and B were bound above and nothing has yet been set for mu, so defaults to zero


  • When you are using DePrimPair for trying to get the contact state of two objects you MUST call DePrimPairCallnum() before using DePrimPair::checkPrim( DeTransform aTb ). Also, if you want to use DePrimPair::distance(), you MUST first make a valid DePrimPair::checkPrim call so that DE re-calculates the closest distance between two objects. The normal order of function calls to get things to work properly is shown below.
    • Example:
           // Make the DePrimPair object first
           DePrimPairCallnum();  // flushes the tables and forces re-calculations
           DeInt status = myPrimPair.checkPrim( aTb );  // Gets the status (an int) between the two objects, aTb is the DeTransform from A to B
           DeFloat distance = myPrimPair.distance();  // Gets the closest distance between objects A and B of the DePrimPair
                                                      // Will only return correct value after a call to checkPrim
  • So in the above, distance has the correct distance and status has the correct status between the two objects. checkPrim returns the following:
    • -1 - Means the two objects are penetrating
    • 0 - Means the two objects are just touching
    • 1 - Means the two objects are separated
    • 2 - Means that you have tried to call checkPrim twice in a row without calling DePrimPairCallnum() in between to flush the tables

This site is powered by the TWiki collaboration platformCopyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback