Nakate
17-12-2007 19:46:00
Hello everyone. I'm a bit new to dealing with physics libraries and the such, but I've been fighting with this and *seem* to have gotten it installed. However, when I attempt to create a static trimesh, the game crashes, though it compiles fine. This may be due to the lack of documentation, but I'm not entirely sure what needs to be done in the first place. After studying the demo for the past few days I thought I knew, but I guess not yet.
The error in-game occurs when the object is made, and the error is:
What I do to create the trimesh is:
mWorld is created with:
and I #include:
Ogre.log doesn't appear to have any useful information in it. Am I simply forgetting to do something? I've been jumping through hoops to get the game as far as I have, so I can only pray there's a simple solution to this.
As long as I'm here, I'll ask about a few other things on my mind. Is there any way to lock an object's rotation and movement to prevent rolling, pitching, and sliding? For example, if a person is standing on a hill, he can still stand upright without falling over or sliding down the hill (within reason). Yet he can start and stop walking whenever he pleases, so just turning up the friction may not work. Also, if he walks into a low object like a table he won't trip over it (if he's paying attention, anyway). I appreciate any help you can give, and thanks in advance for your time.
The error in-game occurs when the object is made, and the error is:
Assertion Failed!
Program: ...
File: e:\projects\ogrecvs\branches\eihor...\ogreentity.cpp
Line: 1016
Expression: mSkelAnimVertexData && "Not software skinned or has no shared vertex data!"
What I do to create the trimesh is:
Entity *sceneEntity = mSceneMgr->createEntity( "Map", "planets.mesh" );
OgreBulletCollisions::MeshToShapeConverter *trimeshConverter = new OgreBulletCollisions::MeshToShapeConverter(sceneEntity);
OgreBulletCollisions::TriangleMeshCollisionShape *sceneTriMeshShape = trimeshConverter->createTrimesh();
delete trimeshConverter;
OgreBulletDynamics::RigidBody *sceneRigid = new OgreBulletDynamics::RigidBody("MapRigid", mWorld);
SceneNode *node5 = mSceneMgr->getRootSceneNode()->createChildSceneNode("MapNode", Vector3(0, 0, 0));
node5->attachObject( sceneEntity );
sceneRigid->setStaticShape(node5, sceneTriMeshShape, 0.1f, 0.8f, Vector3(500,100,500));
mWorld is created with:
Vector3 gravityVector = Vector3( 0, -9.810000, 0 );
AxisAlignedBox bounds = AxisAlignedBox( Vector3(-10000, -10000,-10000), Vector3(10000, 10000,10000) );
mWorld = new OgreBulletDynamics::DynamicsWorld (mSceneMgr, bounds, gravityVector);
and I #include:
#include "OgreBulletCollisions.h"
#include "OgreBulletDynamics.h"
#include "OgreBulletDynamicsRigidBody.h"
#include "Utils/OgreBulletCollisionsMeshToShapeConverter.h"
#include "Shapes/OgreBulletCollisionsTrimeshShape.h"
Ogre.log doesn't appear to have any useful information in it. Am I simply forgetting to do something? I've been jumping through hoops to get the game as far as I have, so I can only pray there's a simple solution to this.
As long as I'm here, I'll ask about a few other things on my mind. Is there any way to lock an object's rotation and movement to prevent rolling, pitching, and sliding? For example, if a person is standing on a hill, he can still stand upright without falling over or sliding down the hill (within reason). Yet he can start and stop walking whenever he pleases, so just turning up the friction may not work. Also, if he walks into a low object like a table he won't trip over it (if he's paying attention, anyway). I appreciate any help you can give, and thanks in advance for your time.