Class TCastleThirdPersonNavigation
Unit
Declaration
type TCastleThirdPersonNavigation = class(TCastleMouseLookNavigation)
Description
3rd-person (with visible avatar) navigation.
Create an instance of this and put as TCastleViewport child to use.
Assign Avatar to automatically run proper animations on the avatar defined as a single TCastleScene. Alternatively, assign AvatarHierarchy, and leave Avatar as Nil
, and assign the OnAnimation event to do whatever is necessary to visualize proper animation of the avatar – this makes sense esp. if your avatar is composed from multiple TCastleScene instances. You have to assign at least one of Avatar or AvatarHierarchy, otherwise this navigation doesn't affect anything. and you only need to assign one of them for the navigation component to do the work.
Call Init once the parameters that determine initial camera location are all set.
Turn on MouseLook to allow user to move the mouse to orbit with the camera around the avatar. When AimAvatar is aaNone (default), it allows to look at the avatar easily from any side (e.g. you can then see avatar's face easily). When AimAvatar is aaHorizontal or aaFlying, rotating allows to point the avatar at the appropriate direction.
Using keys AWSD and arrows you can move and rotate the avatar, and the camera will follow.
Using the mouse wheel you can get closer / further to the avatar.
The implementation relies on the TCastleTransform.Direction and TCastleTransform.Up vectors being useful, i.e. they should point in the direction of the avatar and up. This works out-of-the-box if your model orientation follows glTF standard, up in +Y and direction in +Z (see DefaultOrientation, otUpYDirectionZ). Customize TCastleTransform.Orientation to make these vectors work if your avatar has non-standard orientation.
The navigation will honor physics if you have configured rigid body and collider components on the avatar. Otherwise, we use "old simple physics" documented on https://castle-engine.io/physics#_old_system_for_collisions_and_gravity . Right now, the "old simple physics" may be actually simpler to control. To make them work:
Do not attach TCastleRigidBody and TCastleCollider to the avatar.
Set TCastleSceneCore.PreciseCollisions to
True
on level scenes.Set TCastleTransform.MiddleHeight and TCastleTransform.CollisionSphereRadius to indicate sphere around the avatar to resolve collisions. Use TDebugTransform to visualize this.
SeT TCastleTransform.GrowSpeed and TCastleTransform.FallSpeed to allow avatar to fall down and climb stairs / hills.
This is an example Start
view method implementation to setup the navigation:
procedure TViewMain.Start; var DebugAvatar: TDebugTransform; begin inherited; { Uncomment and adjust if your avatar has different direction / up than standard in glTF. This is critical to make camera orbiting around and movement of avatar to follow proper direction and up. } // AvatarTransform.Orientation := ot...; ThirdPersonNavigation.MouseLook := true; { Configure parameters to move nicely using old simple physics, see examples/third_person_navigation for comments. Use these if you decide to move using "direct" method (when AvatarTransform.ChangeTransform = ctDirect, or when AvatarTransform.ChangeTransform = ctAuto and AvatarTransform has no rigid body and collider). } AvatarTransform.MiddleHeight := 0.9; AvatarTransform.CollisionSphereRadius := 0.5; AvatarTransform.GrowSpeed := 10.0; AvatarTransform.FallSpeed := 10.0; ThirdPersonNavigation.Init; DebugAvatar := TDebugTransform.Create(FreeAtStop); DebugAvatar.Parent := AvatarTransform; DebugAvatar.Exists := true; end;
See also the news post with demo movie about this component: https://castle-engine.io/wp/2020/06/29/third-person-navigation-with-avatar-component-in-castle-game-engine/
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleUserInterface
- TCastleNavigation
- TCastleMouseLookNavigation
- TCastleThirdPersonNavigation
Overview
Fields
nested const DefaultInitialHeightAboveTarget = 1.0; |
|
nested const DefaultDistanceToAvatarTarget = 4.0; |
|
nested const DefaultAvatarRotationSpeed = 10; |
|
nested const DefaultAvatarTarget: TVector3 = (X: 0; Y: 2; Z: 0); |
|
nested const DefaultCameraSpeed = 10; |
|
nested const DefaultMoveSpeed = 1.0; |
|
nested const DefaultCrouchSpeed = 0.5; |
|
nested const DefaultRunSpeed = 2.0; |
|
nested const DefaultJumpSpeed = 5.0; |
|
nested const DefaultRotationSpeed = Pi * 150 / 180; |
|
nested const DefaultCameraDistanceChangeSpeed = 1; |
|
nested const DefaultMinDistanceToAvatarTarget = 0.5; |
|
nested const DefaultMaxDistanceToAvatarTarget = 10; |
|
nested const DefaultAnimationIdle = 'idle'; |
|
nested const DefaultAnimationRotate = 'rotate'; |
|
nested const DefaultAnimationWalk = 'walk'; |
|
nested const DefaultAnimationRun = 'run'; |
|
nested const DefaultAnimationCrouch = 'crouch'; |
|
nested const DefaultAnimationCrouchIdle = 'crouch_idle'; |
|
nested const DefaultAnimationCrouchRotate = 'crouch_rotate'; |
|
nested const DefaultAnimationJump = 'jump'; |
|
nested const DefaultAnimationFall = 'fall'; |
|
nested const DefaultAirMovementControl = 0.5; |
|
nested const DefaultAirRotationControl = 0.5; |
Methods
procedure ProcessMouseLookDelta(const Delta: TVector2); override; |
|
function Zoom(const Factor: Single): Boolean; override; |
|
procedure SetAnimation(const AnimationNames: array of String); virtual; |
|
constructor Create(AOwner: TComponent); override; |
|
destructor Destroy; override; |
|
procedure Update(const SecondsPassed: Single; var HandleInput: Boolean); override; |
|
function PropertySections(const PropertyName: String): TPropertySections; override; |
|
procedure Init; |
|
function Input_CameraCloser: TInputShortcut; deprecated 'use Input_ZoomIn'; |
|
function Input_CameraFurther: TInputShortcut; deprecated 'use Input_ZoomOut'; |
Properties
property AvatarTarget: TVector3 read FAvatarTarget write FAvatarTarget; |
|
property Input_Forward: TInputShortcut read FInput_Forward; |
|
property Input_Backward: TInputShortcut read FInput_Backward; |
|
property Input_LeftRotate: TInputShortcut read FInput_LeftRotate; |
|
property Input_RightRotate: TInputShortcut read FInput_RightRotate; |
|
property Input_LeftStrafe: TInputShortcut read FInput_LeftStrafe; |
|
property Input_RightStrafe: TInputShortcut read FInput_RightStrafe; |
|
property Input_Crouch: TInputShortcut read FInput_Crouch; |
|
property Input_Run: TInputShortcut read FInput_Run; |
|
property Input_Jump: TInputShortcut read FInput_Jump; |
|
property ZoomEnabled default true; |
|
property MouseLookHorizontalSensitivity; |
|
property MouseLookVerticalSensitivity; |
|
property InvertVerticalMouseLook; |
|
property CameraFollows: Boolean read FCameraFollows write SetCameraFollows default true; |
|
property Avatar: TCastleScene read FAvatar write SetAvatar; |
|
property AvatarHierarchy: TCastleTransform read FAvatarHierarchy write SetAvatarHierarchy; |
|
property AvatarRotationSpeed: Single read FAvatarRotationSpeed write FAvatarRotationSpeed
default DefaultAvatarRotationSpeed; |
|
property CameraSpeed: Single read FCameraSpeed write FCameraSpeed
default DefaultCameraSpeed; |
|
property AimAvatar: TAimAvatar read FAimAvatar write FAimAvatar default aaNone; |
|
property InitialHeightAboveTarget: Single read FInitialHeightAboveTarget write SetInitialHeightAboveTarget
default DefaultInitialHeightAboveTarget; |
|
property ImmediatelyFixBlockedCamera: Boolean read FImmediatelyFixBlockedCamera write FImmediatelyFixBlockedCamera
default false; |
|
property DistanceToAvatarTarget: Single read FDistanceToAvatarTarget write SetDistanceToAvatarTarget
default DefaultDistanceToAvatarTarget; |
|
property CameraDistanceChangeSpeed: Single read FCameraDistanceChangeSpeed write FCameraDistanceChangeSpeed
default DefaultCameraDistanceChangeSpeed; |
|
property MinDistanceToAvatarTarget: Single read FMinDistanceToAvatarTarget write FMinDistanceToAvatarTarget
default DefaultMinDistanceToAvatarTarget; |
|
property MaxDistanceToAvatarTarget: Single read FMaxDistanceToAvatarTarget write FMaxDistanceToAvatarTarget
default DefaultMaxDistanceToAvatarTarget; |
|
property MoveSpeed: Single read FMoveSpeed write FMoveSpeed
default DefaultMoveSpeed; |
|
property CrouchSpeed: Single read FCrouchSpeed write FCrouchSpeed
default DefaultCrouchSpeed; |
|
property RunSpeed: Single read FRunSpeed write FRunSpeed
default DefaultRunSpeed; |
|
property JumpSpeed: Single read FJumpSpeed write FJumpSpeed
default DefaultJumpSpeed; |
|
property RotationSpeed: Single read FRotationSpeed write FRotationSpeed
default DefaultRotationSpeed; |
|
property AirMovementControl: Single read FAirMovementControl write FAirMovementControl
default DefaultAirMovementControl; |
|
property AirRotationControl: Single read FAirRotationControl write FAirRotationControl
default DefaultAirRotationControl; |
|
property AnimationIdle: String read FAnimationIdle write FAnimationIdle stored AnimationIdleStored nodefault; |
|
property AnimationRotate: String read FAnimationRotate write FAnimationRotate stored AnimationRotateStored nodefault; |
|
property AnimationWalk: String read FAnimationWalk write FAnimationWalk stored AnimationWalkStored nodefault; |
|
property AnimationRun: String read FAnimationRun write FAnimationRun stored AnimationRunStored nodefault; |
|
property AnimationCrouch: String read FAnimationCrouch write FAnimationCrouch stored AnimationCrouchStored nodefault; |
|
property AnimationCrouchIdle: String read FAnimationCrouchIdle write FAnimationCrouchIdle stored AnimationCrouchIdleStored nodefault; |
|
property AnimationCrouchRotate: String read FAnimationCrouchRotate write FAnimationCrouchRotate stored AnimationCrouchRotateStored nodefault; |
|
property AnimationJump: String read FAnimationJump write FAnimationJump stored AnimationJumpStored nodefault; |
|
property AnimationFall: String read FAnimationFall write FAnimationFall stored AnimationFallStored nodefault; |
|
property Radius; |
|
property ChangeTransformation: TChangeTransformation read FChangeTransformation write FChangeTransformation
default ctAuto; |
|
property OnAnimation: TCastleThirdPersonNavigationAnimationEvent
read FOnAnimation write FOnAnimation; |
|
property AvatarTargetPersistent: TCastleVector3Persistent read FAvatarTargetPersistent ; |
Description
Fields
nested const DefaultInitialHeightAboveTarget = 1.0; |
|
This item has no description. |
nested const DefaultDistanceToAvatarTarget = 4.0; |
|
This item has no description. |
nested const DefaultAvatarRotationSpeed = 10; |
|
This item has no description. |
nested const DefaultAvatarTarget: TVector3 = (X: 0; Y: 2; Z: 0); |
|
This item has no description. |
nested const DefaultCameraSpeed = 10; |
|
This item has no description. |
nested const DefaultMoveSpeed = 1.0; |
|
This item has no description. |
nested const DefaultCrouchSpeed = 0.5; |
|
This item has no description. |
nested const DefaultRunSpeed = 2.0; |
|
This item has no description. |
nested const DefaultJumpSpeed = 5.0; |
|
This item has no description. |
nested const DefaultRotationSpeed = Pi * 150 / 180; |
|
This item has no description. |
nested const DefaultCameraDistanceChangeSpeed = 1; |
|
This item has no description. |
nested const DefaultMinDistanceToAvatarTarget = 0.5; |
|
This item has no description. |
nested const DefaultMaxDistanceToAvatarTarget = 10; |
|
This item has no description. |
nested const DefaultAnimationIdle = 'idle'; |
|
This item has no description. |
nested const DefaultAnimationRotate = 'rotate'; |
|
This item has no description. |
nested const DefaultAnimationWalk = 'walk'; |
|
This item has no description. |
nested const DefaultAnimationRun = 'run'; |
|
This item has no description. |
nested const DefaultAnimationCrouch = 'crouch'; |
|
This item has no description. |
nested const DefaultAnimationCrouchIdle = 'crouch_idle'; |
|
This item has no description. |
nested const DefaultAnimationCrouchRotate = 'crouch_rotate'; |
|
This item has no description. |
nested const DefaultAnimationJump = 'jump'; |
|
This item has no description. |
nested const DefaultAnimationFall = 'fall'; |
|
This item has no description. |
nested const DefaultAirMovementControl = 0.5; |
|
This item has no description. |
nested const DefaultAirRotationControl = 0.5; |
|
This item has no description. |
Methods
procedure ProcessMouseLookDelta(const Delta: TVector2); override; |
|
This item has no description. |
function Zoom(const Factor: Single): Boolean; override; |
|
This item has no description. Showing description inherited from TCastleNavigation.Zoom.
Called only if ZoomEnabled, so no need to check it within implementation. Factor values correspond to TInputPressRelease.MouseWheelScroll values, so 1.0 should be treated like a "one operation" and some systems only generate values -1 or +1 (and never fractions). |
procedure SetAnimation(const AnimationNames: array of String); virtual; |
|
Make avatar play given animation. The desired animation is specified as a list of strings, from the most preferred name of the animation to the least preferred. This allows to perform a "fallback" mechanism in case some animations are missing on the model. For example if AnimationCrouch is not available, we will use AnimationCrouchIdle instead, and if that is also not available we will use AnimationIdle. Some basic animations must still exist – if even AnimationIdle doesn't exist, we'll just show a warning. The default implementation in Moreover the default implementation implements a "fallback" mechanism in case some animations are not available in the scene. This is checked using Avatar.HasAnimation. To apply animations in custom way, either override this method, or assign event to OnAnimation. E.g. you can animate a hierarchy of scenes composed from MD3 pieces. When overriding this, you don't need to call The implementation of this method (after performing the "fallback" mechanism described above to find the real name on the AnimationName list) should check whether the object is not already playing the same animation. This is important to avoid unnecessary animation restarts. |
constructor Create(AOwner: TComponent); override; |
|
This item has no description. |
destructor Destroy; override; |
|
This item has no description. |
procedure Update(const SecondsPassed: Single; var HandleInput: Boolean); override; |
|
This item has no description. Showing description inherited from TCastleUserInterface.Update. Control may do here anything that must be continuously repeated. E.g. camera handles here falling down due to gravity, rotating model in Examine mode, and many more.
This method may be used, among many other things, to continuously react to the fact that user pressed some key (or mouse button). For example, if holding some key should move some 3D object, you should do something like: if HandleInput then begin if Container.Pressed[keyArrowRight] then begin Transform.Position := Transform.Position + Vector3(SecondsPassed * 10, 0, 0); HandleInput := false; end; end;
Instead of directly using a key code, consider also using TInputShortcut that makes the input key nicely configurable. See engine tutorial about handling inputs. Multiplying movement by SecondsPassed makes your operation frame-rate independent. Object will move by 10 units in a second, regardless of how many FPS your game has. The code related to HandleInput is important if you write a generally-useful control that should nicely cooperate with all other controls, even when placed on top of them or under them. The correct approach is to only look at pressed keys/mouse buttons if HandleInput is Note that to handle a single press / release (like "switch light on when pressing a key") you should rather use Press and Release methods. Use this method only for continuous handling (like "holding this key makes the light brighter and brighter"). To understand why such HandleInput approach is needed, realize that the "Update" events are called differently than simple mouse and key events like "Press" and "Release". "Press" and "Release" events return whether the event was somehow "handled", and the container passes them only to the controls under the mouse (decided by TCastleUserInterface.CapturesEventsAtPosition). And as soon as some control says it "handled" the event, other controls (even if under the mouse) will not receive the event. This approach is not suitable for Update events. Some controls need to do the Update job all the time, regardless of whether the control is under the mouse and regardless of what other controls already did. So all controls (well, all controls that exist, in case of TCastleUserInterface, see TCastleUserInterface.Exists) receive Update calls. So the "handled" status is passed through HandleInput. If a control is not under the mouse, it will receive HandleInput = |
function PropertySections(const PropertyName: String): TPropertySections; override; |
|
This item has no description. Showing description inherited from TCastleComponent.PropertySections. Section where to show property in the editor. |
procedure Init; |
|
Makes camera be positioned with respect to the current properties and avatar. Always call this explicitly once. Use this after setting properties like Avatar, AvatarHierarchy, DistanceToAvatarTarget, InitialHeightAboveTarget. At design-time (in CGE editor), this is automatically called after changing relevant properties of this navigation. |
function Input_CameraCloser: TInputShortcut; deprecated 'use Input_ZoomIn'; |
|
Warning: this symbol is deprecated: use Input_ZoomIn This item has no description. |
function Input_CameraFurther: TInputShortcut; deprecated 'use Input_ZoomOut'; |
|
Warning: this symbol is deprecated: use Input_ZoomOut This item has no description. |
Properties
property AvatarTarget: TVector3 read FAvatarTarget write FAvatarTarget; |
|
Translation, from the avatar origin, to the "target" of the avatar where camera looks at. This is usually head, and this vector should just describe the height of head above the ground. By default this is DefaultAvatarTarget = (0, 2, 0). |
property Input_Forward: TInputShortcut read FInput_Forward; |
|
This item has no description. |
property Input_Backward: TInputShortcut read FInput_Backward; |
|
This item has no description. |
property Input_LeftRotate: TInputShortcut read FInput_LeftRotate; |
|
This item has no description. |
property Input_RightRotate: TInputShortcut read FInput_RightRotate; |
|
This item has no description. |
property Input_LeftStrafe: TInputShortcut read FInput_LeftStrafe; |
|
This item has no description. |
property Input_RightStrafe: TInputShortcut read FInput_RightStrafe; |
|
This item has no description. |
property Input_Crouch: TInputShortcut read FInput_Crouch; |
|
This item has no description. |
property Input_Run: TInputShortcut read FInput_Run; |
|
This item has no description. |
property Input_Jump: TInputShortcut read FInput_Jump; |
|
This item has no description. |
property ZoomEnabled default true; |
|
Zooming in this navigation mode makes camera move closer/further from avatar. |
property MouseLookHorizontalSensitivity; |
|
This item has no description. Showing description inherited from TCastleMouseLookNavigation.MouseLookHorizontalSensitivity. Mouse look sensitivity, if MouseLook is working. These properties specify how much angle change is produced by moving mouse by 1 pixel. |
property MouseLookVerticalSensitivity; |
|
This item has no description. |
property InvertVerticalMouseLook; |
|
This item has no description. Showing description inherited from TCastleMouseLookNavigation.InvertVerticalMouseLook.
If this is |
property CameraFollows: Boolean read FCameraFollows write SetCameraFollows default true; |
|
Does camera follow the avatar, by default yes. When this is However, all the inputs to control the avatar continue to work. |
property Avatar: TCastleScene read FAvatar write SetAvatar; |
|
Avatar scene, that is animated, moved and rotated when this navigation changes. This navigation component will just call We will use animation names configured using properties like AnimationWalk, AnimationIdle and other `AnimationXxx`. By default they are just equal to simple names When AvatarHierarchy is Otherwise (when AvatarHierarchy is assigned), then AvatarHierarchy is moved, and This scene assigned here should be part of TCastleViewport.Items to make this navigation work, in particular when you call Init. |
property AvatarHierarchy: TCastleTransform read FAvatarHierarchy write SetAvatarHierarchy; |
|
Optional avatar hierarchy that is moved and rotated when this navigation changes. When this is If AvatarHierarchy is non-nil, then it should contain Avatar (if it is assigned) as a child. AvatarHierarchy can even be equal to Avatar (it is equivalent to just leaving AvatarHierarchy as This object should be part of TCastleViewport.Items to make this navigation work, in particular when you call Init. |
property AvatarRotationSpeed: Single read FAvatarRotationSpeed write FAvatarRotationSpeed
default DefaultAvatarRotationSpeed; |
|
When AimAvatar, this is avatar's rotation speed (in radians per second). Should make avatar rotation "catch up" (with some delay after camera rotation. |
property CameraSpeed: Single read FCameraSpeed write FCameraSpeed
default DefaultCameraSpeed; |
|
Camera position tracks the desired position with given speed (in units per second). This makes camera adjust to avatar moving (because of input, or because of gravity or other external code) and to not being blocked by the collider. |
property AimAvatar: TAimAvatar read FAimAvatar write FAimAvatar default aaNone; |
|
If not aaNone then rotating the camera also rotates (with some delay) the avatar, to face the same direction as the camera. This allows to rotate the avatar with mouse look (which is comfortable), on the other hand it takes away some flexibility, e.g. you cannot look at avatar's face for a long time anymore. |
property InitialHeightAboveTarget: Single read FInitialHeightAboveTarget write SetInitialHeightAboveTarget
default DefaultInitialHeightAboveTarget; |
|
Initial height of camera above the AvatarTarget. Together with DistanceToAvatarTarget this determines the initial camera position, set by Init. It is not used outside of Init. |
property ImmediatelyFixBlockedCamera: Boolean read FImmediatelyFixBlockedCamera write FImmediatelyFixBlockedCamera
default false; |
|
Immediately (not with delay of CameraSpeed) update camera to never block avatar view by a wall, enemy etc. When it is |
property DistanceToAvatarTarget: Single read FDistanceToAvatarTarget write SetDistanceToAvatarTarget
default DefaultDistanceToAvatarTarget; |
|
Preferred distance from camera to the avatar target (head). User can change it with Input_ZoomIn, Input_ZoomOut if you set these inputs to some key/mouse button/mouse wheel. |
property CameraDistanceChangeSpeed: Single read FCameraDistanceChangeSpeed write FCameraDistanceChangeSpeed
default DefaultCameraDistanceChangeSpeed; |
|
Speed with which Input_ZoomIn, Input_ZoomOut can change DistanceToAvatarTarget. |
property MinDistanceToAvatarTarget: Single read FMinDistanceToAvatarTarget write FMinDistanceToAvatarTarget
default DefaultMinDistanceToAvatarTarget; |
|
Limit of the distance to avatar, used when changing DistanceToAvatarTarget, and also when deciding how to adjust camera to avoid collisions. |
property MaxDistanceToAvatarTarget: Single read FMaxDistanceToAvatarTarget write FMaxDistanceToAvatarTarget
default DefaultMaxDistanceToAvatarTarget; |
|
This item has no description. |
property MoveSpeed: Single read FMoveSpeed write FMoveSpeed
default DefaultMoveSpeed; |
|
Speed of movement by keys. |
property CrouchSpeed: Single read FCrouchSpeed write FCrouchSpeed
default DefaultCrouchSpeed; |
|
Speed of movement by keys, when crouching. |
property RunSpeed: Single read FRunSpeed write FRunSpeed
default DefaultRunSpeed; |
|
Speed of movement by keys, when running. |
property JumpSpeed: Single read FJumpSpeed write FJumpSpeed
default DefaultJumpSpeed; |
|
Speed of jump by keys. |
property RotationSpeed: Single read FRotationSpeed write FRotationSpeed
default DefaultRotationSpeed; |
|
Speed of rotating by keys, in radians per second. |
property AirMovementControl: Single read FAirMovementControl write FAirMovementControl
default DefaultAirMovementControl; |
|
Should we have control on the avatar movement in the air. Must be >= 0.
|
property AirRotationControl: Single read FAirRotationControl write FAirRotationControl
default DefaultAirRotationControl; |
|
Should we have control on the avatar rotation in the air.
|
property AnimationIdle: String read FAnimationIdle write FAnimationIdle stored AnimationIdleStored nodefault; |
|
Animation when character is not moving, not rotating and not crouching. Default 'idle'. |
property AnimationWalk: String read FAnimationWalk write FAnimationWalk stored AnimationWalkStored nodefault; |
|
Animation when character is walking. Default 'walk'. |
property AnimationRun: String read FAnimationRun write FAnimationRun stored AnimationRunStored nodefault; |
|
Animation when character is running. Default 'run'. |
property AnimationCrouch: String read FAnimationCrouch write FAnimationCrouch stored AnimationCrouchStored nodefault; |
|
Animation when character is moving while crouching. Default 'crouch'. |
property AnimationCrouchIdle: String read FAnimationCrouchIdle write FAnimationCrouchIdle stored AnimationCrouchIdleStored nodefault; |
|
Animation when character is crouching (Input_Crouch is pressed) but not moving or rotating. Default 'crouch_idle'. |
property AnimationCrouchRotate: String read FAnimationCrouchRotate write FAnimationCrouchRotate stored AnimationCrouchRotateStored nodefault; |
|
Animation when character is crouching (Input_Crouch is pressed) and rotating, but not moving. Default 'crouch_rotate'. |
property AnimationJump: String read FAnimationJump write FAnimationJump stored AnimationJumpStored nodefault; |
|
Animation when character is jumping (Input_Jump is pressed). Default 'jump'. |
property AnimationFall: String read FAnimationFall write FAnimationFall stored AnimationFallStored nodefault; |
|
Animation when character is fall. Default 'fall'. |
property Radius; |
|
Camera will keep at least this distance from walls. |
property ChangeTransformation: TChangeTransformation read FChangeTransformation write FChangeTransformation
default ctAuto; |
|
How does the avatar change transformation (for movement and rotations). This determines whether we update TCastleTransform.Translation, TCastleTransform.Rotation directly or use physics (TCastleRigidBody) velocities or forces. See TChangeTransformation for possible values are their meaning. By default, this is ctAuto, which means that we detect whether you have physics behaviors (TCastleRigidBody, TCastleCollider, with TCastleRigidBody.Exists) set up on the avatar.
|
property OnAnimation: TCastleThirdPersonNavigationAnimationEvent
read FOnAnimation write FOnAnimation; |
|
Update the animation displayed by the current avatar. See SetAnimation for details. Assigning event to this makes sense if your avatar is composed from multiple TCastleScene instances. This may be called very often, to update animation every frame, so do call procedure TViewMain.NavigationSetAnimation(const Sender: TCastleThirdPersonNavigation; const AnimationNames: array of String); begin if AnimationNames[0] = 'idle' then begin SceneLegs.AutoAnimation := 'legs_idle'; SceneTorso.AutoAnimation := 'torso_idle'; end else begin SceneLegs.AutoAnimation := 'legs_walk'; SceneTorso.AutoAnimation := 'torso_walk'; end |
property AvatarTargetPersistent: TCastleVector3Persistent read FAvatarTargetPersistent ; |
|
AvatarTarget that can be visually edited in Castle Game Engine Editor, Lazarus and Delphi. Normal user code does not need to deal with this, instead read or write AvatarTarget directly. See also
|
Generated by PasDoc 0.16.0-snapshot.