Custom Physics Bodies Clockwise??

Hi everyone,

I am making some custom physics bodies for my app which is in Landscape mode. All The documentation on the site says to put the points in clockwise order. Mine only work when I enter them in counter-clockwise. Even the points in the documentation seem to be counter-clockwise even though they say clockwise. Here is the link
http://developer.anscamobile.com/content/game-edition-physics-bodies

scroll until you see

"squareShape = { -20,-10, 20,-10, 20,10, -20,10 }

The maximum number of points (and therefore edges) allowed per collision shape is eight. Once defined, a shape definition can be re-used multiple times.

Note that these polygon coordinates must be defined in clockwise order, and the resulting shape must be convex-only."

**Maybe I am missing something but when I plot those points in that order its going in counter-clockwise motion. I am guessing the docs are correct and I am doing something wrong but thought I would ask.

Thanks. [import]uid: 39370 topic_id: 12427 reply_id: 312427[/import]

well actually points you are giving are in clock wise say for example you have square of 40 pixel width and 20 pixel height at the (50,60) position so now { -20,-10, 20,-10, 20,10, -20,10 } means first for -20,-10

first point will be 50-20 = 30 and 60-20 = 50 so first point is at (30,50)

similarly second will be at (70,50)

third will be at 70,70

and fourth at 30,50

now you can see they are in clock wise

if still you are confused i recommend to use physicseditor

:slight_smile: [import]uid: 12482 topic_id: 12427 reply_id: 45354[/import]

Thanks for the quick reply. I may end up using physics editor but I would like to understand this. When I plot the new points of
(30,50) (70,50)(70,70)(30,70) They still seem to be going counter clockwise. [import]uid: 39370 topic_id: 12427 reply_id: 45404[/import]

(30,50) (70,50)(70,70)(30,70)

this points are clock wise try giving this and see effect

{ -20,10, 20,10, 20,-10, -20,-10 } [import]uid: 12482 topic_id: 12427 reply_id: 45405[/import]

Hmm sorry to be a pest about this. I guess I am just not seeing it. On paper when I start at 0,0 and go (over 30 and up 50),(over 70 and up 50), (over 70 and up 70) then (over 30 and up 70) then draw a line connecting then its going in a counter clockwise motion. sorry again for dwelling on this. [import]uid: 39370 topic_id: 12427 reply_id: 45408[/import]

Incase anyone else is confused by this I commented on the main physics bodies page and they are going to fix it to say
counter clockwise - here is the link—scroll to the bottom of the comments.

https://developer.anscamobile.com/content/game-edition-physics-bodies

[import]uid: 39370 topic_id: 12427 reply_id: 45449[/import]

|------------------------------ |0,0 10,0 | | | |0,10 10,10 | [import]uid: 75783 topic_id: 12427 reply_id: 45530[/import]

great

:slight_smile: [import]uid: 12482 topic_id: 12427 reply_id: 45566[/import]