IrrNewt: Get force of collision using material callbacks

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
olivehehe_03
Posts: 157
Joined: Tue Mar 20, 2007 8:30 am

IrrNewt: Get force of collision using material callbacks

Post by olivehehe_03 »

Just a quick question. I'm making a physics based game (google Armadillo Run for a basic idea) and I'm trying to make it so if 2 bodies collide with enough force one object and any attached joints will break.

Checking through the documentation has found newton::IMaterialPair in ContactBegin and ContactEnd, which are part of newton::IMaterialCollisionCallback, which gives me a getContactForce() fucntion but according to the docs:

Code: Select all

The contact force value is only valid when calculating resting contacts. This means if two bodies collide with non zero relative velocity, the reaction force will be an impulse, which is not a reaction force, this will return zero vector. this function will only return meaningful values when the colliding bodies are at rest. 
This has me a bit concerned because I know in most cases neither object will be completely at rest. Is there a better way to get the amount of force on a particular object at the time of collision? I can get both objects fine, they're just the other 2 values that ContactBegin gives me and I've got a fair idea on how to destroy whichever object I like but I just need to see if the force of collision is high enough for either to break. Thanks in advance
Tell me what you cherish most. Give me the pleasure of taking it away.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

IrrNewt is an independent project, as is Newton.

Presumably you haven't received any answers in the forums of these independent projects?

I'm getting pretty close to abusing my author-oh-tah and just punting all these IrrNewt / Newton questions to Off Topic, boy howdy.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
cassini
Posts: 68
Joined: Thu May 12, 2005 2:40 pm

Post by cassini »

rogerborg wrote:I'm getting pretty close to abusing my author-oh-tah and just punting all these IrrNewt / Newton questions to Off Topic, boy howdy.
Are you going to do the same with: Havok, Physx, ODE and Bullet users and the respective wrappers. Or this only apply to Irrlicht users who use IrrNewt and/or Newton.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

I have a preternatural intolerance for questions that are asked in sub-optimal ways. Don't blame me, I'm half Vulcan, on my mother's side. You racist.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
cassini
Posts: 68
Joined: Thu May 12, 2005 2:40 pm

Post by cassini »

rogerborg wrote:I have a preternatural intolerance for questions that are asked in sub-optimal ways.
You would think that simply not responding, and letting other users answer will take care of the problem.
rogerborg wrote:You racist.
Wow, I did not see that one coming.
You are the one speaking of intolerance and segregating a group of people for no apparent reason other than they are using a library you dislike, and you call me the racist? Aren’t you projecting your personality on somebody else.
twilight17
Posts: 362
Joined: Sun Dec 16, 2007 9:25 pm

Post by twilight17 »

ahahahahah!
Post this userbar I made on other websites to show your support for Irrlicht!
Image
http://img147.imageshack.us/img147/1261 ... wernq4.png
olivehehe_03
Posts: 157
Joined: Tue Mar 20, 2007 8:30 am

Post by olivehehe_03 »

rogerborg wrote:IrrNewt is an independent project, as is Newton.

Presumably you haven't received any answers in the forums of these independent projects?
Didn't think of it, will try my luck there
Tell me what you cherish most. Give me the pleasure of taking it away.
SwitchCase
Posts: 170
Joined: Sun Jul 01, 2007 11:41 pm
Location: Manchester, UK

Post by SwitchCase »

rogerborg wrote:
I have a preternatural intolerance for questions that are asked in sub-optimal ways.
You would think that simply not responding, and letting other users answer will take care of the problem.

rogerborg wrote:
You racist.
Wow, I did not see that one coming.
You are the one speaking of intolerance and segregating a group of people for no apparent reason other than they are using a library you dislike, and you call me the racist? Aren’t you projecting your personality on somebody else.

Ahhhhhhhhhhh... "British" humour :lol:

Not that I know what's specifically British about it - but it would be nice if we didnt get a grilling whenever we joke.
Post Reply