Code: Select all
mTriangleGhost->setWorldTransform(btTransform(mNode->getOrientation(), mNode->getPosition()));
Code: Select all
btTriangleShape *triangleCast = new btTriangleShape(btVector3(0, 0, 0), btVector3(100, 0, 250), btVector3(-100, 0, 250));
mTriangleGhost = new btPairCachingGhostObject();
mTriangleGhost->setWorldTransform(btTransform(rotation, carPosition));
mTriangleGhost->setCollisionShape(triangleCast);
mTriangleGhost->setCollisionFlags(mTriangleGhost->getCollisionFlags() | btCollisionObject::CF_NO_CONTACT_RESPONSE);
mDynamicsWorld->addCollisionObject(mTriangleGhost, btBroadphaseProxy::SensorTrigger, btBroadphaseProxy::AllFilter & ~btBroadphaseProxy::SensorTrigger);
Side question: is it more effective performance wise to use multiple raycasts or just a triangle cast?