Greater resolution per object

Discuss new features and future development.
Post Reply
markhula
Posts: 188
Joined: Wed Feb 02, 2011 4:23 am
Contact:

Greater resolution per object

Post by markhula »

Hi,

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! ;-)

Cheers
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Greater resolution per object

Post by slembcke »

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! -> http://howlingmoonsoftware.com/wordpress/
markhula
Posts: 188
Joined: Wed Feb 02, 2011 4:23 am
Contact:

Re: Greater resolution per object

Post by markhula »

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.

Cheers
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests