A few questions

n1000

29-01-2007 18:55:28

Excellent work on nxOgre! It's made my job a lot easier. I have a few questions about the usage.

1) Let's say I have a room with 100 objects on the ground. I want to render an explosion in the middle of the room and I want to apply some force from the origin of the explosion and have it affect any objects within a certain range. How could I achieve this? Do I have to somehow determine which objects are within some predetermined distance from the center of the explosion and then calculate the direction of the force relative to that object? Then apply a force? I was kind of hoping there might be an easier way than this.

2) If I have a room with several object and I reverse the gravity, not all of the objects will float to the ceiling. Some will, but others will not and there doesn't seem to be a pattern. This also works in reverse. After everything floats to the ceiling and I reverse the gravity again, some things are stuck and the rest fall back to the floor. I create all the objects the same. Is this normal?

3) I keep reading a lot about the "car prefab" but I can't seem to find any information on it. What exactly is a "prefab" (I'm assuming it's some type of template?), and where could I find this? I'm trying to find an easy way to get a simple vehicle in my application.

betajaen

29-01-2007 19:21:15

1. I expect there is an addForce function specific to this, but I would assume you calculate the vector of the force from the center to the body then multiply it by the strength (it being stronger closer to the explosion center).

2. Pretty much. It seems like the bodies are sleeping, as you said its a pattern. Just loop through all the bodies and wake them up.

3. Prefabs are in the old code. I took them out (for a number of reasons) so the closest you'd get to a car prefab is the wheel system that is upcoming in the next release.