2014-06-24 1 views

답변

0

btConvexShape는 볼록 선체뿐만 아니라 총알에 볼록 오브젝트가 될 수있다. 구체적인 하위 클래스에 따라 다른 접근 방식을 구현해야합니다. btCollisionShape :: getShapeType() (return values)을 사용하여 구체적인 구현을 찾은 다음 캐스트합니다. 예 :

btSoftBody* convexShapeToSoft(const btConvexShape& shape) 
{ 
    if(shape.getShapeType() == BOX_SHAPE_PROXYTYPE) 
    { 
     const btBoxShape& boxShape = static_cast<const btBoxShape&>(shape); 

     // Build btSoftBody using the box vertices 
    } 
    else if(shape.getShapeType() == SPHERE_SHAPE_PROXYTYPE) 
    { 
     const btSphereShape& shpereShape = static_cast<const btSphereShape&>(shape); 

     // Build btSoftBody using the box vertices 
    } 
    // .... 
} 
관련 문제