Class TArenaObject

DescriptionHierarchyFieldsMethodsProperties

Unit

Arena

Declaration

type TArenaObject = class(TObject)

Description

Abstract base class used for all arena objects. This class is only for internal use and only implements functionality needed by all arena objects. When populating an arena, the user should use the available descendants of TArenaObject.

Hierarchy

TArenaObject > TObject

Methods

Overview

Public constructor Create(Owner: TArena);
Public destructor Destroy; override;
Public procedure AddAsStrings(Strings: TStringList); virtual;
Public function Edit(Dlg: TArenaObjectEditor = nil): Boolean; virtual;
Public procedure GenerateShapes; virtual; abstract;
Public procedure Step(TimeStep: real);

Description

Public constructor Create(Owner: TArena);

Constructor.

parameters
Owner
is the TArena that owns this object.
Public destructor Destroy; override;

Destructor.

Public procedure AddAsStrings(Strings: TStringList); virtual;

Adds all properties as strings to a list of strings. Used internally by TArena.SaveToFile.

Public function Edit(Dlg: TArenaObjectEditor = nil): Boolean; virtual;

Displays an edit dialog (for graphical editing of the object's properties).

parameters
Dlg
should always be Nil. (Only used internally.)
returns

True if the user clicks the OK button, False otherwise.

Public procedure GenerateShapes; virtual; abstract;

Generates a geometric representation of the object. The result of this procedure can be retrieved through the property Shapes.
This procedure is automatically called when needed and should never be called explicitly by a user.

Public procedure Step(TimeStep: real);

Updates the position of the object based on its velocity. The new position is calculated as

 fPosition[1] := fPosition[1] + fVelocity[1]*TimeStep;
 fPosition[2] := fPosition[2] + fVelocity[2]*TimeStep;
 fPosition[3] := fPosition[3] + fVelocity[3]*TimeStep;

Properties

Overview

Public property Angle: real;
Public property Height: real;
Public property M[i: integer]: real;
Public property Mass: real;
Public property ObjectName: string;
Public property Position: TVector;
Public property RGBColor: TIntegerVector;
Public property Shapes: TShapeList;
Public property Texture: string;
Public property Velocity: TVector;
Public property Visible: Boolean;

Description

Public property Angle: real;

The object's rotation angle around the Z axis (as defined in the arena definition file).

Public property Height: real;

The height of the object (along the Z axis).

Public property M[i: integer]: real;

Default property that returns the position of the object. Use index (i) 1, 2, or 3 to get the X, Y, or Z coordinates, respectively.

Public property Mass: real;

Mass of the object (in kg).

Public property ObjectName: string;

Name of the object.

Public property Position: TVector;

The position of the object.

Public property RGBColor: TIntegerVector;

The object's color.

Public property Shapes: TShapeList;

Provides access to an array of geometric shapes that represents the object.

Public property Texture: string;

Set/get the file name used as texture for the object.

Public property Velocity: TVector;

The object's velocity vector (3D).

Public property Visible: Boolean;

Toggle object visibility.


Generated by PasDoc 0.8.8.3 on 2005-05-28 08:13:48