forked from mirror/openmw-tes3mp
Get rid of unused file and some other cruft.
This commit is contained in:
parent
783c501d70
commit
5b0a4c9424
5 changed files with 2 additions and 125 deletions
|
@ -99,8 +99,6 @@ set(OENGINE_BULLET
|
||||||
${LIBDIR}/openengine/bullet/BtOgreExtras.h
|
${LIBDIR}/openengine/bullet/BtOgreExtras.h
|
||||||
${LIBDIR}/openengine/bullet/BtOgreGP.h
|
${LIBDIR}/openengine/bullet/BtOgreGP.h
|
||||||
${LIBDIR}/openengine/bullet/BtOgrePG.h
|
${LIBDIR}/openengine/bullet/BtOgrePG.h
|
||||||
${LIBDIR}/openengine/bullet/CMotionState.cpp
|
|
||||||
${LIBDIR}/openengine/bullet/CMotionState.h
|
|
||||||
${LIBDIR}/openengine/bullet/physic.cpp
|
${LIBDIR}/openengine/bullet/physic.cpp
|
||||||
${LIBDIR}/openengine/bullet/physic.hpp
|
${LIBDIR}/openengine/bullet/physic.hpp
|
||||||
${LIBDIR}/openengine/bullet/BulletShapeLoader.cpp
|
${LIBDIR}/openengine/bullet/BulletShapeLoader.cpp
|
||||||
|
|
|
@ -1,46 +0,0 @@
|
||||||
#include "CMotionState.h"
|
|
||||||
#include "physic.hpp"
|
|
||||||
|
|
||||||
#include <btBulletDynamicsCommon.h>
|
|
||||||
#include <btBulletCollisionCommon.h>
|
|
||||||
#include <components/nifbullet/bulletnifloader.hpp>
|
|
||||||
|
|
||||||
namespace OEngine {
|
|
||||||
namespace Physic
|
|
||||||
{
|
|
||||||
|
|
||||||
CMotionState::CMotionState(PhysicEngine* eng,std::string name)
|
|
||||||
: isPC(false)
|
|
||||||
, isNPC(true)
|
|
||||||
{
|
|
||||||
pEng = eng;
|
|
||||||
tr.setIdentity();
|
|
||||||
pName = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CMotionState::getWorldTransform(btTransform &worldTrans) const
|
|
||||||
{
|
|
||||||
worldTrans = tr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CMotionState::setWorldTransform(const btTransform &worldTrans)
|
|
||||||
{
|
|
||||||
tr = worldTrans;
|
|
||||||
|
|
||||||
PhysicEvent evt;
|
|
||||||
evt.isNPC = isNPC;
|
|
||||||
evt.isPC = isPC;
|
|
||||||
evt.newTransform = tr;
|
|
||||||
evt.RigidBodyName = pName;
|
|
||||||
|
|
||||||
if(isPC)
|
|
||||||
{
|
|
||||||
pEng->PEventList.push_back(evt);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pEng->NPEventList.push_back(evt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}}
|
|
|
@ -1,52 +0,0 @@
|
||||||
#ifndef OENGINE_CMOTIONSTATE_H
|
|
||||||
#define OENGINE_CMOTIONSTATE_H
|
|
||||||
|
|
||||||
#include <BulletDynamics/Dynamics/btRigidBody.h>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace OEngine {
|
|
||||||
namespace Physic
|
|
||||||
{
|
|
||||||
class PhysicEngine;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A CMotionState is associated with a single RigidBody.
|
|
||||||
* When the RigidBody is moved by bullet, bullet will call the function setWorldTransform.
|
|
||||||
* for more info, see the bullet Wiki at btMotionState.
|
|
||||||
*/
|
|
||||||
class CMotionState:public btMotionState
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
CMotionState(PhysicEngine* eng,std::string name);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the position of the RigidBody.
|
|
||||||
*/
|
|
||||||
virtual void getWorldTransform(btTransform &worldTrans) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function called by bullet when the RigidBody is moved.
|
|
||||||
* It add an event to the EventList of the PhysicEngine class.
|
|
||||||
*/
|
|
||||||
virtual void setWorldTransform(const btTransform &worldTrans);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
PhysicEngine* pEng;
|
|
||||||
btTransform tr;
|
|
||||||
bool isNPC;
|
|
||||||
bool isPC;
|
|
||||||
|
|
||||||
std::string pName;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct PhysicEvent
|
|
||||||
{
|
|
||||||
bool isNPC;
|
|
||||||
bool isPC;
|
|
||||||
btTransform newTransform;
|
|
||||||
std::string RigidBodyName;
|
|
||||||
};
|
|
||||||
|
|
||||||
}}
|
|
||||||
#endif
|
|
|
@ -3,7 +3,6 @@
|
||||||
#include <btBulletCollisionCommon.h>
|
#include <btBulletCollisionCommon.h>
|
||||||
#include <BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h>
|
#include <BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h>
|
||||||
#include <components/nifbullet/bulletnifloader.hpp>
|
#include <components/nifbullet/bulletnifloader.hpp>
|
||||||
#include "CMotionState.h"
|
|
||||||
#include "OgreRoot.h"
|
#include "OgreRoot.h"
|
||||||
#include "btKinematicCharacterController.h"
|
#include "btKinematicCharacterController.h"
|
||||||
#include "BtOgrePG.h"
|
#include "BtOgrePG.h"
|
||||||
|
@ -318,9 +317,7 @@ namespace Physic
|
||||||
btVector3 scl(triSize, triSize, 1);
|
btVector3 scl(triSize, triSize, 1);
|
||||||
hfShape->setLocalScaling(scl);
|
hfShape->setLocalScaling(scl);
|
||||||
|
|
||||||
CMotionState* newMotionState = new CMotionState(this,name);
|
btRigidBody::btRigidBodyConstructionInfo CI = btRigidBody::btRigidBodyConstructionInfo(0,0,hfShape);
|
||||||
|
|
||||||
btRigidBody::btRigidBodyConstructionInfo CI = btRigidBody::btRigidBodyConstructionInfo(0,newMotionState,hfShape);
|
|
||||||
RigidBody* body = new RigidBody(CI,name);
|
RigidBody* body = new RigidBody(CI,name);
|
||||||
body->getWorldTransform().setOrigin(btVector3( (x+0.5)*triSize*(sqrtVerts-1), (y+0.5)*triSize*(sqrtVerts-1), (maxh+minh)/2.f));
|
body->getWorldTransform().setOrigin(btVector3( (x+0.5)*triSize*(sqrtVerts-1), (y+0.5)*triSize*(sqrtVerts-1), (maxh+minh)/2.f));
|
||||||
|
|
||||||
|
@ -401,12 +398,9 @@ namespace Physic
|
||||||
else
|
else
|
||||||
shape->mRaycastingShape->setLocalScaling( btVector3(scale,scale,scale));
|
shape->mRaycastingShape->setLocalScaling( btVector3(scale,scale,scale));
|
||||||
|
|
||||||
//create the motionState
|
|
||||||
CMotionState* newMotionState = new CMotionState(this,name);
|
|
||||||
|
|
||||||
//create the real body
|
//create the real body
|
||||||
btRigidBody::btRigidBodyConstructionInfo CI = btRigidBody::btRigidBodyConstructionInfo
|
btRigidBody::btRigidBodyConstructionInfo CI = btRigidBody::btRigidBodyConstructionInfo
|
||||||
(0,newMotionState, raycasting ? shape->mRaycastingShape : shape->mCollisionShape);
|
(0,0, raycasting ? shape->mRaycastingShape : shape->mCollisionShape);
|
||||||
RigidBody* body = new RigidBody(CI,name);
|
RigidBody* body = new RigidBody(CI,name);
|
||||||
body->mPlaceable = placeable;
|
body->mPlaceable = placeable;
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,6 @@ namespace MWWorld
|
||||||
namespace OEngine {
|
namespace OEngine {
|
||||||
namespace Physic
|
namespace Physic
|
||||||
{
|
{
|
||||||
class CMotionState;
|
|
||||||
struct PhysicEvent;
|
struct PhysicEvent;
|
||||||
class PhysicEngine;
|
class PhysicEngine;
|
||||||
class RigidBody;
|
class RigidBody;
|
||||||
|
@ -157,17 +156,7 @@ namespace Physic
|
||||||
private:
|
private:
|
||||||
void disableCollisionBody();
|
void disableCollisionBody();
|
||||||
void enableCollisionBody();
|
void enableCollisionBody();
|
||||||
public:
|
|
||||||
//HACK: in Visual Studio 2010 and presumably above, this structures alignment
|
|
||||||
// must be 16, but the built in operator new & delete don't properly
|
|
||||||
// perform this alignment.
|
|
||||||
#if _MSC_VER >= 1600
|
|
||||||
void * operator new (size_t Size) { return _aligned_malloc (Size, 16); }
|
|
||||||
void operator delete (void * Data) { _aligned_free (Data); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
OEngine::Physic::RigidBody* mBody;
|
OEngine::Physic::RigidBody* mBody;
|
||||||
OEngine::Physic::RigidBody* mRaycastingBody;
|
OEngine::Physic::RigidBody* mRaycastingBody;
|
||||||
|
|
||||||
|
@ -329,12 +318,6 @@ public:
|
||||||
const btVector3 &origin,
|
const btVector3 &origin,
|
||||||
btCollisionObject *object);
|
btCollisionObject *object);
|
||||||
|
|
||||||
//event list of non player object
|
|
||||||
std::list<PhysicEvent> NPEventList;
|
|
||||||
|
|
||||||
//event list affecting the player
|
|
||||||
std::list<PhysicEvent> PEventList;
|
|
||||||
|
|
||||||
//Bullet Stuff
|
//Bullet Stuff
|
||||||
btOverlappingPairCache* pairCache;
|
btOverlappingPairCache* pairCache;
|
||||||
btBroadphaseInterface* broadphase;
|
btBroadphaseInterface* broadphase;
|
||||||
|
|
Loading…
Reference in a new issue