Castle Game EngineIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers
|
Class TSceneManagerWorld
Unit
CastleTransform
Declaration
type TSceneManagerWorld = class(TCastleTransform)
Description
3D world. List of 3D objects, with some central properties.
Hierarchy
Overview
Fields
Methods
Properties
Description
Fields
 |
OnCursorChange: TNotifyEvent; |
|
Methods
 |
constructor Create(AOwner: TComponent); override; |
|
 |
destructor Destroy; override; |
|
 |
function GravityUp: TVector3; virtual; abstract; |
Up vector, according to gravity. Gravity force pulls in -GravityUp direction.
|
 |
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.
|
 |
function WorldMoveAllowed( const OldPos, ProposedNewPos: TVector3; out NewPos: TVector3; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: TBox3D; const BecauseOfGravity: boolean): boolean; overload; 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 TCastleTransform instance.
If your query originates from some existing TCastleTransform instance, you usually do not want to call these WorldXxx methods. Instead call TCastleTransform.MoveAllowed, TCastleTransform.Height methods. Underneath, they still call World.WorldMoveAllowed and World.WorldHeight , additionally making sure that the 3D object does not collide with itself.
|
 |
function WorldMoveAllowed( const OldPos, NewPos: TVector3; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: TBox3D; const BecauseOfGravity: boolean): boolean; overload; virtual; abstract; |
|
 |
function WorldHeight(const APosition: TVector3; out AboveHeight: Single; out AboveGround: PTriangle): boolean; virtual; abstract; |
|
 |
function WorldLineOfSight(const Pos1, Pos2: TVector3): boolean; virtual; abstract; |
|
 |
function WorldBoxCollision(const Box: TBox3D): boolean; |
|
 |
function WorldSphereCollision(const Pos: TVector3; const Radius: Single): boolean; |
|
 |
function WorldPointCollision2D(const Point: TVector2): boolean; |
|
 |
procedure Update(const SecondsPassed: Single; var RemoveMe: TRemoveType); override; |
|
 |
procedure CameraChanged(ACamera: TCamera); override; |
|
Properties
 |
property CameraPosition: TVector3 read FCameraPosition; |
Camera position, direction and up, in the world coordinates.
Note that some features of TCastleScene (like LOD or Billboard or ProximitySensor) will need to transform this camera to scene local space. They use WorldTransform, and will raise ETransformParentUndefined when it is not possible (e.g. when the same scene instance is reused under many different locations).
So, to be on the safe side, do not turn on TCastleSceneCore.ProcessEvents, or do not share the scene in multiple places in the scene manager. Or at least don't use features like LOD or Billboard or ProximitySensor, that cannot work in case the same scene instance in rendered in multiple locations on the world.
CameraKnown = False means that CameraChanged was never called, and so camera settings are not known, and so other Camera* properties have undefined values.
|
 |
property CameraDirection: TVector3 read FCameraDirection; |
|
 |
property CameraUp: TVector3 read FCameraUp; |
|
 |
property CameraKnown: boolean read FCameraKnown; |
|
Generated by PasDoc 0.15.0.
|