DebugDrawer and collisions

IFMaster_2005

21-05-2008 23:33:10

Hello everyone, i'm trying to integrate OgreBullet in my current project, i'm just beggining with it, and i have some problems:

About te debug drawer, i initliasie it like this:
mWorld = new DynamicsWorld(mSceneMgr, bounds, gravityVector);

// add Debug info display tool
mDebugDrawer = new DebugDrawer();

mWorld->setDebugDrawer(mDebugDrawer);
mWorld->setShowDebugShapes(true);
mDebugDrawer->setDrawWireframe(true);

SceneNode *node = mSceneMgr->getRootSceneNode()->createChildSceneNode("debugDrawer", Vector3::ZERO);
node->attachObject(static_cast <SimpleRenderable *> (mDebugDrawer));


But i create a sphere shape and it doesn't appear viewed in wire frame, any suggestion?

I have another problem using OgreBullet, i prefer to use only collisions, but maybe in the future i use phsycs too, is for this i initialise the dynamic world.
In order to create a "collision mesh" is enaught to create a mesh, or i must create a rigid body too?
And... how i can ask for a collision between two shapes or rigid bodies?

Thanks a lot for your time and sorry about my poor english.

IFMaster_2005

25-05-2008 17:14:20

I resolve the problem with the debug drawer, and now i have a dynamic world integrated with my project with some rigid bodies.
But i'm trying to understand how OgreBullet makes me konw when a collision has been, but i don't find any method for that.
Any one can help me with this please?

I have another question, i put a cylinder shape for my player entity, but in order to move it by the user, i must put the mass of the rigid body for the player to 0, this is normal? or there are another way better to do it?

I hope some one can help me with it, because i'm a really noob with physcs and collisions. Thanks a lot in advance and again sorry about my poor english.

iisystem

04-10-2009 14:18:58

can you explain how did you get DebugDrawer to work?

Fish

04-10-2009 16:49:38

But i'm trying to understand how OgreBullet makes me konw when a collision has been, but i don't find any method for that.
Any one can help me with this please?

There is some information on the Bullet website about collision callbacks in both the wiki and the manual.

I have another question, i put a cylinder shape for my player entity, but in order to move it by the user, i must put the mass of the rigid body for the player to 0, this is normal? or there are another way better to do it?
You might want to check out the Kinematic Character Controller provided with Bullet.

-Fish

falcco

22-05-2010 20:23:04

Hi,

I'm using Ogre3D 1.7 and I used this same code for create DebugDrawer. Unfortunately if I tried to use DebugDrawer and set mWorld->setShowDebugShapes(true) application crash because vertexBuffer is not created (DebugLines::draw() method)

place where vertexBuffer should be created but it didnt

vbuf = HardwareBufferManager::getSingleton().createVertexBuffer(
decl->getVertexSize(0),
mRenderOp.vertexData->vertexCount,
HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE);


anyway size of decl->getVertexSize(0) was 16 and size of mRenderOp.vertexData->vertexCount was 108
I went step by step and I found that mBufferId is 0 in GLESHardwareVertexBuffer constructor.
Any ides how to fix this problem?

Thx a lot