Torque 3D - Script Manual: Projectile Class Reference

TorqueScript

Main   Class List   Namespace List   Online

Projectile Class Reference
[Game Objects]

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

Inheritance diagram for Projectile:

List of all members.

Public Member Functions

void presimulate (float seconds=1.0f)
 Updates the projectile's positional and collision information.

Public Attributes

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.
int sourceSlot
 The sourceObject's weapon slot that the projectile originates from.

Static Public Attributes

static bool isRenderable
 Disables rendering of all instances of this type.
static bool isSelectable
 Disables selection of all instances of this type.

Detailed Description

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


Member Function Documentation

void Projectile::presimulate ( float  seconds = 1.0f  ) 

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.
Example:
// 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.

Member Data Documentation

Starting position for the projectile.

Starting velocity for the projectile.

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.

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



Copyright © GarageGames, LLC. All Rights Reserved.