Collision part literal names

17 views
Skip to first unread message

iarwain

unread,
Mar 26, 2013, 2:22:31 AM3/26/13
to orx...@googlegroups.com
Hey all,

A quick update regarding a small feature that got added a few months ago: literal names for collision parts.

Before, in config, for body parts, we used to declare something like:

[BallPart]
SelfFlags = 0x0001
CheckMask = 0x0003

[WallPart]
SelfFlags = 0x0002
CheckMask = 0x0001

This can get confusing (especially for people not familiar with flags and masks) and hard to read, so now this can be simplified in:

[BallPart]
SelfFlags = ball
CheckMask = ball # wall

[WallPart]
SelfFlags = wall
CheckMask = ball

This will result in the same behavior but is much more readable. The names used for the literals don't have to be defined anywhere else.

The API also allows to convert from numeral to literal and reciprocally at runtime with the functions orxPhysics_GetCollisionFlagName() and orxPhysics_GetCollisionFlagValue().

Cheers,

Rom

Gilles Zucchini

unread,
Mar 27, 2013, 6:55:17 AM3/27/13
to orx...@googlegroups.com
Hey !

That's nice ! I missed this one !

Thanks for the information !

Cheers,

Gilles.


2013/3/26 iarwain <iar...@orx-project.org>

--
You received this message because you are subscribed to the Google Groups "orx-dev" group.
To post to this group, send email to orx...@googlegroups.com.
Visit this group at http://groups.google.com/group/orx-dev?hl=en.
 
 

Reply all
Reply to author
Forward
0 new messages