Class T3DWorld

Unit

Declaration

type T3DWorld = class(T3DList)

Description

3D world. List of 3D objects, with some central properties.

Hierarchy

Overview

Fields

Public OnCursorChange: TNotifyEvent;
Public OnVisibleChange: TVisibleChangeEvent;

Methods

Public constructor Create(AOwner: TComponent); override;
Public function CollisionIgnoreItem(const Sender: TObject; const Triangle: P3DTriangle): boolean; virtual; abstract;
Public function GravityUp: TVector3Single; virtual; abstract;
Public function GravityCoordinate: Integer;
Public function Player: T3DAlive; virtual; abstract;
Public function BaseLights: TAbstractLightInstancesList; virtual; abstract;
Public function Sectors: TSectorList; virtual; abstract;
Public function Water: TBox3D; virtual; abstract;
Public function WorldMoveAllowed( const OldPos, ProposedNewPos: TVector3Single; out NewPos: TVector3Single; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: TBox3D; const BecauseOfGravity: boolean): boolean; virtual; abstract;
Public function WorldMoveAllowed( const OldPos, NewPos: TVector3Single; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: TBox3D; const BecauseOfGravity: boolean): boolean; virtual; abstract;
Public function WorldHeight(const Position: TVector3Single; out AboveHeight: Single; out AboveGround: P3DTriangle): boolean; virtual; abstract;
Public function WorldLineOfSight(const Pos1, Pos2: TVector3Single): boolean; virtual; abstract;
Public function WorldRay(const RayOrigin, RayDirection: TVector3Single): TRayCollision; virtual; abstract;
Public function WorldSphereCollision(const Pos: TVector3Single; const Radius: Single): boolean;
Public function WorldSphereCollision2D(const Pos: TVector2Single; const Radius: Single; const Details: TCollisionDetails = nil): boolean;
Public function WorldPointCollision2D(const Point: TVector2Single): boolean;

Description

Fields

Public OnCursorChange: TNotifyEvent;
 
Public OnVisibleChange: TVisibleChangeEvent;
 

Methods

Public constructor Create(AOwner: TComponent); override;
 
Public function CollisionIgnoreItem(const Sender: TObject; const Triangle: P3DTriangle): boolean; virtual; abstract;

See TCastleSceneManager.CollisionIgnoreItem.

Public function GravityUp: TVector3Single; virtual; abstract;

Up vector, according to gravity. Gravity force pulls in -GravityUp direction.

Public function GravityCoordinate: Integer;

The major axis of gravity vector: 0, 1 or 2. This is derived from GravityUp value. It can only truly express GravityUp vector values (1,0,0) or (0,1,0) or (0,0,1), although in practice this is enough for normal games (normal 3D scenes use up either +Y or +Z).

We try to avoid using it in the engine, and use full GravityUp vector wherever possible. Full GravityUp vector may allow for more fun with weird gravity in future games.

Public function Player: T3DAlive; virtual; abstract;

Player, see TCastleSceneManager.Player.

Public function BaseLights: TAbstractLightInstancesList; virtual; abstract;

Base lights, see TCastleSceneManager.BaseLights.

Public function Sectors: TSectorList; virtual; abstract;

Sectors in the world, for AI. See TCastleSceneManager.Sectors.

Public function Water: TBox3D; virtual; abstract;

Water volume. See TCastleSceneManager.Water.

Public function WorldMoveAllowed( const OldPos, ProposedNewPos: TVector3Single; out NewPos: TVector3Single; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: TBox3D; const BecauseOfGravity: boolean): boolean; virtual; abstract;

Collisions with world. They call corresponding methods without the World prefix, automatically taking into account some knowledge about this 3D world.

Calling these methods to check collisions makes sense if your collision query is not initiated by any existing T3D instance.

If your query originates from some existing T3D instance, you usually do not want to call these WorldXxx methods. Instead call T3D.MoveAllowed, T3D.Height methods. Underneath, they still call World.WorldMoveAllowed and World.WorldHeight, additionally making sure that the 3D object does not collide with itself.

Public function WorldMoveAllowed( const OldPos, NewPos: TVector3Single; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: TBox3D; const BecauseOfGravity: boolean): boolean; virtual; abstract;
 
Public function WorldHeight(const Position: TVector3Single; out AboveHeight: Single; out AboveGround: P3DTriangle): boolean; virtual; abstract;
 
Public function WorldLineOfSight(const Pos1, Pos2: TVector3Single): boolean; virtual; abstract;
 
Public function WorldRay(const RayOrigin, RayDirection: TVector3Single): TRayCollision; virtual; abstract;
 
Public function WorldSphereCollision(const Pos: TVector3Single; const Radius: Single): boolean;
 
Public function WorldSphereCollision2D(const Pos: TVector2Single; const Radius: Single; const Details: TCollisionDetails = nil): boolean;
 
Public function WorldPointCollision2D(const Point: TVector2Single): boolean;
 

Generated by PasDoc 0.14.0.