# jME-Physics 2 static vs dynamic and the thousand piece building

Hey Irrisor, I've got a few questions about your physics engine.  Right now I want to make a game that can do a number of things and I'm not sure if jME-Physics 2 is the tool I need.

1. I'd like to be able to add things like gravity effects that are localized. For example, imagine that there is a room with a complete 3d map of our solar system in it. You can watch the planets orbit the Sun and if you run up to the Sun it'll suck you in and annihilate you. Or you could run to the side of it and start orbiting yourself. I thought one way to do this would be to have some kind of collision detection sphere around the sun that would detect things under its influence. Then on every update (and then every detected collision) we could add the proper forces to everything. The only problem is this seems like a rather clunky and poor way to use collision detection to effect all my entities. Would there be a better/other way to do this?

2. What is the difference between a static/dynamic node? Does a static node simply never move under a force? :?

3. What kind of processing does a static node need? Can I place one static node on top of another without having them constantly generating collisions? Can I have a couple thousand static nodes in a scene and still run it on a reasonable machine?

4. One of the things I want to do is create large buildings that would consist of possibly thousands of individual blocks (kinda like legos!). I was hoping to avoid having to do complex stuff to merge collision boxes and/or meshes (to keep each block from constantly colliding with the one on top of it, etc). Is there any reasonable way to do this?

Wow, I guess I've got a lot of questions…  XD hope you don't mind!
1. using collision and apply forces according to the area seems fine to me
2. yes, static nodes simply don't move
3. updating: only updating the position if they are changed in the scenegraph (by the app). collisions: currently only moving nodes collide with other nodes (dynamic and static). thousands of nodes: yes
4. reasonable way: sure - already implemented in jME Physics 2: no

Thanks for all the info irrisor! After thinking about it I believe I'm cool on 1,2,4.  8) However, about updating and collisions…

Just to make sure I understand perfectly… If I were to create 2 static boxes that touched each other there would be no collision, since they aren't "moving" nodes? Meaning basically only a dynamic node can ever generate a collision? Also, would moving a static node manually cause a collision (if it DID actually stop right against something else)?

Oh yes, and do you intend to implement the merging of collision geometries in the future (like, a year or so from now type of future)?

By the way, I don't know if you get this a lot, but jME physics 2 is amazingly useful and really rocks!

Daedalus said:

Just to make sure I understand perfectly... If I were to create 2 static boxes that touched each other there would be no collision, since they aren't "moving" nodes?

yes
Also, would moving a static node manually cause a collision (if it DID actually stop right against something else)?

no (detecting that collision would be possible, but jME Physics simply does not do it)

Oh yes, and do you intend to implement the merging of collision geometries in the future (like, a year or so from now type of future)?

no plans to do that, no - but who knows

By the way, I don't know if you get this a lot, but jME physics 2 is amazingly useful and really rocks! :D

cool :)

Thanks for all your help irrisor. I appreciate it! By the way, I noticed that in PhysicsSpace the createBox/createSphere methods are declared "protected", while other createSomeObject methods are public. Is this accidental?

yes that was accidental, fixed in cvs - thanks