FastCast
FastCast provides static utility methods for manipulating active casts (velocity, position, acceleration) and serves as the module root for constructing new Serial and Parallel casters.
Functions
newBehavior
Creates a new FastCastBehavior, which contains information necessary to Fire the cast properly.
new
FastCast.new() → CasterCreates a new Serial Caster. A Serial Caster runs all cast simulations on the main thread and is simpler to use but less performant than FastCast.newParallel.
newParallel
FastCast.newParallel() → CasterCreates a new Parallel Caster. A Parallel Caster runs cast simulations on separate worker VMs
WARNING
You must initialize the Parallel Caster before using it! Failing to do so will result in nothing happening when attempting to fire!
GetVelocityCast
Gets the velocity of an ActiveCast.
@method GetVelocityCast
@param cast vaildcast -- The active cast to get the velocity of.
@within FastCast
@return Vector3 -- The current velocity of the ActiveCast.
GetAccelerationCast
Gets the acceleration of an ActiveCast.
@method GetAccelerationCast
@param cast vaildcast -- The active cast to get the acceleration of.
@within FastCast
@return Vector3 -- The current acceleration of the ActiveCast.
GetPositionCast
Gets the position of an ActiveCast.
@method GetPositionCast
@param cast vaildcast -- The active cast to get the position of.
@within FastCast
@return Vector3 -- The current position of the ActiveCast.
SetVelocityCast
Sets the velocity of an ActiveCast to the specified Vector3.
@method SetVelocityCast
@param cast vaildcast -- The active cast to modify.
@param velocity Vector3 -- The new velocity to set.
@within FastCast
SetAccelerationCast
Sets the acceleration of an ActiveCast to the specified Vector3.
@method SetAccelerationCast
@param cast vaildcast -- The active cast to modify.
@param acceleration Vector3 -- The new acceleration to set.
@within FastCast
SetPositionCast
FastCast:SetPositionCast() → ()Sets the position of an ActiveCast to the specified Vector3.
AddPositionCast
Add position to an ActiveCast with the specified Vector3.
@method AddPositionCast
@param cast vaildcast -- The active cast to modify.
@param position Vector3 -- The new position to add.
@within FastCast
AddVelocityCast
Add velocity to an ActiveCast with the specified Vector3.
@method AddVelocityCast
@param cast vaildcast -- The active cast to modify.
@param velocity Vector3 -- The new velocity to add.
@within FastCast
AddAccelerationCast
Add acceleration to an ActiveCast with the specified Vector3.
@method AddAccelerationCast
@param cast vaildcast -- The active cast to modify.
@param acceleration Vector3 -- The new acceleration to add.
@within FastCast
TerminateCast
FastCast:TerminateCast(castTerminatingFunction: (cast: vaildcast) → ())?--
Optional callback invoked just before the cast is terminated.
) → ()Terminate function for casts
Note: If EndTime is already set, the cast is already terminated and this function returns early.