This project is read-only.

adding physics to a static node

Oct 19, 2011 at 3:12 AM

so i added a Transform Node with a geometry node child to the scene (not attached to a marker Node) and i transform it however i need after i am done transforming it the user hits the spacebar key and i want a sphere to appear "on" it so i have another geometry node (sphere) and i add it to the Previous as a child and try and set an initial velocity and nothing happens. if i add the same node to a marker node the sphere appears and flys off. everything has been added to the physics engine any ideas?

Oct 19, 2011 at 10:52 PM

alright so after some more experimentation i found the root of the problem i think is with newton Physics in tutorial 5 (the simple physics with spheres) when you are spawning the spheres if they are spawned to far away physics do not seem to effect them ie

 

  pileTrans.Translation = new Vector3(2 * j + (float)rand.NextDouble()/5, 2*i + 5f + (i + 1) * 0.05f, 0 + 0.01f * i + (float)rand.NextDouble()/5);

is the initial vector for the translations but if we change it to 

  pileTrans.Translation = new Vector3(2 * j + (float)rand.NextDouble()/5, 2*i + 5f + (i + 1) * 0.05f,  -82 + 0.01f * i + (float)rand.NextDouble()/5);

then the pile just sits there and hovers as far as i can tell changing the z variable to around 81 is where it appears to cut off i am wondering how to make this range larger is it goblin or newton

adding to a marker node no matter the distance seems to still work thank you for your help

Coordinator
Oct 20, 2011 at 6:38 AM

check out the WorldSize property of NewtonPhysics.

Ohan

Oct 20, 2011 at 4:49 PM

when i try and change the size by 

            NewtonPhysics Physics = new NewtonPhysics();           

    Physics.UseBoundingBox = true;           

    Physics.WorldSize = new BoundingBox(new Vector3(-150,-150,-150),new Vector3(150,150,150));
            scene.PhysicsEngine = Physics;

 

every time i run i get 

'System.AccessViolationException' occurred in GoblinXNA.dll

Coordinator
Oct 21, 2011 at 2:07 AM

you need to call initialize method first

Ohan