Skip to content

ShipEffects does a lot of expensive box traces during RUD #49

@JonnyOThan

Description

@JonnyOThan
Image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions