mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-28 07:32:00 -04:00
Whitespace changes only (including new mangle with whitespace changes as well)
This commit is contained in:
parent
c78e61c96f
commit
0f7d59b4fb
@ -71,6 +71,7 @@ namespace BtOgre {
|
|||||||
vbuf->unlock();
|
vbuf->unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void VertexIndexToShape::addAnimatedVertexData(const Ogre::VertexData *vertex_data,
|
void VertexIndexToShape::addAnimatedVertexData(const Ogre::VertexData *vertex_data,
|
||||||
const Ogre::VertexData *blend_data,
|
const Ogre::VertexData *blend_data,
|
||||||
@ -116,6 +117,7 @@ namespace BtOgre {
|
|||||||
}
|
}
|
||||||
vbuf->unlock();
|
vbuf->unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const Ogre::VertexElement* bneElem = vertex_data->vertexDeclaration->findElementBySemantic(Ogre::VES_BLEND_INDICES);
|
const Ogre::VertexElement* bneElem = vertex_data->vertexDeclaration->findElementBySemantic(Ogre::VES_BLEND_INDICES);
|
||||||
assert (bneElem);
|
assert (bneElem);
|
||||||
@ -158,6 +160,7 @@ namespace BtOgre {
|
|||||||
vbuf->unlock();
|
vbuf->unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void VertexIndexToShape::addIndexData(IndexData *data, const unsigned int offset)
|
void VertexIndexToShape::addIndexData(IndexData *data, const unsigned int offset)
|
||||||
{
|
{
|
||||||
@ -201,6 +204,7 @@ namespace BtOgre {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
Real VertexIndexToShape::getRadius()
|
Real VertexIndexToShape::getRadius()
|
||||||
{
|
{
|
||||||
@ -211,6 +215,7 @@ namespace BtOgre {
|
|||||||
}
|
}
|
||||||
return mBoundRadius;
|
return mBoundRadius;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
Vector3 VertexIndexToShape::getSize()
|
Vector3 VertexIndexToShape::getSize()
|
||||||
{
|
{
|
||||||
@ -241,21 +246,25 @@ namespace BtOgre {
|
|||||||
|
|
||||||
return mBounds;
|
return mBounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
const Ogre::Vector3* VertexIndexToShape::getVertices()
|
const Ogre::Vector3* VertexIndexToShape::getVertices()
|
||||||
{
|
{
|
||||||
return mVertexBuffer;
|
return mVertexBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
unsigned int VertexIndexToShape::getVertexCount()
|
unsigned int VertexIndexToShape::getVertexCount()
|
||||||
{
|
{
|
||||||
return mVertexCount;
|
return mVertexCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
const unsigned int* VertexIndexToShape::getIndices()
|
const unsigned int* VertexIndexToShape::getIndices()
|
||||||
{
|
{
|
||||||
return mIndexBuffer;
|
return mIndexBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
unsigned int VertexIndexToShape::getIndexCount()
|
unsigned int VertexIndexToShape::getIndexCount()
|
||||||
{
|
{
|
||||||
@ -274,6 +283,7 @@ namespace BtOgre {
|
|||||||
|
|
||||||
return shape;
|
return shape;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
btBoxShape* VertexIndexToShape::createBox()
|
btBoxShape* VertexIndexToShape::createBox()
|
||||||
{
|
{
|
||||||
@ -288,6 +298,7 @@ namespace BtOgre {
|
|||||||
|
|
||||||
return shape;
|
return shape;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
btCylinderShape* VertexIndexToShape::createCylinder()
|
btCylinderShape* VertexIndexToShape::createCylinder()
|
||||||
{
|
{
|
||||||
@ -302,6 +313,7 @@ namespace BtOgre {
|
|||||||
|
|
||||||
return shape;
|
return shape;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
btConvexHullShape* VertexIndexToShape::createConvex()
|
btConvexHullShape* VertexIndexToShape::createConvex()
|
||||||
{
|
{
|
||||||
@ -310,6 +322,7 @@ namespace BtOgre {
|
|||||||
|
|
||||||
return new btConvexHullShape((btScalar*) &mVertexBuffer[0].x, mVertexCount, sizeof(Vector3));
|
return new btConvexHullShape((btScalar*) &mVertexBuffer[0].x, mVertexCount, sizeof(Vector3));
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
btBvhTriangleMeshShape* VertexIndexToShape::createTrimesh()
|
btBvhTriangleMeshShape* VertexIndexToShape::createTrimesh()
|
||||||
{
|
{
|
||||||
@ -356,6 +369,7 @@ namespace BtOgre {
|
|||||||
|
|
||||||
return shape;
|
return shape;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
VertexIndexToShape::~VertexIndexToShape()
|
VertexIndexToShape::~VertexIndexToShape()
|
||||||
{
|
{
|
||||||
@ -373,6 +387,7 @@ namespace BtOgre {
|
|||||||
delete mBoneIndex;
|
delete mBoneIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
VertexIndexToShape::VertexIndexToShape(const Matrix4 &transform) :
|
VertexIndexToShape::VertexIndexToShape(const Matrix4 &transform) :
|
||||||
mVertexBuffer (0),
|
mVertexBuffer (0),
|
||||||
@ -399,10 +414,12 @@ namespace BtOgre {
|
|||||||
mNode (0)
|
mNode (0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
StaticMeshToShapeConverter::~StaticMeshToShapeConverter()
|
StaticMeshToShapeConverter::~StaticMeshToShapeConverter()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
StaticMeshToShapeConverter::StaticMeshToShapeConverter(Entity *entity, const Matrix4 &transform) :
|
StaticMeshToShapeConverter::StaticMeshToShapeConverter(Entity *entity, const Matrix4 &transform) :
|
||||||
VertexIndexToShape(transform),
|
VertexIndexToShape(transform),
|
||||||
@ -411,6 +428,7 @@ namespace BtOgre {
|
|||||||
{
|
{
|
||||||
addEntity(entity, transform);
|
addEntity(entity, transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
StaticMeshToShapeConverter::StaticMeshToShapeConverter(Renderable *rend, const Matrix4 &transform) :
|
StaticMeshToShapeConverter::StaticMeshToShapeConverter(Renderable *rend, const Matrix4 &transform) :
|
||||||
VertexIndexToShape(transform),
|
VertexIndexToShape(transform),
|
||||||
@ -424,6 +442,7 @@ namespace BtOgre {
|
|||||||
VertexIndexToShape::addIndexData(op.indexData);
|
VertexIndexToShape::addIndexData(op.indexData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void StaticMeshToShapeConverter::addEntity(Entity *entity,const Matrix4 &transform)
|
void StaticMeshToShapeConverter::addEntity(Entity *entity,const Matrix4 &transform)
|
||||||
{
|
{
|
||||||
@ -458,6 +477,7 @@ namespace BtOgre {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void StaticMeshToShapeConverter::addMesh(const MeshPtr &mesh, const Matrix4 &transform)
|
void StaticMeshToShapeConverter::addMesh(const MeshPtr &mesh, const Matrix4 &transform)
|
||||||
{
|
{
|
||||||
@ -510,6 +530,7 @@ namespace BtOgre {
|
|||||||
{
|
{
|
||||||
addEntity(entity, transform);
|
addEntity(entity, transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
AnimatedMeshToShapeConverter::AnimatedMeshToShapeConverter() :
|
AnimatedMeshToShapeConverter::AnimatedMeshToShapeConverter() :
|
||||||
VertexIndexToShape(),
|
VertexIndexToShape(),
|
||||||
@ -519,11 +540,13 @@ namespace BtOgre {
|
|||||||
mTransformedVerticesTempSize(0)
|
mTransformedVerticesTempSize(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
AnimatedMeshToShapeConverter::~AnimatedMeshToShapeConverter()
|
AnimatedMeshToShapeConverter::~AnimatedMeshToShapeConverter()
|
||||||
{
|
{
|
||||||
delete[] mTransformedVerticesTemp;
|
delete[] mTransformedVerticesTemp;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void AnimatedMeshToShapeConverter::addEntity(Entity *entity,const Matrix4 &transform)
|
void AnimatedMeshToShapeConverter::addEntity(Entity *entity,const Matrix4 &transform)
|
||||||
{
|
{
|
||||||
@ -569,6 +592,7 @@ namespace BtOgre {
|
|||||||
|
|
||||||
mEntity->removeSoftwareAnimationRequest(false);
|
mEntity->removeSoftwareAnimationRequest(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void AnimatedMeshToShapeConverter::addMesh(const MeshPtr &mesh, const Matrix4 &transform)
|
void AnimatedMeshToShapeConverter::addMesh(const MeshPtr &mesh, const Matrix4 &transform)
|
||||||
{
|
{
|
||||||
@ -609,6 +633,7 @@ namespace BtOgre {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
bool AnimatedMeshToShapeConverter::getBoneVertices(unsigned char bone,
|
bool AnimatedMeshToShapeConverter::getBoneVertices(unsigned char bone,
|
||||||
unsigned int &vertex_count,
|
unsigned int &vertex_count,
|
||||||
@ -636,7 +661,7 @@ namespace BtOgre {
|
|||||||
vertices = mTransformedVerticesTemp;
|
vertices = mTransformedVerticesTemp;
|
||||||
vertices[0] = bonePosition;
|
vertices[0] = bonePosition;
|
||||||
//mEntity->_getParentNodeFullTransform() *
|
//mEntity->_getParentNodeFullTransform() *
|
||||||
// mEntity->getSkeleton()->getBone(bone)->_getDerivedPosition();
|
//mEntity->getSkeleton()->getBone(bone)->_getDerivedPosition();
|
||||||
|
|
||||||
//mEntity->getSkeleton()->getBone(bone)->_getDerivedOrientation()
|
//mEntity->getSkeleton()->getBone(bone)->_getDerivedOrientation()
|
||||||
unsigned int currBoneVertex = 1;
|
unsigned int currBoneVertex = 1;
|
||||||
@ -649,6 +674,7 @@ namespace BtOgre {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
btBoxShape* AnimatedMeshToShapeConverter::createAlignedBox(unsigned char bone,
|
btBoxShape* AnimatedMeshToShapeConverter::createAlignedBox(unsigned char bone,
|
||||||
const Vector3 &bonePosition,
|
const Vector3 &bonePosition,
|
||||||
@ -685,6 +711,7 @@ namespace BtOgre {
|
|||||||
|
|
||||||
return box;
|
return box;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
bool AnimatedMeshToShapeConverter::getOrientedBox(unsigned char bone,
|
bool AnimatedMeshToShapeConverter::getOrientedBox(unsigned char bone,
|
||||||
const Vector3 &bonePosition,
|
const Vector3 &bonePosition,
|
||||||
@ -759,6 +786,7 @@ namespace BtOgre {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
btBoxShape *AnimatedMeshToShapeConverter::createOrientedBox(unsigned char bone,
|
btBoxShape *AnimatedMeshToShapeConverter::createOrientedBox(unsigned char bone,
|
||||||
const Vector3 &bonePosition,
|
const Vector3 &bonePosition,
|
||||||
@ -789,12 +817,14 @@ namespace BtOgre {
|
|||||||
DynamicRenderable::DynamicRenderable()
|
DynamicRenderable::DynamicRenderable()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
DynamicRenderable::~DynamicRenderable()
|
DynamicRenderable::~DynamicRenderable()
|
||||||
{
|
{
|
||||||
delete mRenderOp.vertexData;
|
delete mRenderOp.vertexData;
|
||||||
delete mRenderOp.indexData;
|
delete mRenderOp.indexData;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void DynamicRenderable::initialize(RenderOperation::OperationType operationType,
|
void DynamicRenderable::initialize(RenderOperation::OperationType operationType,
|
||||||
bool useIndices)
|
bool useIndices)
|
||||||
@ -813,6 +843,7 @@ namespace BtOgre {
|
|||||||
// Create vertex declaration
|
// Create vertex declaration
|
||||||
createVertexDeclaration();
|
createVertexDeclaration();
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void DynamicRenderable::prepareHardwareBuffers(size_t vertexCount,
|
void DynamicRenderable::prepareHardwareBuffers(size_t vertexCount,
|
||||||
size_t indexCount)
|
size_t indexCount)
|
||||||
@ -897,11 +928,13 @@ namespace BtOgre {
|
|||||||
mRenderOp.indexData->indexCount = indexCount;
|
mRenderOp.indexData->indexCount = indexCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
Real DynamicRenderable::getBoundingRadius(void) const
|
Real DynamicRenderable::getBoundingRadius(void) const
|
||||||
{
|
{
|
||||||
return Math::Sqrt(std::max(mBox.getMaximum().squaredLength(), mBox.getMinimum().squaredLength()));
|
return Math::Sqrt(std::max(mBox.getMaximum().squaredLength(), mBox.getMinimum().squaredLength()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
Real DynamicRenderable::getSquaredViewDepth(const Camera* cam) const
|
Real DynamicRenderable::getSquaredViewDepth(const Camera* cam) const
|
||||||
{
|
{
|
||||||
@ -924,6 +957,7 @@ namespace BtOgre {
|
|||||||
POSITION_BINDING,
|
POSITION_BINDING,
|
||||||
TEXCOORD_BINDING
|
TEXCOORD_BINDING
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
DynamicLines::DynamicLines(OperationType opType)
|
DynamicLines::DynamicLines(OperationType opType)
|
||||||
{
|
{
|
||||||
@ -931,43 +965,51 @@ namespace BtOgre {
|
|||||||
setMaterial("BaseWhiteNoLighting");
|
setMaterial("BaseWhiteNoLighting");
|
||||||
mDirty = true;
|
mDirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
DynamicLines::~DynamicLines()
|
DynamicLines::~DynamicLines()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void DynamicLines::setOperationType(OperationType opType)
|
void DynamicLines::setOperationType(OperationType opType)
|
||||||
{
|
{
|
||||||
mRenderOp.operationType = opType;
|
mRenderOp.operationType = opType;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
RenderOperation::OperationType DynamicLines::getOperationType() const
|
RenderOperation::OperationType DynamicLines::getOperationType() const
|
||||||
{
|
{
|
||||||
return mRenderOp.operationType;
|
return mRenderOp.operationType;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void DynamicLines::addPoint(const Vector3 &p)
|
void DynamicLines::addPoint(const Vector3 &p)
|
||||||
{
|
{
|
||||||
mPoints.push_back(p);
|
mPoints.push_back(p);
|
||||||
mDirty = true;
|
mDirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void DynamicLines::addPoint(Real x, Real y, Real z)
|
void DynamicLines::addPoint(Real x, Real y, Real z)
|
||||||
{
|
{
|
||||||
mPoints.push_back(Vector3(x,y,z));
|
mPoints.push_back(Vector3(x,y,z));
|
||||||
mDirty = true;
|
mDirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
const Vector3& DynamicLines::getPoint(unsigned short index) const
|
const Vector3& DynamicLines::getPoint(unsigned short index) const
|
||||||
{
|
{
|
||||||
assert(index < mPoints.size() && "Point index is out of bounds!!");
|
assert(index < mPoints.size() && "Point index is out of bounds!!");
|
||||||
return mPoints[index];
|
return mPoints[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
unsigned short DynamicLines::getNumPoints(void) const
|
unsigned short DynamicLines::getNumPoints(void) const
|
||||||
{
|
{
|
||||||
return (unsigned short)mPoints.size();
|
return (unsigned short)mPoints.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void DynamicLines::setPoint(unsigned short index, const Vector3 &value)
|
void DynamicLines::setPoint(unsigned short index, const Vector3 &value)
|
||||||
{
|
{
|
||||||
@ -976,23 +1018,27 @@ namespace BtOgre {
|
|||||||
mPoints[index] = value;
|
mPoints[index] = value;
|
||||||
mDirty = true;
|
mDirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void DynamicLines::clear()
|
void DynamicLines::clear()
|
||||||
{
|
{
|
||||||
mPoints.clear();
|
mPoints.clear();
|
||||||
mDirty = true;
|
mDirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void DynamicLines::update()
|
void DynamicLines::update()
|
||||||
{
|
{
|
||||||
if (mDirty) fillHardwareBuffers();
|
if (mDirty) fillHardwareBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void DynamicLines::createVertexDeclaration()
|
void DynamicLines::createVertexDeclaration()
|
||||||
{
|
{
|
||||||
VertexDeclaration *decl = mRenderOp.vertexData->vertexDeclaration;
|
VertexDeclaration *decl = mRenderOp.vertexData->vertexDeclaration;
|
||||||
decl->addElement(POSITION_BINDING, 0, VET_FLOAT3, VES_POSITION);
|
decl->addElement(POSITION_BINDING, 0, VET_FLOAT3, VES_POSITION);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
void DynamicLines::fillHardwareBuffers()
|
void DynamicLines::fillHardwareBuffers()
|
||||||
{
|
{
|
||||||
|
@ -130,7 +130,6 @@ protected:
|
|||||||
Ogre::Vector3 *axis,
|
Ogre::Vector3 *axis,
|
||||||
Ogre::Vector3 ¢er);
|
Ogre::Vector3 ¢er);
|
||||||
|
|
||||||
|
|
||||||
Ogre::Entity* mEntity;
|
Ogre::Entity* mEntity;
|
||||||
Ogre::SceneNode* mNode;
|
Ogre::SceneNode* mNode;
|
||||||
|
|
||||||
|
@ -10,9 +10,9 @@ namespace Physic
|
|||||||
class PhysicEngine;
|
class PhysicEngine;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*A CMotionState is associated with a single RigidBody.
|
* A CMotionState is associated with a single RigidBody.
|
||||||
*When the RigidBody is moved by bullet, bullet will call the function setWorldTransform.
|
* When the RigidBody is moved by bullet, bullet will call the function setWorldTransform.
|
||||||
*for more info, see the bullet Wiki at btMotionState.
|
* for more info, see the bullet Wiki at btMotionState.
|
||||||
*/
|
*/
|
||||||
class CMotionState:public btMotionState
|
class CMotionState:public btMotionState
|
||||||
{
|
{
|
||||||
@ -21,13 +21,13 @@ namespace Physic
|
|||||||
CMotionState(PhysicEngine* eng,std::string name);
|
CMotionState(PhysicEngine* eng,std::string name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*Return the position of the RigidBody.
|
* Return the position of the RigidBody.
|
||||||
*/
|
*/
|
||||||
virtual void getWorldTransform(btTransform &worldTrans) const;
|
virtual void getWorldTransform(btTransform &worldTrans) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*Function called by bullet when the RigidBody is moved.
|
* Function called by bullet when the RigidBody is moved.
|
||||||
*It add an event to the EventList of the PhysicEngine class.
|
* It add an event to the EventList of the PhysicEngine class.
|
||||||
*/
|
*/
|
||||||
virtual void setWorldTransform(const btTransform &worldTrans);
|
virtual void setWorldTransform(const btTransform &worldTrans);
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ namespace Physic
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*A physic Actor use a modifed KinematicCharacterController taken in the bullet forum.
|
* A physic Actor use a modifed KinematicCharacterController taken in the bullet forum.
|
||||||
*/
|
*/
|
||||||
class PhysicActor
|
class PhysicActor
|
||||||
{
|
{
|
||||||
@ -56,9 +56,9 @@ namespace Physic
|
|||||||
~PhysicActor();
|
~PhysicActor();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*This function set the walkDirection. This is not relative to the actor orientation.
|
* This function set the walkDirection. This is not relative to the actor orientation.
|
||||||
*I think it's also needed to take time into account. A typical call should look like this:
|
* I think it's also needed to take time into account. A typical call should look like this:
|
||||||
*setWalkDirection( mvt * orientation * dt)
|
* setWalkDirection( mvt * orientation * dt)
|
||||||
*/
|
*/
|
||||||
void setWalkDirection(const btVector3& mvt);
|
void setWalkDirection(const btVector3& mvt);
|
||||||
|
|
||||||
@ -107,91 +107,91 @@ namespace Physic
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*The PhysicEngine class contain everything which is needed for Physic.
|
* The PhysicEngine class contain everything which is needed for Physic.
|
||||||
*It's needed that Ogre Resources are set up before the PhysicEngine is created.
|
* It's needed that Ogre Resources are set up before the PhysicEngine is created.
|
||||||
*Note:deleting it WILL NOT delete the RigidBody!
|
* Note:deleting it WILL NOT delete the RigidBody!
|
||||||
*TODO:unload unused resources?
|
* TODO:unload unused resources?
|
||||||
*/
|
*/
|
||||||
class PhysicEngine
|
class PhysicEngine
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
*Note that the shapeLoader IS destroyed by the phyic Engine!!
|
* Note that the shapeLoader IS destroyed by the phyic Engine!!
|
||||||
*/
|
*/
|
||||||
PhysicEngine(BulletShapeLoader* shapeLoader);
|
PhysicEngine(BulletShapeLoader* shapeLoader);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*It DOES destroy the shape loader!
|
* It DOES destroy the shape loader!
|
||||||
*/
|
*/
|
||||||
~PhysicEngine();
|
~PhysicEngine();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*create a RigidBody.It does not add it to the simulation, but it does add it to the rigidBody Map,
|
* Create a RigidBody.It does not add it to the simulation, but it does add it to the rigidBody Map,
|
||||||
*so you can get it with the getRigidBody function.
|
* so you can get it with the getRigidBody function.
|
||||||
*/
|
*/
|
||||||
RigidBody* createRigidBody(std::string mesh,std::string name);
|
RigidBody* createRigidBody(std::string mesh,std::string name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*Add a RigidBody to the simulation
|
* Add a RigidBody to the simulation
|
||||||
*/
|
*/
|
||||||
void addRigidBody(RigidBody* body);
|
void addRigidBody(RigidBody* body);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*Remove a RigidBody from the simulation. It does not delete it, and does not remove it from the RigidBodyMap.
|
* Remove a RigidBody from the simulation. It does not delete it, and does not remove it from the RigidBodyMap.
|
||||||
*/
|
*/
|
||||||
void removeRigidBody(std::string name);
|
void removeRigidBody(std::string name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*delete a RigidBody, and remove it from RigidBodyMap.
|
* Delete a RigidBody, and remove it from RigidBodyMap.
|
||||||
*/
|
*/
|
||||||
void deleteRigidBody(std::string name);
|
void deleteRigidBody(std::string name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*Return a pointer to a given rigid body.
|
* Return a pointer to a given rigid body.
|
||||||
*TODO:check if exist
|
* TODO:check if exist
|
||||||
*/
|
*/
|
||||||
RigidBody* getRigidBody(std::string name);
|
RigidBody* getRigidBody(std::string name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*Create and add a character to the scene, and add it to the ActorMap.
|
* Create and add a character to the scene, and add it to the ActorMap.
|
||||||
*/
|
*/
|
||||||
void addCharacter(std::string name);
|
void addCharacter(std::string name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*Remove a character from the scene. TODO:delete it! for now, a small memory leak^^ done?
|
* Remove a character from the scene. TODO:delete it! for now, a small memory leak^^ done?
|
||||||
*/
|
*/
|
||||||
void removeCharacter(std::string name);
|
void removeCharacter(std::string name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*return a pointer to a character
|
* Return a pointer to a character
|
||||||
*TODO:check if the actor exist...
|
* TODO:check if the actor exist...
|
||||||
*/
|
*/
|
||||||
PhysicActor* getCharacter(std::string name);
|
PhysicActor* getCharacter(std::string name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*This step the simulation of a given time.
|
* This step the simulation of a given time.
|
||||||
*/
|
*/
|
||||||
void stepSimulation(double deltaT);
|
void stepSimulation(double deltaT);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*Empty events lists
|
* Empty events lists
|
||||||
*/
|
*/
|
||||||
void emptyEventLists(void);
|
void emptyEventLists(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*Create a debug rendering. It is called by setDebgRenderingMode if it's not created yet.
|
* Create a debug rendering. It is called by setDebgRenderingMode if it's not created yet.
|
||||||
*Important Note: this will crash if the Render is not yet initialise!
|
* Important Note: this will crash if the Render is not yet initialise!
|
||||||
*/
|
*/
|
||||||
void createDebugRendering();
|
void createDebugRendering();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*Set the debug rendering mode. 0 to turn it off.
|
* Set the debug rendering mode. 0 to turn it off.
|
||||||
*Important Note: this will crash if the Render is not yet initialise!
|
* Important Note: this will crash if the Render is not yet initialise!
|
||||||
*/
|
*/
|
||||||
void setDebugRenderingMode(int mode);
|
void setDebugRenderingMode(int mode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*Return the closest object hit by a ray. If there are no objects, it will return ("",-1).
|
* Return the closest object hit by a ray. If there are no objects, it will return ("",-1).
|
||||||
*/
|
*/
|
||||||
std::pair<std::string,float> rayTest(btVector3& from,btVector3& to);
|
std::pair<std::string,float> rayTest(btVector3& from,btVector3& to);
|
||||||
|
|
||||||
|
2
mangle
2
mangle
@ -1 +1 @@
|
|||||||
Subproject commit a05046026ec9edb1e528fac2c70f887239302237
|
Subproject commit f3c9694bf249a34eae05f0304e6bfc120014ce8c
|
Loading…
x
Reference in New Issue
Block a user