Resizing objects

Official forum for the Chipmunk2D Physics Library.
Post Reply
reizencroft
Posts: 5
Joined: Mon Sep 08, 2008 4:46 am
Contact:

Resizing objects

Post by reizencroft »

Need help on resizing an object.

Basically I have a ball which have a radius that varies according to its y position. What's the correct way of resizing it?

I had little success in doing this. But when I add line segments to the collision space, it crashes. It crashes on the function cpShapeCacheBB and the shape was the circle.

Any help would be greatly appreciated.

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

Re: Resizing objects

Post by slembcke »

Chipmunk does not support resizing or changing the shape of objects on the fly.

You can do it by deleting and re-adding a new shape, but it will not act like real physics.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
reizencroft
Posts: 5
Joined: Mon Sep 08, 2008 4:46 am
Contact:

Re: Resizing objects

Post by reizencroft »

Actually, that was what I've been doing. But when I add line segments to the space, it crashes on the function cpShapeCacheBB .
what could be causing this?
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Resizing objects

Post by slembcke »

The cpShapeCacheBB() crash would probably be due to a bad shape pointer, or a shape that you freed without removing from the space.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
reizencroft
Posts: 5
Joined: Mon Sep 08, 2008 4:46 am
Contact:

Re: Resizing objects

Post by reizencroft »

Thanks. Yup your right. I wasn't removing the shape from space before freeing it.

Thanks a bunch.
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests