As the topic states, is it possible?
I am trying to create a code to load a editor saved scene, but i am wondering if it would be possible to reload the collision flags and camera groups, since two scenes can have completely different groups and flags.
Thanks in advance.
Comments
For the collision flags, you can reset them or modify them at will. You don't need to add them manually, if a flag isn't found, it'll be added on the fly.
If you want to clear all the current flags, you can simply do:
However if you still have bodies alive somewhere, their collision values will remain as they were, and if you re-add former flags, they might not have the same value as before (it depends on the order they're added).
As for the groups, you can call orxCamera_AddGroupID()/orxCamera_RemoveGroupID() if you need to make any change at runtime. Does it answer your question or did you think of something different?
My intent is to provide a code that will load scenes, which would mean I would need to reload the collision flags and the camera groups. I believe I can assume the caller will clear his/her former objects and load the new ones after the load scene.
From the API:
orxCamera_AddGroupID (orxCAMERA *_pstCamera, orxU32 _u32GroupID, orxBOOL _bAddFirst)
What would this group ID be? I would assume it is a hash created by the name, but how is this value generated?
I couldn't find how to add the collision flags.
Could I just call:
orxConfig_SetString(orxPHYSICS_KZ_CONFIG_COLLISION_FLAG_LIST, "hero#scenario");
And reset the physics module? Would that have any side effects?
Thanks in advance.
Basically, when switching to a new scene, you need to clear all camera group IDs and add the new ones, or, if that's easier, simply delete the old camera and create the new one with the flags already set in config.
For the collision flags, all you need to do is clean the current list. There's no need to provide a list: every time a query will be made with a collision name that's not known, it'll get added automatically to the list and a value assigned to it.
Just wondering, is there any reason the CollisionFlagList parameter even exists then, if it is automatically created?
PS: by the way, it is not listed on the wiki.
The list is optional: one could use it if one needs to get fixed values for the flags themselves (ie. to work with another system that would have fixed values not coming from orx, for example).
I assume that in most cases it's not going to be used though and can safely be ignored.
If you get a moment, are you able to wack it in the wiki? Assume it's a setting that exists in a stable release, otherwise it's best to redirect them to the development instructions on bitbucket.
It is on the CreationTemplane.ini of the version 1.5, so I believe it on the stable:
Ah yep. The wiki isn't linked to your forum account so you'll need to make an account there. Then you should be right to go. Iarwain might have to approve the account though?