Greater resolution per object

Discuss new features and future development.

Greater resolution per object

Postby markhula » Fri Feb 25, 2011 3:56 am


Not sure what I am asking is even possible but here goes.
One main problem with chipmunk (and indeed all physics engines to some extent) is that visually an object can potentially intersect another.
This can be reduced my calling cpspacestep more frequently.
Would it not be possible to have this but on a per body basis?
i.e. I don't care that the baddie might 'bump' off a wall but the player character is the centre of focus and therefore it is noticeable if it happens to that body.
I appreciate this may be either completely non-trivial or simply not possible to have 1 body within the simulated space 'correct itself' with a different time step than the others.

just a thought! ;-)

Posts: 188
Joined: Wed Feb 02, 2011 4:23 am

Re: Greater resolution per object

Postby slembcke » Fri Feb 25, 2011 11:07 am

My first reaction was, "No, not really," but there is actually a bit of merit to that. Though it's not a, "Great, will it be done in a week then?" sort of feature, but an "Great, will it be done in a year" sort of feature.

Chipmunk sleeping algorithm works by grouping objects that are connected. So if you had 3 piles of boxes, each pile would be in a group. Because each group is completely separate, they can be simulated separately without affecting objects in other groups. This would allow you to set the iteration count and maximum timestep on a per body basis. I'll have to think about this, but like I said. Definitely not an easy or quick thing to implement.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! ->
User avatar
Site Admin
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Greater resolution per object

Postby markhula » Sun Feb 27, 2011 5:24 am

Man, that would be so cool!

I guess what I am asking is to do:

int steps = 2;
cpFloat dt = 1.0f/60.0f/(cpFloat)steps;

for(int i=0; i<steps; i++){
cpSpaceStep(space, dt);

on a per body basis and not the whole simulation.
I wasn't sure if it was a good or even sensible suggestion; but I am glad it is. I am really beginning to love Chipmunk.

Posts: 188
Joined: Wed Feb 02, 2011 4:23 am

Return to Features/Development

Who is online

Users browsing this forum: No registered users and 1 guest