questions from the tutorial

juliusctw

29-04-2007 07:42:58

Hello
after reading several of the tutorial i made a small list of questions I couldn't find answers to even in the API or search.

1). I'm not sure exactly what the purpose of this is for

setPositionOrientation( pos, camorient );

when you attach to Node, doesn't the body just automatically hold the same position as the Node? or is it setting the relative position to the parent Node? As for the orientation, are you tryin to match the orientation of the body to the orientation of the entity?

2) How is the world size originally defined ? I know that you can set the size , but what is the default size ? I noticed that in the tutorial certain areas the physics would stop working, is that when the objects have gone outsize the world size?

3) does freeze have the same effect as not updating the world? but on a single object in the world?

JackyE

29-04-2007 22:35:29

I've been using OgreNewt for only a few month, so forgive any mistake:

1) To reposition an object. Normally you would have to do by applying forces, to avoid weird physics. But this can be helpfull for example with a "teleporter", or resetting the world without rebuilding you Ogre scene graph

2) The size can be found in the Newton Documents (big html file, found in the newtonSDK)


NewtonSetWorldSize
void NewtonSetWorldSize(
const NewtonWorld* newtonWorld,
const dFloat* minPtr,
const dFloat* maxPtr)
Set the size of the Newton world.

Parameters


const NewtonWorld *newtonWorld - is the pointer to the Newton world
const dFloat *minPtr - is the minimum point of the world bounding box
const dFloat *maxPtr - is the maximum point of the world bounding box


Return
Nothing.

Remarks
The Newton world must have a finite size. The size of the world is set to a box +- 100 units in all three dimensions at creation time and after a call to the function NewtonRemoveAllBodies


Default: 100x100x100

If an object is outside the defined area, it is ignored from the simulation. Sort of a speedup.

3) Freeze works on objects. It's another important speedup. Works as follows:

If an object hasn't moved in a while, it becomes frozen (unless you disable this functionallity = bad idea). Frozen objects don't get calculated, so less CPU is needed. If you want to move a frozen object again, unFreeze it first.