A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in '5.5 Beta' started by MrEsquire, Sep 27, 2016.
Has it be included already? or in a beta to come?
Already in. It's listed under Improvements in the release notes.
Can we get articulations exposed in Unity 5.5 at some point?
yes please add articulations..
Will we ever get PhysX Raycast Batched queries support?
It's unlikely articulations would be featured in 5.5, but I think there's no way around of exposing that stuff eventually. We've experimented with articulations last hackweek so there is a branch with some preliminary exposure but it's not publicly available yet. I think the video should be available on the web.
Yes, there are discussions going on about introducing something that would allow batching & running all physics queries multithreaded.
I have a question regarding the PhysX behaviour with overlapping bodies. I just tested 5.5.0b5 with a scene that instantiates cubes with kinematic RigidBodies and moves & rotates them on Update by setting RigidBody.position and RigidBody.rotation. All collisions are disabled in the physics settings and the cubes have BoxColliders set to trigger.
If I spawn 500 cubes in a 25 unit radius with colliders on, all is fine:
500 cubes in a 1 unit radius with colliders enabled results in horrible performance:
500 cubes in a 1 unit radius with colliders disabled is better but still bad:
So what's going on there internally? Obviously overlapping bodies (and especially colliders) cause a performance degradation, even if I they are kinematic and not colliding with anything, but is that something that can be fixed?
Imagine something like Crimsonland ( https://i.ytimg.com/vi/ogVvf8-pXDU/maxresdefault.jpg ) where I want to have a thousand enemies on the screen at once and I only want to use the Physics engine to raycast against hitboxes. How do I optimize for this case or am I better off rolling a custom solution with spatial hashing and collider checks? I'd just assume that PhysX would already do it more efficiently than I can with C# code, but I can't figure out the best way to do it.
I'm just guessing here that internally the physics engine resolves 500*500 collisions before checking the layers. So if that's the case, my question is would it be possible to have a raycast only collider, that is only ever checked against raycasts and completely ignored otherwise?
Your cubes have two colliders. Is it intended?
Whoops, it sure wasn't! So basically the so called "colliders disabled" is the cubes overlapping with one collider, which is still much slower than the cubes being apart or colliders disabled. Trigger or not doesn't matter and neither does having all layer collisions disabled. It's still something that I'm interested in optimizing.
Maybe @yant could provide some insight on what's happening internally and why and whether it would be possible to have some sort of a "raycast only collider" that would skip whatever is happening?
Well, in case anyone was wondering, the best solution is to not use a Rigidbody at all and move the colliders via Transform.position, in case you just want to use colliders for raycasting and don't need any collisions by the physics engine.