Yes, you can modify the collision flags (& check mask) of parts using orxBody_SetPartSelfFlags/orxBody_SetPartCheckMask.
You can translate collision flags between their literal version and their numeral version using orxPhysics_GetCollisionFlagName/orxPhysics_GetCollisionFlagValue.
The orxPhysics_GetCollisionFlagValue is not at the API DOC, but I did found it in the headers, still, how do I use it? It needs a name, where does this name comes from?
If the literal values are unknown, a new numerical value will be assigned to it (keep in mind there can be only 16 totals as that's the limit for collision flags in Box2D).
If you want to make sure that the same literal flag will have the same value all the time (as opposed to have a value attributed at runtime depending on the order of their creation), you can specify them in config:
That list will expand at runtime if new flags are found/added.
The orxPhysics_GetCollisionFlagValue is not at the API DOC, but I did found it in the headers, still, how do I use it? It needs a name, where does this name comes from?
Well, it should be in the API doc you have locally in orx/doc/html/index.html. That version is automatically updated every time a header is modified. (You can track it here: http://buildbot.orx-project.org:8010/waterfall)
The online version only matches what's in the last release.
Comments
You can translate collision flags between their literal version and their numeral version using orxPhysics_GetCollisionFlagName/orxPhysics_GetCollisionFlagValue.
Lemme know if you have any other issue.
I had no idea of the existance of this macro orxOBJECT_GET_STRUCTURE, it is really handful.
Just wondering, is there any way I can set the collision flags in the ini file that is not numeric.
Something like:
[Physics]
Gravity = (0, 981, 0)
DimensionRatio = 0.01
ArrowFlag = 0x0001
GroundFlag = 0x0002 ; Declaring flags here
MonsterFlag = 0x0008
[ArrowBodyHead]
Type = mesh
VertexList = (6, 2, 0) # (6, -4, 0) # (12, -1, 0)
SelfFlags = ArrowFlag
CheckMask = GroundFlag | MonsterFlag
Solid = true
The orxPhysics_GetCollisionFlagValue is not at the API DOC, but I did found it in the headers, still, how do I use it? It needs a name, where does this name comes from?
Yes, it's quite handy to obtain any component attached to an orxOBJECT.
Yes! That is one of the few features that got added since the last release.
You can simply specify the names in a list:
If the literal values are unknown, a new numerical value will be assigned to it (keep in mind there can be only 16 totals as that's the limit for collision flags in Box2D).
If you want to make sure that the same literal flag will have the same value all the time (as opposed to have a value attributed at runtime depending on the order of their creation), you can specify them in config: That list will expand at runtime if new flags are found/added.
Well, it should be in the API doc you have locally in orx/doc/html/index.html. That version is automatically updated every time a header is modified. (You can track it here: http://buildbot.orx-project.org:8010/waterfall)
The online version only matches what's in the last release.
I got it working now with the ini file now, it is really great that I no longer have anything hard-coded in the code and in the ini files anymore.
Thanks a lot.
glad it works.