Some of these are much more expensive than others, though I'm not sure why.
oof.
|
if (Physics.BoxCast(positionTip, vessel.vesselSize, -vessel.velocityD.normalized, out tipHit)) |
Looks like:
- it's being used to calculate where the tip of the vessel is, for mach effects
- using vessel.size probably means that it can be super big in some cases
- There's probably a better way to find the tip of the vessel in a given direction - or at least cache it if the velocity direction doesn't change much
- This is running for all loaded vessels, which is a very high number during RUD
- If this is only used for mach effects, it should be disabled when you're not in atmosphere or when not above the speed of sound
- This probably doesn't need to be in FixedUpdate
Some of these are much more expensive than others, though I'm not sure why.
oof.
RocketSoundEnhancement/Source/RocketSoundEnhancement/ShipEffects.cs
Line 245 in 2054525
Looks like: