Castle Game EngineIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers
|
Unit CastleCameras
Description
Cameras to navigate in 3D space (TExamineCamera, TWalkCamera, TUniversalCamera).
Uses
Overview
Classes, Interfaces, Objects and Records
Class TCameraInputListener |
Base class camera. |
Class TCamera |
Handle user navigation in 3D scene. |
Class TExamineCamera |
Navigate the 3D model in examine mode, like you would hold a box with the model inside. |
Class TWalkCamera |
Navigation by walking (first-person-shooter-like moving) in 3D scene. |
Class TUniversalCamera |
Camera that allows any kind of navigation (Examine, Walk). |
Functions and Procedures
Types
Constants
Description
Functions and Procedures
procedure CorrectPreferredHeight(var PreferredHeight: Single; const Radius: Single; const CrouchHeight, HeadBobbing: Single); |
|
See TWalkCamera.CorrectPreferredHeight. This is a global version, sometimes may be useful.
|
function CamDirUp2Orient(const CamDir, CamUp: TVector3Single): TVector4Single; |
|
Convert camera direction and up vectors into VRML/X3D "orientation" vector.
Orientation expresses CamDir and CamUp as 4-item vector (SFRotation). First three items are the Axis (normalized) and the 4th is the Angle (in radians). Meaning: if you rotate the standard direction and up (see DefaultCameraDirection, DefaultCameraUp) around Axis by the Angle, then you get CamDir and CamUp.
Given here CamDir and CamUp must be orthogonal and non-zero. Their lengths are not relevant (that is, you don't need to normalize them before passing here).
|
function CamDirUp2OrientQuat(CamDir, CamUp: TVector3Single): TQuaternion; |
|
Convert camera direction and up vectors into "rotation quaternion" of VRML/X3D "orientation".
VRML orientation expresses camera direction and up as a rotation. This means that you should rotate the standard direction and up (see DefaultCameraDirection, DefaultCameraUp) by this rotation to get CamDir and CamUp.
Given here CamDir and CamUp must be orthogonal and non-zero. Their lengths are not relevant (that is, you don't need to normalize them before passing here).
|
procedure CameraViewpointForWholeScene(const Box: TBox3D; const WantedDirection, WantedUp: Integer; const WantedDirectionPositive, WantedUpPositive: boolean; out Position, Direction, Up, GravityUp: TVector3Single); |
|
Calculate sensible camera configuration to see the whole Box.
WantedDirection and WantedUp indicate desired look direction/up axis (0, 1 or 2 for X, Y or Z). WantedDirectionPositive and WantedUpPositive indicate if we want the positive axis. Obviously look direction and up cannot be parallel, so WantedDirection must be different than WantedUp.
Returned Direction, Up, GravityUp are normalized.
|
Types
TCameraInput = (...); |
|
Possible navigation input types in cameras, set in TCamera.Input.
Values
|
TNavigationClass = (...); |
Values
|
TNavigationType = (...); |
Values
-
ntExamine:
-
ntTurntable:
-
ntWalk:
-
ntFly:
-
ntNone:
|
TMouseDragMode = (...); |
|
What mouse dragging does in TWalkCamera.
Values
-
mdWalk: Moves avatar continously in the direction of mouse drag (default for TWalkCamera.MouseDragMode).
-
mdRotate: Rotates the head when mouse is moved.
-
mdNone: Ignores the dragging.
|
Constants
DefaultCameraDirection: TVector3Single = (0, 0, -1); |
|
Default camera direction and up vectors, used to define the meaning of "camera orientation" for CamDirUp2Orient routines. These match VRML/X3D default camera values.
|
Generated by PasDoc 0.14.0.
|