API V2 Reference: ActiveCast - EtiTheSpirit/FastCastAPIDocs GitHub Wiki

This is obsolete. Visit https://etithespirit.github.io/FastCastAPIDocs/ instead.

ActiveCast

An ActiveCast represents a bullet fired by a parent Caster. It contains methods of accessing the physics data of this specific bullet at any given time, as well as methods to alter its trajectory during runtime.

Properties

Caster Caster

A reference to the Caster that created this ActiveCast from its Fire method.

CastStateInfo StateInfo

A container storing information about the caster's state.

CastRayInfo RayInfo

A container storing information pertaining to actual raycasting.

table UserData

A table where the user can store arbitrary information pertaining to this ActiveCast.

Methods

void Update(number deltaTime)

Update this cast, stating that deltaTime seconds has passed. This should not be called by the user.

void SetVelocity(Vector3 velocity)

Sets the velocity of this cast at this point in time to velocity.

void SetAcceleration(Vector3 acceleration)

Sets the acceleration of this cast at this point in time to acceleration.

void SetPosition(Vector3 position)

Sets the position of this cast at this point in time to position.

Vector3 GetVelocity()

Returns the velocity of the cast at this point in time.

Vector3 GetAcceleration()

Returns the acceleration of the cast at this point in time.

Vector3 GetPosition()

Returns the position of the cast at this point in time.

void AddVelocity(Vector3 velocity)

Adds velocity onto the current velocity of the cast.

void AddAcceleration(Vector3 acceleration)

Adds acceleration onto the current acceleration of the cast.

void AddPosition(Vector3 position)

Adds position onto the current position of the cast.

void Pause()

Pause this ActiveCast, preventing it from simulating. This is identical to setting Paused = true in StateInfo.

void Resume()

Resume this ActiveCast, causing it to simulate again. This is identical to setting Paused = false in StateInfo.

void Terminate()

Terminate this ActiveCast, setting Live = false. Fires the Terminated event.