1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 06:53:52 +00:00

Whitespace changes only (including new mangle with whitespace changes as well)

This commit is contained in:
Jan-Peter Nilsson 2011-04-03 13:12:12 +02:00
parent c78e61c96f
commit 0f7d59b4fb
15 changed files with 1911 additions and 1866 deletions

View file

@ -71,6 +71,7 @@ namespace BtOgre {
vbuf->unlock();
}
}
//------------------------------------------------------------------------------------------------
void VertexIndexToShape::addAnimatedVertexData(const Ogre::VertexData *vertex_data,
const Ogre::VertexData *blend_data,
@ -116,6 +117,7 @@ namespace BtOgre {
}
vbuf->unlock();
}
{
const Ogre::VertexElement* bneElem = vertex_data->vertexDeclaration->findElementBySemantic(Ogre::VES_BLEND_INDICES);
assert (bneElem);
@ -158,6 +160,7 @@ namespace BtOgre {
vbuf->unlock();
}
}
//------------------------------------------------------------------------------------------------
void VertexIndexToShape::addIndexData(IndexData *data, const unsigned int offset)
{
@ -201,6 +204,7 @@ namespace BtOgre {
}
}
//------------------------------------------------------------------------------------------------
Real VertexIndexToShape::getRadius()
{
@ -211,6 +215,7 @@ namespace BtOgre {
}
return mBoundRadius;
}
//------------------------------------------------------------------------------------------------
Vector3 VertexIndexToShape::getSize()
{
@ -241,21 +246,25 @@ namespace BtOgre {
return mBounds;
}
//------------------------------------------------------------------------------------------------
const Ogre::Vector3* VertexIndexToShape::getVertices()
{
return mVertexBuffer;
}
//------------------------------------------------------------------------------------------------
unsigned int VertexIndexToShape::getVertexCount()
{
return mVertexCount;
}
//------------------------------------------------------------------------------------------------
const unsigned int* VertexIndexToShape::getIndices()
{
return mIndexBuffer;
}
//------------------------------------------------------------------------------------------------
unsigned int VertexIndexToShape::getIndexCount()
{
@ -274,6 +283,7 @@ namespace BtOgre {
return shape;
}
//------------------------------------------------------------------------------------------------
btBoxShape* VertexIndexToShape::createBox()
{
@ -288,6 +298,7 @@ namespace BtOgre {
return shape;
}
//------------------------------------------------------------------------------------------------
btCylinderShape* VertexIndexToShape::createCylinder()
{
@ -302,6 +313,7 @@ namespace BtOgre {
return shape;
}
//------------------------------------------------------------------------------------------------
btConvexHullShape* VertexIndexToShape::createConvex()
{
@ -310,6 +322,7 @@ namespace BtOgre {
return new btConvexHullShape((btScalar*) &mVertexBuffer[0].x, mVertexCount, sizeof(Vector3));
}
//------------------------------------------------------------------------------------------------
btBvhTriangleMeshShape* VertexIndexToShape::createTrimesh()
{
@ -356,6 +369,7 @@ namespace BtOgre {
return shape;
}
//------------------------------------------------------------------------------------------------
VertexIndexToShape::~VertexIndexToShape()
{
@ -373,6 +387,7 @@ namespace BtOgre {
delete mBoneIndex;
}
}
//------------------------------------------------------------------------------------------------
VertexIndexToShape::VertexIndexToShape(const Matrix4 &transform) :
mVertexBuffer (0),
@ -399,10 +414,12 @@ namespace BtOgre {
mNode (0)
{
}
//------------------------------------------------------------------------------------------------
StaticMeshToShapeConverter::~StaticMeshToShapeConverter()
{
}
//------------------------------------------------------------------------------------------------
StaticMeshToShapeConverter::StaticMeshToShapeConverter(Entity *entity, const Matrix4 &transform) :
VertexIndexToShape(transform),
@ -411,6 +428,7 @@ namespace BtOgre {
{
addEntity(entity, transform);
}
//------------------------------------------------------------------------------------------------
StaticMeshToShapeConverter::StaticMeshToShapeConverter(Renderable *rend, const Matrix4 &transform) :
VertexIndexToShape(transform),
@ -424,6 +442,7 @@ namespace BtOgre {
VertexIndexToShape::addIndexData(op.indexData);
}
//------------------------------------------------------------------------------------------------
void StaticMeshToShapeConverter::addEntity(Entity *entity,const Matrix4 &transform)
{
@ -458,6 +477,7 @@ namespace BtOgre {
}
}
//------------------------------------------------------------------------------------------------
void StaticMeshToShapeConverter::addMesh(const MeshPtr &mesh, const Matrix4 &transform)
{
@ -510,6 +530,7 @@ namespace BtOgre {
{
addEntity(entity, transform);
}
//------------------------------------------------------------------------------------------------
AnimatedMeshToShapeConverter::AnimatedMeshToShapeConverter() :
VertexIndexToShape(),
@ -519,11 +540,13 @@ namespace BtOgre {
mTransformedVerticesTempSize(0)
{
}
//------------------------------------------------------------------------------------------------
AnimatedMeshToShapeConverter::~AnimatedMeshToShapeConverter()
{
delete[] mTransformedVerticesTemp;
}
//------------------------------------------------------------------------------------------------
void AnimatedMeshToShapeConverter::addEntity(Entity *entity,const Matrix4 &transform)
{
@ -569,6 +592,7 @@ namespace BtOgre {
mEntity->removeSoftwareAnimationRequest(false);
}
//------------------------------------------------------------------------------------------------
void AnimatedMeshToShapeConverter::addMesh(const MeshPtr &mesh, const Matrix4 &transform)
{
@ -609,6 +633,7 @@ namespace BtOgre {
}
}
//------------------------------------------------------------------------------------------------
bool AnimatedMeshToShapeConverter::getBoneVertices(unsigned char bone,
unsigned int &vertex_count,
@ -636,7 +661,7 @@ namespace BtOgre {
vertices = mTransformedVerticesTemp;
vertices[0] = bonePosition;
//mEntity->_getParentNodeFullTransform() *
// mEntity->getSkeleton()->getBone(bone)->_getDerivedPosition();
//mEntity->getSkeleton()->getBone(bone)->_getDerivedPosition();
//mEntity->getSkeleton()->getBone(bone)->_getDerivedOrientation()
unsigned int currBoneVertex = 1;
@ -649,6 +674,7 @@ namespace BtOgre {
}
return true;
}
//------------------------------------------------------------------------------------------------
btBoxShape* AnimatedMeshToShapeConverter::createAlignedBox(unsigned char bone,
const Vector3 &bonePosition,
@ -685,6 +711,7 @@ namespace BtOgre {
return box;
}
//------------------------------------------------------------------------------------------------
bool AnimatedMeshToShapeConverter::getOrientedBox(unsigned char bone,
const Vector3 &bonePosition,
@ -759,6 +786,7 @@ namespace BtOgre {
return true;
}
//------------------------------------------------------------------------------------------------
btBoxShape *AnimatedMeshToShapeConverter::createOrientedBox(unsigned char bone,
const Vector3 &bonePosition,
@ -789,12 +817,14 @@ namespace BtOgre {
DynamicRenderable::DynamicRenderable()
{
}
//------------------------------------------------------------------------------------------------
DynamicRenderable::~DynamicRenderable()
{
delete mRenderOp.vertexData;
delete mRenderOp.indexData;
}
//------------------------------------------------------------------------------------------------
void DynamicRenderable::initialize(RenderOperation::OperationType operationType,
bool useIndices)
@ -813,6 +843,7 @@ namespace BtOgre {
// Create vertex declaration
createVertexDeclaration();
}
//------------------------------------------------------------------------------------------------
void DynamicRenderable::prepareHardwareBuffers(size_t vertexCount,
size_t indexCount)
@ -897,11 +928,13 @@ namespace BtOgre {
mRenderOp.indexData->indexCount = indexCount;
}
}
//------------------------------------------------------------------------------------------------
Real DynamicRenderable::getBoundingRadius(void) const
{
return Math::Sqrt(std::max(mBox.getMaximum().squaredLength(), mBox.getMinimum().squaredLength()));
}
//------------------------------------------------------------------------------------------------
Real DynamicRenderable::getSquaredViewDepth(const Camera* cam) const
{
@ -924,6 +957,7 @@ namespace BtOgre {
POSITION_BINDING,
TEXCOORD_BINDING
};
//------------------------------------------------------------------------------------------------
DynamicLines::DynamicLines(OperationType opType)
{
@ -931,43 +965,51 @@ namespace BtOgre {
setMaterial("BaseWhiteNoLighting");
mDirty = true;
}
//------------------------------------------------------------------------------------------------
DynamicLines::~DynamicLines()
{
}
//------------------------------------------------------------------------------------------------
void DynamicLines::setOperationType(OperationType opType)
{
mRenderOp.operationType = opType;
}
//------------------------------------------------------------------------------------------------
RenderOperation::OperationType DynamicLines::getOperationType() const
{
return mRenderOp.operationType;
}
//------------------------------------------------------------------------------------------------
void DynamicLines::addPoint(const Vector3 &p)
{
mPoints.push_back(p);
mDirty = true;
}
//------------------------------------------------------------------------------------------------
void DynamicLines::addPoint(Real x, Real y, Real z)
{
mPoints.push_back(Vector3(x,y,z));
mDirty = true;
}
//------------------------------------------------------------------------------------------------
const Vector3& DynamicLines::getPoint(unsigned short index) const
{
assert(index < mPoints.size() && "Point index is out of bounds!!");
return mPoints[index];
}
//------------------------------------------------------------------------------------------------
unsigned short DynamicLines::getNumPoints(void) const
{
return (unsigned short)mPoints.size();
}
//------------------------------------------------------------------------------------------------
void DynamicLines::setPoint(unsigned short index, const Vector3 &value)
{
@ -976,23 +1018,27 @@ namespace BtOgre {
mPoints[index] = value;
mDirty = true;
}
//------------------------------------------------------------------------------------------------
void DynamicLines::clear()
{
mPoints.clear();
mDirty = true;
}
//------------------------------------------------------------------------------------------------
void DynamicLines::update()
{
if (mDirty) fillHardwareBuffers();
}
//------------------------------------------------------------------------------------------------
void DynamicLines::createVertexDeclaration()
{
VertexDeclaration *decl = mRenderOp.vertexData->vertexDeclaration;
decl->addElement(POSITION_BINDING, 0, VET_FLOAT3, VES_POSITION);
}
//------------------------------------------------------------------------------------------------
void DynamicLines::fillHardwareBuffers()
{

View file

@ -130,7 +130,6 @@ protected:
Ogre::Vector3 *axis,
Ogre::Vector3 &center);
Ogre::Entity* mEntity;
Ogre::SceneNode* mNode;

View file

@ -10,9 +10,9 @@ 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.
* 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
{
@ -21,13 +21,13 @@ namespace Physic
CMotionState(PhysicEngine* eng,std::string name);
/**
*Return the position of the RigidBody.
* 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.
* 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);

View file

@ -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
{
@ -56,9 +56,9 @@ namespace Physic
~PhysicActor();
/**
*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:
*setWalkDirection( mvt * orientation * dt)
* 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:
* setWalkDirection( mvt * orientation * dt)
*/
void setWalkDirection(const btVector3& mvt);
@ -107,91 +107,91 @@ namespace 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.
*Note:deleting it WILL NOT delete the RigidBody!
*TODO:unload unused resources?
* The PhysicEngine class contain everything which is needed for Physic.
* It's needed that Ogre Resources are set up before the PhysicEngine is created.
* Note:deleting it WILL NOT delete the RigidBody!
* TODO:unload unused resources?
*/
class PhysicEngine
{
public:
/**
*Note that the shapeLoader IS destroyed by the phyic Engine!!
* Note that the shapeLoader IS destroyed by the phyic Engine!!
*/
PhysicEngine(BulletShapeLoader* shapeLoader);
/**
*It DOES destroy the shape loader!
* It DOES destroy the shape loader!
*/
~PhysicEngine();
/**
*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.
* 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.
*/
RigidBody* createRigidBody(std::string mesh,std::string name);
/**
*Add a RigidBody to the simulation
* Add a RigidBody to the simulation
*/
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);
/**
*delete a RigidBody, and remove it from RigidBodyMap.
* Delete a RigidBody, and remove it from RigidBodyMap.
*/
void deleteRigidBody(std::string name);
/**
*Return a pointer to a given rigid body.
*TODO:check if exist
* Return a pointer to a given rigid body.
* TODO:check if exist
*/
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);
/**
*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);
/**
*return a pointer to a character
*TODO:check if the actor exist...
* Return a pointer to a character
* TODO:check if the actor exist...
*/
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);
/**
*Empty events lists
* Empty events lists
*/
void emptyEventLists(void);
/**
*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!
* 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!
*/
void createDebugRendering();
/**
*Set the debug rendering mode. 0 to turn it off.
*Important Note: this will crash if the Render is not yet initialise!
* Set the debug rendering mode. 0 to turn it off.
* Important Note: this will crash if the Render is not yet initialise!
*/
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);

2
mangle

@ -1 +1 @@
Subproject commit a05046026ec9edb1e528fac2c70f887239302237
Subproject commit f3c9694bf249a34eae05f0304e6bfc120014ce8c