Runtime error when implementing a tutorial

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Runtime error when implementing a tutorial

Postby patokun » Sat Sep 17, 2011 4:46 pm

Hello all!
I'm trying to get NGD to work in Irrlicht using this http://www.newtondynamics.com/wiki/inde ... Tutorial#1 , but I'm having a bit of a trouble since I'm using NGD version 2.33

I altered
Code: Select all
nWorld = NewtonCreate (NULL, NULL);

to
Code: Select all
nWorld = NewtonCreate ();


However I do not seem to know what I should add as an argument to NewtonCreateBox and NewtonCreateBody, as the tutorial didn't take into consideration the "const dFloat *offsetMatrix" as it wasn't in version 1.5 and I'm using version 2.33.
I tried sending NULL but that caused the application to crash.

I also tried adding an offset as follows:
Code: Select all
dMatrix offset (GetIdentityMatrix());
   collision = NewtonCreateBox(nWorld, 0, 0, 0, NULL,&offset[0][0]);


However this is causing another runtime crash, and when I debug it shows me that it happened at this line:

Code: Select all
boxNode->setPosition(mat.getTranslation());


So I'm assuming I'm filling out the offset matrix in the preceding functions wrong? If so, any advice on how to proceed?

Thank you.
patokun
 

Re: Runtime error when implementing a tutorial

Postby JoeJ » Sun Sep 18, 2011 4:16 pm

try giving the box a size:

collision = NewtonCreateBox(nWorld, sizeX, sizeY, sizeZ, NULL,&offset[0][0]);
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron