Hi,
I am trying to create custom shapes.
To define my points, I used physics editor to create a list of points.
Result is here : .
Here below my 8 points :
((-1, 6), (5, 0), (58, 0), (63, 6), (63, 58), (58, 63), (5, 63), (0, 58))
Looks great except that I then lose collision detection as opposed to the below more "standard" shape :
((-32, -32), (-32, 32), (32, 32), (32, -32)).
How can i draw custom shapes while keeping collision detection?
Some extra details :
I am using an old chipmunk version (5.3.1) with these api's : cpbodynew,cpPolyShapeNew and cpSpaceAddStaticShape.
Bodies are rogue bodies (i.e not added to my space).
Regards,
Erwan
custom shapes
-
- Posts: 145
- Joined: Tue Mar 04, 2008 2:21 am
- Contact:
Re: custom shapes
Try this one:
From the Documentation
Boxes:
....Adding a small radius will bevel the corners and can significantly reduce problems where the box gets stuck on seams in your geometry ...
cpShape *cpBoxShapeNew(cpBody *body, cpFloat width, cpFloat height, cpFloat radius)
From the Documentation
Boxes:
....Adding a small radius will bevel the corners and can significantly reduce problems where the box gets stuck on seams in your geometry ...
cpShape *cpBoxShapeNew(cpBody *body, cpFloat width, cpFloat height, cpFloat radius)
Chipmunk4PB: The fastest way to write games together with PureBasic and the Chipmunk physics engine.
-
- Posts: 2
- Joined: Tue Aug 15, 2017 11:14 am
- Contact:
Re: custom shapes
Thanks for this feedback.aisman wrote:Try this one:
From the Documentation
Boxes:
....Adding a small radius will bevel the corners and can significantly reduce problems where the box gets stuck on seams in your geometry ...
cpShape *cpBoxShapeNew(cpBody *body, cpFloat width, cpFloat height, cpFloat radius)
My wrapper does not seem to have the radius argument.
function cpBoxShapeNew( body : PcpBody; width : cpFloat; height : cpFloat ) : PcpShape; cdecl;{$IFDEF USE_CHIPMUNK_LINK} external libChipmunk; {$ELSE} external; {$ENDIF}
I need to check the doc for 5.3.2 : either this version did not have yet this option or the wrapper I use skipped this parameter.
Who is online
Users browsing this forum: No registered users and 2 guests