mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 06:35:30 +00:00
Remove some unused trace fields
This commit is contained in:
parent
86f6491bc8
commit
66743ecee7
@ -29,14 +29,12 @@ struct NewPhysTraceResults
|
|||||||
Ogre::Vector3 endPos;
|
Ogre::Vector3 endPos;
|
||||||
Ogre::Vector3 hitNormal;
|
Ogre::Vector3 hitNormal;
|
||||||
float fraction;
|
float fraction;
|
||||||
bool startSolid;
|
|
||||||
//const Object* hitObj;
|
//const Object* hitObj;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <const traceWorldType traceType>
|
static bool NewPhysicsTrace(NewPhysTraceResults* const out, const Ogre::Vector3& start, const Ogre::Vector3& end,
|
||||||
static const bool NewPhysicsTrace(NewPhysTraceResults* const out, const Ogre::Vector3& start, const Ogre::Vector3& end,
|
const Ogre::Vector3& BBHalfExtents, const Ogre::Vector3& rotation, bool isInterior,
|
||||||
const Ogre::Vector3& BBHalfExtents, const Ogre::Vector3& rotation, bool isInterior,
|
OEngine::Physic::PhysicEngine* enginePass)
|
||||||
OEngine::Physic::PhysicEngine* enginePass)
|
|
||||||
{
|
{
|
||||||
const btVector3 btstart(start.x, start.y, start.z + BBHalfExtents.z);
|
const btVector3 btstart(start.x, start.y, start.z + BBHalfExtents.z);
|
||||||
const btVector3 btend(end.x, end.y, end.z + BBHalfExtents.z);
|
const btVector3 btend(end.x, end.y, end.z + BBHalfExtents.z);
|
||||||
@ -49,7 +47,7 @@ static const bool NewPhysicsTrace(NewPhysTraceResults* const out, const Ogre::Ve
|
|||||||
|
|
||||||
btCollisionWorld::ClosestConvexResultCallback newTraceCallback(btstart, btend);
|
btCollisionWorld::ClosestConvexResultCallback newTraceCallback(btstart, btend);
|
||||||
|
|
||||||
newTraceCallback.m_collisionFilterMask = (traceType == collisionWorldTrace) ? Only_Collision : Only_Pickup;
|
newTraceCallback.m_collisionFilterMask = Only_Collision;
|
||||||
|
|
||||||
enginePass->dynamicsWorld->convexSweepTest(&newshape, from, to, newTraceCallback);
|
enginePass->dynamicsWorld->convexSweepTest(&newshape, from, to, newTraceCallback);
|
||||||
|
|
||||||
@ -66,24 +64,6 @@ static const bool NewPhysicsTrace(NewPhysTraceResults* const out, const Ogre::Ve
|
|||||||
out->endPos.y = tracehitpos.y();
|
out->endPos.y = tracehitpos.y();
|
||||||
out->endPos.z = tracehitpos.z();
|
out->endPos.z = tracehitpos.z();
|
||||||
|
|
||||||
// StartSolid test:
|
|
||||||
{
|
|
||||||
out->startSolid = false;
|
|
||||||
if(isInterior)
|
|
||||||
{
|
|
||||||
// If inside and out of the tree, we're solid
|
|
||||||
btVector3 aabbMin, aabbMax;
|
|
||||||
enginePass->broadphase->getBroadphaseAabb(aabbMin, aabbMax);
|
|
||||||
btVector3 point(start.x, start.y, start.z);
|
|
||||||
if(!TestPointAgainstAabb2(aabbMin, aabbMax, point))
|
|
||||||
{
|
|
||||||
//We're solid
|
|
||||||
//THIS NEEDS TO BE TURNED OFF IF WE WANT FALLING IN EXTERIORS TO WORK CORRECTLY!!!!!!!
|
|
||||||
//out->startSolid = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return newTraceCallback.hasHit();
|
return newTraceCallback.hasHit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,15 +71,8 @@ static const bool NewPhysicsTrace(NewPhysTraceResults* const out, const Ogre::Ve
|
|||||||
void newtrace(traceResults* const results, const Ogre::Vector3& start, const Ogre::Vector3& end, const Ogre::Vector3& BBHalfExtents, const float rotation, bool isInterior, OEngine::Physic::PhysicEngine* enginePass) //Traceobj was a Aedra Object
|
void newtrace(traceResults* const results, const Ogre::Vector3& start, const Ogre::Vector3& end, const Ogre::Vector3& BBHalfExtents, const float rotation, bool isInterior, OEngine::Physic::PhysicEngine* enginePass) //Traceobj was a Aedra Object
|
||||||
{
|
{
|
||||||
NewPhysTraceResults out;
|
NewPhysTraceResults out;
|
||||||
const bool hasHit = NewPhysicsTrace<collisionWorldTrace>(&out, start, end, BBHalfExtents,
|
bool hasHit = NewPhysicsTrace(&out, start, end, BBHalfExtents, Ogre::Vector3(0.0f, 0.0f, 0.0f),
|
||||||
Ogre::Vector3(0.0f, 0.0f, 0.0f),
|
isInterior, enginePass);
|
||||||
isInterior, enginePass);
|
|
||||||
if (out.fraction < 0.001f)
|
|
||||||
results->startsolid = true;
|
|
||||||
else
|
|
||||||
results->startsolid = false;
|
|
||||||
results->allsolid = out.startSolid;
|
|
||||||
|
|
||||||
if(!hasHit)
|
if(!hasHit)
|
||||||
{
|
{
|
||||||
results->endpos = end;
|
results->endpos = end;
|
||||||
|
@ -19,9 +19,6 @@ struct traceResults
|
|||||||
Ogre::Vector3 planenormal;
|
Ogre::Vector3 planenormal;
|
||||||
|
|
||||||
float fraction;
|
float fraction;
|
||||||
|
|
||||||
bool allsolid;
|
|
||||||
bool startsolid;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void newtrace(traceResults* const results, const Ogre::Vector3& start, const Ogre::Vector3& end, const Ogre::Vector3& BBExtents, const float rotation, bool isInterior, OEngine::Physic::PhysicEngine* enginePass);
|
void newtrace(traceResults* const results, const Ogre::Vector3& start, const Ogre::Vector3& end, const Ogre::Vector3& BBExtents, const float rotation, bool isInterior, OEngine::Physic::PhysicEngine* enginePass);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user