irrBP - An Irrlicht - Bullet Physics Wrapper

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

Zurzaza wrote:
serengeor wrote:
Zurzaza wrote: New Features:
> Multithreaded Bullet (Bullet has some leaks [about 300-400 bytes] when using multithread, sorry but i can't solve them)
try valgrind if you have a linux machine, it should give you some hints where to look at.
I tried MLD (Valgrind for visual studio), but it seems that the leak is inside the core of bullet, I tried to remove it, but without success.
You should post it to bullet forums then, maybe they could fix it.
Working on game: Marrbles (Currently stopped).
chisser98
Posts: 7
Joined: Thu Mar 31, 2011 11:57 pm
Location: Canada

License question

Post by chisser98 »

Hi all!

I have a question about irrBP license...more specifically, the 'share alike' clause, which states:

Share Alike — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.

If I have integrated the irrBP framework into my commercial project, and I make changes to irrBP, am I then required via the irrBP license to release my project source code under the creative commons 3 license?

Thanks in advance!

Jarrett
Zurzaza
Posts: 153
Joined: Fri Mar 26, 2010 9:41 pm
Location: Filo (FE), Italy
Contact:

Re: License question

Post by Zurzaza »

ehi chisser, sorry for my late reply, but i had problem with my pc during last days.
The SA condition of Creative Commons, is also called CopyLeft..
From wikipedia:
Copyleft is a general method for making a program (or other work) free (libre), and requiring all modified and extended versions of the program to be free as well
So, if you include irrBP in your commercial project, you haven't to share your application source code.
But, if you include a modified version of irrBP in any kind of project you had to distribute the resulting work on irrBP under the same or a similar license, but you may not distribute the entire project. Only the irrBP changes. ;)
irrBP - an Irrlicht - Bullet Physics Wrapper.
The only irrlicht-physics wrapper that uses multithread technology.
chisser98
Posts: 7
Joined: Thu Mar 31, 2011 11:57 pm
Location: Canada

Post by chisser98 »

Ohhh ok. Got it. Thanks Zurzaza :D
spacetime
Posts: 15
Joined: Mon Feb 14, 2011 12:24 am

gimbal lock

Post by spacetime »

I have loaded a mesh, (node = smgr->getMesh("blabla") and created a ConvexHullBody (nodeBP = bpmgr->addConvexHullBody(node, 0.0, 1).
When I rotate the Irrlicht node (node->setRotation(x)) no gimbal lock, but the body is not updated. When I rotate the ConvexHullBody ( nodeBP ) I get a gimbal lock (89.699 degrees). :shock:
Any suggestions?
THX
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: gimbal lock

Post by serengeor »

spacetime wrote:I have loaded a mesh, (node = smgr->getMesh("blabla") and created a ConvexHullBody (nodeBP = bpmgr->addConvexHullBody(node, 0.0, 1).
When I rotate the Irrlicht node (node->setRotation(x)) no gimbal lock, but the body is not updated. When I rotate the ConvexHullBody ( nodeBP ) I get a gimbal lock (89.699 degrees). :shock:
Any suggestions?
THX
1) its because you can't rotate the node thats been assigned to physics body. Well you can, but it will go back to physics body rotation as the physics world updates again.
2) dunno.
Working on game: Marrbles (Currently stopped).
ChaiRuiPeng
Posts: 363
Joined: Thu Dec 16, 2010 8:50 pm
Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..

Post by ChaiRuiPeng »

just flag them as kinematic. im not sure how you do it in this wrapper though
ent1ty wrote: success is a matter of concentration and desire
Butler Lampson wrote: all problems in Computer Science can be solved by another level of indirection
at a cost measure in computer resources ;)
spacetime
Posts: 15
Joined: Mon Feb 14, 2011 12:24 am

gimbal lock - workaround

Post by spacetime »

Well I think I've found a workaround. :)
As mentioned I was able to rotate the Irrlicht scene node, which is a kind of actor in the EventReceiver by pressing a button. Code (simplyfied)

node->setRotation(node->getRotation()+vector3df(0.f, 2.f, 0.f));

using the same command on physics node produced a gimbal lock. Code

nodeBP->setRotation(nodeBP->getRotation()+vector3df(0.f, 2.f, 0.f));

(gimbal lock at 89.699)

Workaround:
node->setRotation(node->getRotation()+vector3df(0.f, 2.f, 0.f));
m_rotation->node->getRotation();
nodeBP->setRotation(m_rotation);

(No gimbal lock)
So basically I am repositioning the Irrlicht node, query the Position or rotation and set the physics node to it. Maybe not elegant, but it works
Could not see any negative side effects so far.
Serengor THX anyway
Zurzaza
Posts: 153
Joined: Fri Mar 26, 2010 9:41 pm
Location: Filo (FE), Italy
Contact:

Post by Zurzaza »

uhm, why do you not rotate the body, by simply using nodeBP->setRotation()? Any Modify to the irrlicht' node status (like rotation or position) won't be visible after a bullet step. Simply use that. If you rotate the body, the node would rotate too (same thing for the position)
irrBP - an Irrlicht - Bullet Physics Wrapper.
The only irrlicht-physics wrapper that uses multithread technology.
spacetime
Posts: 15
Joined: Mon Feb 14, 2011 12:24 am

gimbal lock - workaround

Post by spacetime »

nodeBP is an actor which I want to move with the keyboard i.e. I do not want forces to apply on it in order to move it. Therefore I tried it in a simple way (by not using bullet's character controller or kinematic bodies / thanks ChaiRuiPeng anyway :D ).
The steering needs to be local, 'W' always forward 'S' backwards and so on.
Therefore my movement function is ('W' - forward)

Code: Select all

m_position = vector3df(0.f,0.f,2.f);
m_position.Z +=m_speed*m_frameDeltaTime;
node->getAbsoluteTransformation.transformVect(m_position);
nodeBP->setPosition(m_position);
I cannot use nodeBP because CIrrBPConvexHullBody does not have the needed function.
No need to setPosition for Irrlicht node as I wrote in my 2. post, it is updated automatically.
when I rotate the (physics)Body in a way

Code: Select all

m_degree = 2.f*m_speed*m_frameDeltaTime;
nodeBP->setRotation(nodeBP->getRotation()+vector3df(0.f, m_degree, 0.f));
I got a gimbal lock
If i write

Code: Select all

m_degree = 2.f*m_speed*m_frameDeltaTime;
m_rotation = node->getRotation()+vector3df(0.f, m_degree, 0.f));
nodeBP->setRotation(m_rotation);
which I thought it is the same, I do not get gimbal lock. Note that I am using Irrlicht node to retrieve and calculate the rotation vector and then rotate the physics body (nodeBP), otherwise I get a gimbal lock
Again no need to setRotation to Irrlicht node, it is updated.
So use Irrlicht node to retrieve and calculate the rotation vector, store it in a variable and aply it then to the physics body nodeBP.
THX for suggestions, helped me clean up my code :D
newleon
Posts: 19
Joined: Mon Jan 10, 2011 7:59 am
Location: Pohang, South Korea
Contact:

problem with example_vehicle.cpp

Post by newleon »

Hi
I am trying to implement a car simulation. I just solved linking problems and compiled the example_vehicle.cpp. But nothing happened in response to mouse left click. My car (object) doesn't move even if I set the applyEngineForce() in the while(device->run()) loop. Is there any comment?
Zurzaza
Posts: 153
Joined: Fri Mar 26, 2010 9:41 pm
Location: Filo (FE), Italy
Contact:

Re: problem with example_vehicle.cpp

Post by Zurzaza »

newleon wrote:Hi
I am trying to implement a car simulation. I just solved linking problems and compiled the example_vehicle.cpp. But nothing happened in response to mouse left click. My car (object) doesn't move even if I set the applyEngineForce() in the while(device->run()) loop. Is there any comment?
Hi, sorry for my delay but i had some problem this week.
I found that problem and i'm looking for a solution. Thank you for your report, i'll write as soon as possible, when i'll have the solution.
irrBP - an Irrlicht - Bullet Physics Wrapper.
The only irrlicht-physics wrapper that uses multithread technology.
spacetime
Posts: 15
Joined: Mon Feb 14, 2011 12:24 am

Removing Constraint

Post by spacetime »

I hope somebody can help.
I have attached a ball (dynamic object) to a hand (static object, I think mass =0 ) :oops: with a constraint

Code: Select all

m_constr=bmgr->buildConeTwistConstraint(hand,ball,vector3df(0,0,0),vector3df(0,0,0));
I tried also "buildP2PConstraint" and both options work.
The question is how to remove the constraint (when I throw the ball)

Code: Select all

bmgr->getWorld()->getBulletWorldPtr()->removeConstraint(m_constr);
Gives me a compiler error
no matching function for call to 'btSoftRigidDynamicsWorld::removeConstraint
The same if I use P2PConstraint. Both require rigid bodies. Why is getBulletWorld() returning SoftRigidDynamicWorld ?
THX
Zurzaza
Posts: 153
Joined: Fri Mar 26, 2010 9:41 pm
Location: Filo (FE), Italy
Contact:

Post by Zurzaza »

In the last SVN, that i've just released, there is a function called "removeConstraint" to remove the constraint.
In your example you were wrong twice:
1) If you call a "raw" bullet function, you need to use bullet's "raw" pointers, that you can extract with "getPtr()". Basically, you can't use a bullet function with a irrBP parameter, because irrBP is a layer over bullet, not just an extension ;)

2) If you remove a constraint "manually" in the bullet world, you also need to manage the irrBP' constraint pointer manually, and that operation can result in an headache, so...avoid it!

My tip now is...download the lastest version from SVN and..good job!
irrBP - an Irrlicht - Bullet Physics Wrapper.
The only irrlicht-physics wrapper that uses multithread technology.
spacetime
Posts: 15
Joined: Mon Feb 14, 2011 12:24 am

Post by spacetime »

THX great support. I'll try it on weekend
Post Reply