Skip to content

FastCast

FastCast is the root class of the module and offers the surface level methods required to make it work. This is the object returned from require(FastCast).



Constructors

Reminder

Do not create a new caster every time your weapon fires! This is a common mistake people make. Doing this will cause severe performance problems and unexpected behavior in the module. Remember - A caster is like a gun. Creating a caster every time the weapon is fired is like buying a new gun every time you want to fire a bullet.


Caster FastCast.new()

Construct a new Caster instance, which represents an entire gun or other projectile launching system.


FastCastBehavior FastCast.newBehavior()

Creates a new FastCastBehavior, which contains information necessary to Fire the cast properly.



Properties


boolean DebugLogging

If true, verbose debug logging will be used, printing detailed information about what's going on during processing to the output.

Info

Generally speaking, this is only useful for debugging code flow in FastCast itself. If you need to make sure your weapon is simulating like you want it to, consider using VisualizeCasts.


boolean VisualizeCasts

Performance Warning

Setting this to can be severely detrimental to performance, and should only be used when debugging! Never use VisualizeCasts to render bullet trails and impacts for gameplay purposes.

If true, casts will be shown ray-by-ray in the 3D world. This is shown in the following method:

  • A ConeHandleAdornment is created for each individual cast segment.
    • It will be black when it is initially created.
    • If the cast registers as a pierce, it will become red to signify that the cast would have hit, but was purposely ignored.
  • A SphereHandleAdornment is created for each registered hit.
    • It will be green if the impact stopped the ray.
    • It will be red if it did not stop the ray due to piercing.