Forces for vertices or faces (during collisions)

Can anyone help me on the way to getting this information for a simulation?

I was thinking that if I could get the forces on vertices or at least faces during a collision then I could send the data for that timestep to a finite element program, and the return the distorted mesh and to blender and repeat. It could be an interesting project.

I have already made a script to import transient simulations from my finite element program (elmer).

There is a getReactionForce() method for all game objects. You call it using this script:


own = GameLogic.getCurrentController().owner

force = own.getReactionForce()
#Do whatever you want with that force here

It gets the force of the “last timestep”, so if you trigger the script with a collision sensor, it should get the force associated with that collision.

More info is here: http://www.blender.org/documentation/249PythonDoc/GE/GameTypes.KX_GameObject-class.html#getReactionForce

-Sam

Thanks, I knew about that one, but I’m not sure if it gives me enough information. Can blender tell me which vertices are qualified as in contact?

I don’t believe there’s any built in method… but I could be wrong.

You can definitely get the coordinate of the point of contact (getHitPosition() ) and possibly use that to calculate where it’s being hit?

Getting the point of contact between two objects would be good, in combination with the reaction force. But getHitPosition() finds where a ray hits, I noticed. I wouldn’t know how to use that to get the contact point.

Unfortunately you cannot do that yet :frowning: You cannot get the point of contact, only the object of contact. Neither can you get the force in a specific point, only for the whole object.

The bge api for bullets is very simple and doesn’t gives you too much access to the bullets API. This is one my biggest concern with the bge right now… so many things I wanted to mess around on the physics engine, but I can’t :frowning: Oh well, maybe one day…

Thanks for the response, I thought as much.