Projectile

consoledoc.h

Base projectile class. Uses the ProjectileData class for properties of individual projectiles.

More...

Physics

Point3F

Starting position for the projectile.

Point3F

Starting velocity for the projectile.

Source

int

ID number of the object that fired the projectile.

int

The sourceObject's weapon slot that the projectile originates from.

Public Static Attributes

bool

Disables rendering of all instances of this type.

bool

Disables selection of all instances of this type.

Public Functions

void
presimulate(float seconds)

Updates the projectile's positional and collision information.

Detailed Description

Base projectile class. Uses the ProjectileData class for properties of individual projectiles.

Physics

Point3F initialPosition 

Starting position for the projectile.

Point3F initialVelocity 

Starting velocity for the projectile.

Source

int sourceObject 

ID number of the object that fired the projectile.

note:

If the projectile was fired by a WeaponImage, sourceObject will be the object that owns the WeaponImage. This is usually the player.

int sourceSlot 

The sourceObject's weapon slot that the projectile originates from.

bool ignoreSourceTimeout 

Public Static Attributes

bool isRenderable 

Disables rendering of all instances of this type.

bool isSelectable 

Disables selection of all instances of this type.

Public Functions

presimulate(float seconds)

Updates the projectile's positional and collision information.

This function will first delete the projectile if it is a server object and is outside it's ProjectileData::lifetime. Also responsible for applying gravity, determining collisions, triggering explosions, emitting trail particles, and calculating bounces if necessary.Parameters:

seconds

Amount of time, in seconds since the simulation's start, to advance.

// Tell the projectile to process a simulation event, and provide the amount of time
// that has passed since the simulation began.
%seconds = 2.0;
%projectile.presimulate(%seconds);

note:

This function is not called if the SimObject::hidden is true.