[IrrBullet] Issue using IConvexHullShapes

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
InstinctCH
Posts: 16
Joined: Fri Feb 25, 2011 12:48 pm
Location: Switzerland

[IrrBullet] Issue using IConvexHullShapes

Post by InstinctCH »

Hey everyone !

I've got a weird issue when using the IConvexHullShapes from irrBullet. My Rigidbodies dont rotate, no matter how they hit the ground, they stay in the same position. Here's a screen of the issue:

Image

Maybe you want to see the code so here it is:

Code: Select all

 
    vector3df pos = camera->getAbsolutePosition();
    pos.Y-=0.4;
    IAnimatedMeshSceneNode *Node = device->getSceneManager()->addAnimatedMeshSceneNode(device->getSceneManager()->getMesh("MODELS/OTHER/M9mag.b3d"));
 
    Node->setMaterialTexture(0, m_magTex);
    Node->setScale(vector3df(0.3,0.3,0.3));
    Node->setPosition(pos);
    Node->setRotation(vector3df(0,0,0));
    Node->setMaterialFlag(irr::video::EMF_LIGHTING, true);
    Node->setMaterialFlag(irr::video::EMF_NORMALIZE_NORMALS, true);
 
        ICollisionShape*  shape = new IConvexHullShape(Node, Node->getMesh(), 0.02);
        //shape->setMargin(0.01);
 
        IRigidBody *body = world->addRigidBody(shape);
        body->setCcdValues(0.02,0.02);
 
 
    return body;
InstinctCH
Posts: 16
Joined: Fri Feb 25, 2011 12:48 pm
Location: Switzerland

Re: [IrrBullet] Issue using IConvexHullShapes

Post by InstinctCH »

Nobody has an idea why IrrBullet is doing this? :(
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: [IrrBullet] Issue using IConvexHullShapes

Post by serengeor »

InstinctCH wrote:Nobody has an idea why IrrBullet is doing this? :(
erm, try drawing everything with debug drawer.
Working on game: Marrbles (Currently stopped).
InstinctCH
Posts: 16
Joined: Fri Feb 25, 2011 12:48 pm
Location: Switzerland

Re: [IrrBullet] Issue using IConvexHullShapes

Post by InstinctCH »

Okay but I don't see what will help me if I draw debug infos..
randomMesh
Posts: 1187
Joined: Fri Dec 29, 2006 12:04 am

Re: [IrrBullet] Issue using IConvexHullShapes

Post by randomMesh »

InstinctCH wrote:Okay but I don't see what will help me if I draw debug infos..
A lot! See this post for a debug drawer.

Edit: I see you are using IrrBullet, maybe it got its own debug drawer.
"Whoops..."
InstinctCH
Posts: 16
Joined: Fri Feb 25, 2011 12:48 pm
Location: Switzerland

Re: [IrrBullet] Issue using IConvexHullShapes

Post by InstinctCH »

Yes it has its own debug drawer. But everything is working fine, except for the rotations. The rigidbodies just stay in the same rotation as they were created. :?
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: [IrrBullet] Issue using IConvexHullShapes

Post by serengeor »

InstinctCH wrote:Yes it has its own debug drawer. But everything is working fine, except for the rotations. The rigidbodies just stay in the same rotation as they were created. :?
you should post a screenshot with rigid bodies dropping with enabled debug drawer (set everything to on.)
There is a way in bullet to lock rotations on specific axis, but from the code you shown it doesn't seem like you're doing that.
Working on game: Marrbles (Currently stopped).
InstinctCH
Posts: 16
Joined: Fri Feb 25, 2011 12:48 pm
Location: Switzerland

Re: [IrrBullet] Issue using IConvexHullShapes

Post by InstinctCH »

I just found this post from jaeg: http://irrlicht.sourceforge.net/forum/v ... 15#p257845

He says that he isn't able to apply forces to his characters when using an IConvexHullShape so I guess it's normal. I think I'll stay with my IBoxShape, although there are many tunneling issues. :roll:
Post Reply