Recently I’ve been figuring out collisions for my space stations and at first I was messing around with hull and box coliders which gave me shit performance for the accuracy I was getting no matter what I did.
Then I realised I could just make the station static-ish and give it a static mesh shape collider. For the hell of it I just threw the entire mesh at the engine to see it explode, but to my huge surprise the thing handled dead precise collision with no performance loss no matter how complex dynamic I collided with it.
It’s quite amazing how well it works, but it got me wondering how are then the dynamic collisions so many magnitudes worse in performance?
I mean as long as you are only colliding a dynamic against a static both appear to be able to move and rotate freely with no performance loss and I can’t really see why that wouldn’t work for all shapes.
But no, make a complex dynamic and everybody looses their minds!
Anyway, I’m interested in how this is handled in the background if any of you know and wouldn’t mind explaining or if you have any links to places that do have the info.
I guess I could just go read JBullet docs but I bet this is explained in a great way somewhere on da internetz and no harm in asking first, right?
It works so well I can actually stick the front of a ship through the station trusses, attach a few modules so it’s stuck there and then plow space with it without any fps loss. All I haven’t been this pleased in months.
Moving a static mesh is like magically teleporting something into the scene, bullet probably detects the overlapping objects and the resolver pushes them apart. In effect you get some form of collision detection/overlap handling but no real physics simulation at all. I’d be suprised if you could realistically bounce objects off ‘teleporting’ static meshes.
Well there is that one thing where if you crash into the station at very high speed the 1-2 front modules might clip inside it and the ship gets stuck. I’m fairly certain I can fix that in the collision listener or make you slow down for some reason.