Report any bugs here and we'll post fixes
Moderators: Sascha Willems, Thomas
by TheDushan » Mon Dec 05, 2011 9:05 am
Hello guys.
I am expiring one problem after updating code from Newton 2.00 to latest from svn. [rev.r1155].
While my application is working on Newton 2.00 after updating it to latest revision from svn.
I am experiencing some problem, and I don't know is that Newton problem or problem with my code.
Am I using [coreLibrary_200].
I have uploaded two photos of my problems.
Thanks
- Attachments
-
- newton dynamics problem 2.jpg (45.13 KiB) Viewed 3407 times
-
- newton dynamics problem 1.jpg (47.91 KiB) Viewed 3407 times
-
TheDushan
-
- Posts: 3
- Joined: Sun Dec 04, 2011 6:43 pm
by Julio Jerez » Mon Dec 05, 2011 9:47 am
you are not releasing the collisions afte you asigne then to a body
-
Julio Jerez
- Moderator
-
- Posts: 12249
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by JoeJ » Mon Dec 05, 2011 10:27 am
I had the same as in screenshot #1 after the update.
The app worked, but when closing it i got the same error msg.
When starting to play around with newton i was too lazy to care about proper deallocation.
Adding this 2 lines to my world object destructor solved it for me:
NewtonDestroyAllBodies (world);
NewtonDestroy (world);
The more dense error checking in actual newton is a good thing, as it helps to find your own mistakes.
You'll be warned if you generate NaNs, for example.
-
JoeJ
-
- Posts: 1453
- Joined: Tue Dec 21, 2010 6:18 pm
by JoeJ » Tue Dec 06, 2011 7:29 am
Hi Dushan, i've got your PM.
It seems in CMod_PhysicsAddEntity(sharedEntity_t * gEnt) you are not realeasing the collision, like you do correctly at generation of the static bsp model. Or is the release elsewhere?
Two other things i've found:
You call NewtonCreateBody (something, something, NULL)
If i use NULL in my app, i get a crash. Use the transformation matrix at creation instead.
Most important: It seems you use the timestep for newton based on fps. This is bad, as it needs a fixed timestep.
In practice, you should make steps at 60 Hz, and interpolate between actual and previous physical states for the rendering.
-
JoeJ
-
- Posts: 1453
- Joined: Tue Dec 21, 2010 6:18 pm
Return to Bugs and Fixes
Who is online
Users browsing this forum: No registered users and 11 guests