StaticGroup Flexibility
Posted: Fri Jul 03, 2015 2:51 am
Hi Norbo,
Currently it seems that StaticGroup does not support individual settings for each ConvexCollidable shape. For example, it does not allow some pieces to have it's own event callbacks or collision rule.
I am trying to find the best way to implement around 500 static NoSolver objects on the map that is only used for triggering events when colliding with player.
I am currently using CompoundBody to have 500 objects on the map. Putting bunch of static objects in a CompoundBody seems to preform a lot better than objects having each its own separate Entity. However, there seems to be a strange overhead when a player collides with a static NoSolver child of the compoundBody. Whenever a player stands within a NoSolver child or make contacts, on mobile phone that alone increases physic time by almost 1 millisecond!
When ever a player makes contact with the child, the child's collisionRules changes to NobroadPhase. Even If the child's collision is set to NobroadPhase, when ever the player stands within the child, there is still a spike. As soon as the player moves out, there is a big drop in physics time. There seems to be a correlation with how many child the CompoudBody has and the increase in physics time. Btw, I am running only single thread.
So I was hoping maybe StaticGroup could solve that, but it seems StaticGroup acts as a solid Entity. Was it was because of performance to have StaticGroup to be implemented in this way? Also, what do you think would be best performance wise to have lots of Static NoSolver objects on map that is only used to trigger events. This is really important in games as it uses triggers for lots of things such as picking up coins and interacting.
Thanks in advance!
Currently it seems that StaticGroup does not support individual settings for each ConvexCollidable shape. For example, it does not allow some pieces to have it's own event callbacks or collision rule.
I am trying to find the best way to implement around 500 static NoSolver objects on the map that is only used for triggering events when colliding with player.
I am currently using CompoundBody to have 500 objects on the map. Putting bunch of static objects in a CompoundBody seems to preform a lot better than objects having each its own separate Entity. However, there seems to be a strange overhead when a player collides with a static NoSolver child of the compoundBody. Whenever a player stands within a NoSolver child or make contacts, on mobile phone that alone increases physic time by almost 1 millisecond!
When ever a player makes contact with the child, the child's collisionRules changes to NobroadPhase. Even If the child's collision is set to NobroadPhase, when ever the player stands within the child, there is still a spike. As soon as the player moves out, there is a big drop in physics time. There seems to be a correlation with how many child the CompoudBody has and the increase in physics time. Btw, I am running only single thread.
So I was hoping maybe StaticGroup could solve that, but it seems StaticGroup acts as a solid Entity. Was it was because of performance to have StaticGroup to be implemented in this way? Also, what do you think would be best performance wise to have lots of Static NoSolver objects on map that is only used to trigger events. This is really important in games as it uses triggers for lots of things such as picking up coins and interacting.
Thanks in advance!