Page 1 of 1

Massless entity performance?

Posted: Mon Jan 06, 2014 2:29 pm
by chebob69
You'll have to excuse me for the vagueness of the question but I don't suppose you could give a kind of brief explanation for how massless static objects affect performance.

In particular,

1) how does the number of massless entities affect performance vs entities with mass?
2) are there any issues with 'teleporting' (as I believe you've called it) massless entities when it comes to performance?

Thanks

Re: Massless entity performance?

Posted: Mon Jan 06, 2014 6:24 pm
by Norbo
1) how does the number of massless entities affect performance vs entities with mass?
An unmoving kinematic entity in isolation is very cheap. It's roughly equivalent to a sleeping dynamic object. The primary cost at that point is broad phase management.

A moving kinematic entity in isolation is pretty much identical to a moving dynamic entity in terms of performance.

A more direct measurement of simulation complexity and performance would be the number of active (nonsleeping) collisions and constraints. 10000 objects with 2000 active physical interactions will faster than 2000 objects with 10000 active physical interactions.
2) are there any issues with 'teleporting' (as I believe you've called it) massless entities when it comes to performance?
Nope. Teleporting entities by setting their position and orientation is just a problem because it prevents constraints from solving correctly since the velocity no longer matches the motion. Constraints have to fall back on the 'squishy' position correction alone in that case.

A long distance teleport could make the broad phase undergo a significant rebuild which could cause a frame spike, but that's the case for dynamic objects too.

Re: Massless entity performance?

Posted: Wed Jan 08, 2014 3:02 pm
by chebob69
Norbo wrote:Nope. Teleporting entities by setting their position and orientation is just a problem because it prevents constraints from solving correctly since the velocity no longer matches the motion. Constraints have to fall back on the 'squishy' position correction alone in that case.
I'm confused :-\ I was asking if it was a problem. You said nope but then explained why it was!? Were you referring to dynamic entities being problematic with teleporting?

Thanks

Re: Massless entity performance?

Posted: Wed Jan 08, 2014 6:20 pm
by Norbo
The "nope" referred to the specific question "are there any issues with 'teleporting' massless entities when it comes to performance?". Teleporting doesn't affect performance in any significant way by itself.

Teleporting causes behavioral issues for constraint solving (collision response, hinges, all the rest) because the velocity of the object no longer matches the motion of the object, and an object will gladly teleport inside another object if told to do so.

Re: Massless entity performance?

Posted: Wed Jan 08, 2014 6:24 pm
by chebob69
Aha, I didn't distinguish between performance and behaviour. Thanks for the consistently encyclopaedic responses!