irrBP - An Irrlicht - Bullet Physics Wrapper

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki

Postby serengeor » Tue Mar 29, 2011 3:39 pm

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).
User avatar
serengeor
 
Posts: 1711
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

License question

Postby chisser98 » Sun Apr 03, 2011 3:51 am

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
chisser98
 
Posts: 7
Joined: Thu Mar 31, 2011 11:57 pm
Location: Canada

Re: License question

Postby Zurzaza » Tue Apr 05, 2011 3:54 pm

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.
User avatar
Zurzaza
 
Posts: 153
Joined: Fri Mar 26, 2010 9:41 pm
Location: Filo (FE), Italy

Postby chisser98 » Tue Apr 05, 2011 5:20 pm

Ohhh ok. Got it. Thanks Zurzaza :D
chisser98
 
Posts: 7
Joined: Thu Mar 31, 2011 11:57 pm
Location: Canada

gimbal lock

Postby spacetime » Thu Apr 28, 2011 11:53 pm

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
spacetime
 
Posts: 15
Joined: Mon Feb 14, 2011 12:24 am

Re: gimbal lock

Postby serengeor » Fri Apr 29, 2011 8:05 am

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).
User avatar
serengeor
 
Posts: 1711
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Postby ChaiRuiPeng » Fri Apr 29, 2011 1:56 pm

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 ;)
User avatar
ChaiRuiPeng
 
Posts: 363
Joined: Thu Dec 16, 2010 8:50 pm
Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..

gimbal lock - workaround

Postby spacetime » Fri Apr 29, 2011 2:41 pm

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
spacetime
 
Posts: 15
Joined: Mon Feb 14, 2011 12:24 am

Postby Zurzaza » Fri Apr 29, 2011 3:44 pm

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.
User avatar
Zurzaza
 
Posts: 153
Joined: Fri Mar 26, 2010 9:41 pm
Location: Filo (FE), Italy

gimbal lock - workaround

Postby spacetime » Fri Apr 29, 2011 11:04 pm

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
spacetime
 
Posts: 15
Joined: Mon Feb 14, 2011 12:24 am

problem with example_vehicle.cpp

Postby newleon » Fri May 06, 2011 2:49 am

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?
User avatar
newleon
 
Posts: 19
Joined: Mon Jan 10, 2011 7:59 am
Location: Pohang, South Korea

Re: problem with example_vehicle.cpp

Postby Zurzaza » Sun May 08, 2011 8:10 am

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.
User avatar
Zurzaza
 
Posts: 153
Joined: Fri Mar 26, 2010 9:41 pm
Location: Filo (FE), Italy

Removing Constraint

Postby spacetime » Sun May 15, 2011 1:15 am

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
spacetime
 
Posts: 15
Joined: Mon Feb 14, 2011 12:24 am

Postby Zurzaza » Sun May 15, 2011 8:13 am

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.
User avatar
Zurzaza
 
Posts: 153
Joined: Fri Mar 26, 2010 9:41 pm
Location: Filo (FE), Italy

Postby spacetime » Mon May 16, 2011 6:58 pm

THX great support. I'll try it on weekend
spacetime
 
Posts: 15
Joined: Mon Feb 14, 2011 12:24 am

PreviousNext

Return to Project Announcements

Who is online

Users browsing this forum: Nadro and 1 guest