Get rid of unused file and some other cruft.
parent
783c501d70
commit
5b0a4c9424
@ -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
|
|
Loading…
Reference in New Issue