beyond-all-reason / spring

A powerful free cross-platform RTS game engine
https://beyond-all-reason.github.io/spring/
Other
199 stars 98 forks source link

Add support for ellipsoid shields #1655

Open WatchTheFort opened 3 weeks ago

WatchTheFort commented 3 weeks ago

Currently, only spherical shields are supported. This leads to unwanted interactions between shields and bombers, where either the shield needs to have a tiny radius, or the bomber very high cruising altitude. Unfortunately, adjusting either of these will upset balance in other areas.

One possible workaround is to lower the shield in the y-axis and increase its radius, so that the portion above the ground is ellipsoid-like. However, this will create enormous unintended shielded areas if the shield generator is built at the top of a cliff or mountain.

Ellipsoid collision volumes are already supported, is it possible to extend this functionality to shields? The desire is only for a subset of ellipsoids - spheroids where x-axis = z-axis.

sprunk commented 3 weeks ago

Unit volumes can already be an ellipsoid, also a box or a cylinder. So from a mechanics PoV these should be easy to adapt for shields. But:

WatchTheFort commented 3 weeks ago

Isn't reflection done by considering a plane tangent to the surface at the point of impact, and having the angle of reflection equal to the angle of incidence?

sprunk commented 3 weeks ago

No