Class TEntity3D

Unit

Declaration

type TEntity3D = class(TObject)

Description

Base class for 3D entities.

TEntity3D is a base class for elements that are inside a scene with position and rotation.

It introduces methods and properties that allows entities to move in a scene.

An instance of TEntity3D is never created directly, instead a descendant should be created.

Hierarchy

  • TObject
  • TEntity3D

Overview

Methods

Protected function GetEnabled: Boolean; virtual;
Protected procedure SetEnabled (const aValue: Boolean); virtual;
Protected procedure SetPosition (aVector: TVector3D); virtual;
Protected procedure SetRotation (aVector: TVector3D); virtual;
Protected procedure SetTag (const aValue: Integer); virtual;
Public constructor Create; virtual;
Public procedure Translate (const aVector: TVector3D);
Public procedure TranslateDir ( const aDirection: TVector3D; const aDistance: Single );

Properties

Public property Enabled: Boolean read GetEnabled write SetEnabled;
Public property Position: TVector3D read fPosition write SetPosition;
Public property Rotation: TVector3D read fRotation write SetRotation;
Public property Tag: Integer read fTag write SetTag;

Description

Methods

Protected function GetEnabled: Boolean; virtual;

Get entity state.

Protected procedure SetEnabled (const aValue: Boolean); virtual;

Change entity state.

Protected procedure SetPosition (aVector: TVector3D); virtual;

Changes entity position.

Protected procedure SetRotation (aVector: TVector3D); virtual;

Changes entity rotation.

Protected procedure SetTag (const aValue: Integer); virtual;

Set tag.

Override it if you need some kind of notification.

See also
TEntity3D.Tag
A tag value.
Public constructor Create; virtual;

Constructor.

Public procedure Translate (const aVector: TVector3D);

Unconditionally move this object by given vector.

This method doesn't check any collision.

Parameters
aVector
A vector describing the distance to translate in each axis.
See also
TEntity3D.TranslateDir
Unconditionally move this object the given distance in the given direction.
Public procedure TranslateDir ( const aDirection: TVector3D; const aDistance: Single );

Unconditionally move this object the given distance in the given direction.

This method doesn't check any collision.

Parameters
aDirection
A vector describing the direction to be translated. It's not rotation. Should be normalized.
aDistance
The distance to move in the given direction.
See also
TEntity3D.Translate
Unconditionally move this object by given vector.

Properties

Public property Enabled: Boolean read GetEnabled write SetEnabled;

Is the entity enabled.

Public property Position: TVector3D read fPosition write SetPosition;

Entity position.

Public property Rotation: TVector3D read fRotation write SetRotation;

Entity rotation.

Public property Tag: Integer read fTag write SetTag;

A tag value.

This is an arbitrary value not used by the engine itself. You can use it for whatever you want. For esample, you can use to identify individuals, or breeds, or states.

Collision routines may use this value to filter the objects.

See also
TWorld3D.CheckSphereCollisionWithTags
Check if the sphere collides with objects in the world with given tag.

Generated by PasDoc 0.15.0. Generated on 2025-07-31 11:41:01.