Replay and initialization

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Replay and initialization

Postby Cannos » Tue Mar 30, 2010 3:18 pm

I am trying to implement replays of physics and I must not have something initialized properly, but I'm not sure what it could be. Here's what I'm seeing...If I start my application and replay 5 times (recreating the entire Newton world between each replay), my end results are different each time. However, if I restart the application again and replay another 5 times, I get the same set of five results.

Start->Replay 1->Replay 2->Replay 3->Replay 4->Replay 5
Restart->Replay 6->Replay 7->Replay 8->Replay 9->Replay 10

So 1-5 are all different, but 1==6, 2==7, 3==8, 4==9, 5==10, and so on. So at application startup my conditions must be consistent, but something isn't getting reset between replays. I use the same world init function from startup as I do between replays, and it completely recreates the world and invalidates the cache. To narrow down the problem my NewtonUpdate time doesn't match my simulation time, it is just a consistent 60hz so that shouldn't be a factor.

Any tips on what this might be or what I should try to figure out the issue? Thanks.
Cannos
 
Posts: 129
Joined: Thu Mar 04, 2010 5:41 pm

Re: Replay and initialization

Postby Julio Jerez » Tue Mar 30, 2010 4:29 pm

you need to use Invalidate cache to se a start point.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Replay and initialization

Postby Cannos » Tue Mar 30, 2010 4:41 pm

I'm currently calling NewtonInvalidateCache when I create the world each replay. Is there something else I need to do?
Cannos
 
Posts: 129
Joined: Thu Mar 04, 2010 5:41 pm

Re: Replay and initialization

Postby Cannos » Tue Mar 30, 2010 7:34 pm

False alarm. Nothing to see here. It was an initialization problem I had, where I wasn't clearing out some of the tris in my tree collision between replays. All is good now. Thanks.
Cannos
 
Posts: 129
Joined: Thu Mar 04, 2010 5:41 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron