Class TObject3D

Unit

Declaration

type TObject3D = class(TEntity3D)

Description

Base for objects.

Hierarchy

Overview

Methods

Protected procedure SetPosition (aVector: TVector3D); override;
Protected procedure SetScale (aVector: TVector3D); virtual;
Public CONSTRUCTOR Create; override;
Public FUNCTION CheckCollision (CONST aObject: TObject3D): BOOLEAN;
Public PROCEDURE Render;
Public PROCEDURE RenderBoundingVolume;

Properties

Public property Id: LONGINT READ fId WRITE fId;
Public property Visible: BOOLEAN READ fVisible WRITE fVisible;
Public property Frame: Real read fFrame write fFrame;
Public property Model: TModel3D READ fModel WRITE fModel;
Public property Scaled: Boolean read fDoScale;
Public property Scale: TVector3D READ fScale write SetScale;
Public property Radius: GLfloat READ fRadius WRITE fRadius;
Public property UseBoundingBox: BOOLEAN READ fUseBoundingBox WRITE fUseBoundingBox;
Public property BoundingBox: TBox read fBoundingBox write SetBoundingBox;
Public property NextObject: TObject3D READ fNext WRITE fNext;
Public property OnCollision: TNotifyObject3DEvent read fOnCollision write fOnCollision;

Description

Methods

Protected procedure SetPosition (aVector: TVector3D); override;

Change position.

See also
TEntity3D.Position
Entity position.
Protected procedure SetScale (aVector: TVector3D); virtual;

Change scale.

See also
TObject3D.Scale
Applied scale.
Public CONSTRUCTOR Create; override;

Creates an empty object.

Public FUNCTION CheckCollision (CONST aObject: TObject3D): BOOLEAN;

Check if object collided with another object.

To check the collision, this method uses both bounding sphere and bounding boxes where available. It follows the next sequence:

  1. It checks sphere collision using both object Radius.

  2. If spheres collide, then checks box collision if they're available.

Note that if any of the Radius is zero or negative, it will skip any checking and return False.

Parameters
aObject
The object to check the collision with.
Returns

True if objects are in contact or overlap, False otherwise.

See also
TObject3D.Radius
Bounding sphere radius.
TObject3D.UseBoundingBox
To know if use the Bounding box for colission checking.
TObject3D.BoundingBox
The bounding box.
TObject3D.RenderBoundingVolume
Render the bounding sphere and/or bounding box.
TWorld3D.CheckCollisions
Check collisions and notify the objects when a collision is detected.
Public PROCEDURE Render;

Render the object.

Model must be assigned for this method to work.

Note this method will render the object despite the Visible property value.

See also
TObject3D.Visible
Is object visible.
TObject3D.RenderBoundingVolume
Render the bounding sphere and/or bounding box.
TObject3D.Model
Reference to the model.
TEntity3D.Position
Entity position.
TEntity3D.Rotation
Entity rotation.
TObject3D.Scale
Applied scale.
Public PROCEDURE RenderBoundingVolume;

Render the bounding sphere and/or bounding box.

See also
TObject3D.Radius
Bounding sphere radius.
TObject3D.BoundingBox
The bounding box.
TObject3D.UseBoundingBox
To know if use the Bounding box for colission checking.

Properties

Public property Id: LONGINT READ fId WRITE fId;

Object identifier.

Public property Visible: BOOLEAN READ fVisible WRITE fVisible;

Is object visible.

The value is informative. That means method TObject3D.Render will ignore it but TWorld3D.Render will use it to know if it should render it.

Default is True

See also
TObject3D.Render
Render the object.
Public property Frame: Real read fFrame write fFrame;

Frame to render.

This property is only informative. It can be used by the Model to render different versions of itself.

Default is 0.

Public property Model: TModel3D READ fModel WRITE fModel;

Reference to the model.

The same model can be used in more than one object. The object doesn't owns the model.

See also
TObject3D.Render
Render the object.
TModel3D.Render
Renders the object.
TObject3D.Frame
Frame to render.
Public property Scaled: Boolean read fDoScale;

Tell if object is scaled.

Public property Scale: TVector3D READ fScale write SetScale;

Applied scale.

You can assign a different scale factor for each axis.

See also
TObject3D.Render
Render the object.
Public property Radius: GLfloat READ fRadius WRITE fRadius;

Bounding sphere radius.

See also
TObject3D.CheckCollision
Check if object collided with another object.
TObject3D.BoundingBox
The bounding box.
TWorld3D.CheckCollisions
Check collisions and notify the objects when a collision is detected.
Public property UseBoundingBox: BOOLEAN READ fUseBoundingBox WRITE fUseBoundingBox;

To know if use the Bounding box for colission checking.

If True collision routines will use the bounding box values.

if False collision routines will use the Radius only.

See also
TObject3D.CheckCollision
Check if object collided with another object.
TObject3D.BoundingBox
The bounding box.
TWorld3D.CheckCollisions
Check collisions and notify the objects when a collision is detected.
Public property BoundingBox: TBox read fBoundingBox write SetBoundingBox;

The bounding box.

This box is always paralel to the x, y, z axis and they don't change when object rotates.

The parameters are relative to the object's Position.

If Radius is zero or negative, assigning this property will assign it.

Default is zero.

See also
TObject3D.UseBoundingBox
To know if use the Bounding box for colission checking.
TObject3D.CheckCollision
Check if object collided with another object.
TModel3D.BoundingBox
Returns the bounding box limits.
Public property NextObject: TObject3D READ fNext WRITE fNext;

Next object in the octree node.

This property is for internal use so you shouldn't mess with it.

Public property OnCollision: TNotifyObject3DEvent read fOnCollision write fOnCollision;

Event to notify collisions.

The handler receives the reference of the other object implied in the collision or Nil if the collision is with the heightmap.

See also
TWorld3D.CheckCollisions
Check collisions and notify the objects when a collision is detected.

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