Create a shockwave

Sorry for another topic, but I really need help. How can I create a shockwave by a point. It needs to push all the others nodes away. Can someone tell me the function or maybe a example file from the source. Thanks.

what do you use, jmephysics ?

I'm using jme-bullet. (:

pseudo-code:

thing.applyImpulse(thing.localTranslation.substract(explosion.localTranslation).normalize()*force)


You create a vector from the explosion to the thing to get the direction of the force and then apply that as an impulse to the thing.

I need to do that for every node?

GustavoBorba said:

I need to do that for every node?

yes

Compiler says:



"operator * cannot be applied to com.jme.math.Vector3f,int".



What happened?

GustavoBorba said:

Compiler says:
"operator * cannot be applied to com.jme.math.Vector3f,int".
What happened?

What happened is you tried to apply the multiply operator to an object and an int :/
My pseudo-code was almost correct, use methods instead of operators.

Yeah, but with all that code you are passing only one Vector3f value. applyImpulse needs 2 Vector3f values. What should I insert in the second one? And what the second would represent?

Its pseudo-code, meaning its not correct code but just the basic idea of it…

The first parameter of applyImpulse() is the impulse (the vector you compute) and the second the local position on the object where you apply it, so probably Vector3f.ZERO in your case.

Ok, last question, why "In my case"?

because you want to apply the force to the center of the things. if you would apply the force to the bottom of the thing it would spin around and it would not look as if the shockwave hit it but as if the carpet was pulled away under it…

Oooh, thanks for all normen. (:

GustavoBorba said:

Oooh, thanks for all normen. (:

np, but I would be really hurt if you disappear from the forum without posting a video of your fabulous nuclear missile :P
normen said:

GustavoBorba said:

Oooh, thanks for all normen. (:

np, but I would be really hurt if you disappear from the forum without posting a video of your fabulous nuclear missile :P


And making a tutorial about it in the wiki!

haha. Thank you guys. I might post a video BETA brute version(Whitout the details, like, missile 3d model, logo, main menu) of this app. It still under development, and it's called prjNukeIt (Project Nuke It).