Page 11 of 14

Posted: Tue Mar 29, 2011 3:39 pm
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.

License question

Posted: Sun Apr 03, 2011 3:51 am
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

Re: License question

Posted: Tue Apr 05, 2011 3:54 pm
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. ;)

Posted: Tue Apr 05, 2011 5:20 pm
by chisser98
Ohhh ok. Got it. Thanks Zurzaza :D

gimbal lock

Posted: Thu Apr 28, 2011 11:53 pm
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

Re: gimbal lock

Posted: Fri Apr 29, 2011 8:05 am
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.

Posted: Fri Apr 29, 2011 1:56 pm
by ChaiRuiPeng
just flag them as kinematic. im not sure how you do it in this wrapper though

gimbal lock - workaround

Posted: Fri Apr 29, 2011 2:41 pm
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

Posted: Fri Apr 29, 2011 3:44 pm
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)

gimbal lock - workaround

Posted: Fri Apr 29, 2011 11:04 pm
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

problem with example_vehicle.cpp

Posted: Fri May 06, 2011 2:49 am
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?

Re: problem with example_vehicle.cpp

Posted: Sun May 08, 2011 8:10 am
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.

Removing Constraint

Posted: Sun May 15, 2011 1:15 am
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

Posted: Sun May 15, 2011 8:13 am
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!

Posted: Mon May 16, 2011 6:58 pm
by spacetime
THX great support. I'll try it on weekend