#include "trace.h" #include #include #include #include "physic.hpp" #define BIT(x) (1<<(x)) enum traceWorldType { collisionWorldTrace = 1, pickWorldTrace = 2, bothWorldTrace = collisionWorldTrace | pickWorldTrace }; enum collaborativePhysicsType { No_Physics = 0, // Both are empty (example: statics you can walk through, like tall grass) Only_Collision = 1, // This object only has collision physics but no pickup physics (example: statics) Only_Pickup = 2, // This object only has pickup physics but no collision physics (example: items dropped on the ground) Both_Physics = 3 // This object has both kinds of physics (example: activators) }; enum collisiontypes { COL_NOTHING = 0, //dynamicsWorld->convexSweepTest(&newshape, from, to, newTraceCallback); // Copy the hit data over to our trace results struct: if(newTraceCallback.hasHit()) { const btVector3& tracehitnormal = newTraceCallback.m_hitNormalWorld; results->fraction = newTraceCallback.m_closestHitFraction; results->planenormal = Ogre::Vector3(tracehitnormal.x(), tracehitnormal.y(), tracehitnormal.z()); results->endpos = (end-start)*results->fraction + start; } else { results->endpos = end; results->planenormal = Ogre::Vector3(0.0f, 0.0f, 1.0f); results->fraction = 1.0f; } }