add plSetOpenGLMatrix to Bullet-C-API
This commit is contained in:
@@ -147,6 +147,7 @@ extern "C" {
|
||||
extern void plSetPosition(plRigidBodyHandle object, const plVector3 position);
|
||||
extern void plSetOrientation(plRigidBodyHandle object, const plQuaternion orientation);
|
||||
extern void plSetEuler(plReal yaw,plReal pitch,plReal roll, plQuaternion orient);
|
||||
extern void plSetOpenGLMatrix(plRigidBodyHandle object, plReal* matrix);
|
||||
|
||||
typedef struct plRayCastResult {
|
||||
plRigidBodyHandle m_body;
|
||||
|
||||
@@ -295,6 +295,14 @@ void plSetOrientation(plRigidBodyHandle object, const plQuaternion orientation)
|
||||
body->setWorldTransform(worldTrans);
|
||||
}
|
||||
|
||||
void plSetOpenGLMatrix(plRigidBodyHandle object, plReal* matrix)
|
||||
{
|
||||
btRigidBody* body = reinterpret_cast< btRigidBody* >(object);
|
||||
btAssert(body);
|
||||
btTransform& worldTrans = body->getWorldTransform();
|
||||
worldTrans.setFromOpenGLMatrix(matrix);
|
||||
}
|
||||
|
||||
void plGetOpenGLMatrix(plRigidBodyHandle object, plReal* matrix)
|
||||
{
|
||||
btRigidBody* body = reinterpret_cast< btRigidBody* >(object);
|
||||
|
||||
Reference in New Issue
Block a user