Exemple #1
0
void RigidBody::setMeshTransfomation()
{
  if(m_type !=TRIANGLEMESH)
  {
    std::cerr<<"trying to set transform on non mesh\n";
    return;
  }

  const dReal *rot=dBodyGetRotation(m_id);
  const dReal *pos=dBodyGetPosition(m_id);
  dReal tx[16];
  tx[0]=rot[0];
  tx[1]=rot[1];
  tx[2]=rot[2];
  tx[3]=pos[0];

  tx[4]=rot[4];
  tx[5]=rot[5];
  tx[6]=rot[6];
  tx[7]=pos[1];

  tx[8]=rot[8];
  tx[9]=rot[9];
  tx[10]=rot[10];
  tx[11]=pos[2];

  tx[12]=rot[12];
  tx[13]=rot[13];
  tx[14]=rot[14];
  tx[15]=1.0;

  dGeomTriMeshSetLastTransform( m_geom.getID() ,tx );
  dGeomTriMeshClearTCCache (m_geom.getID());

}
Exemple #2
0
void PhysicsTriMeshGeom::clearTCCache(void)
{
    PhysicsTriMeshGeomPtr tmpPtr(*this);
    dGeomTriMeshClearTCCache(tmpPtr->id);
}