Unit CastleThirdPersonNavigation
Functions and Procedures
Constants
Variables
Description
Third-person navigation (TCastleThirdPersonNavigation).
Uses
Overview
Classes, Interfaces, Objects and Records
Types
Description
Types
TChangeTransformation = (...); |
How does the avatar change transformation (for movement and rotations).
Values
-
ctAuto: Automatically determines best way to change transformation.
Right now, it means we
To be precise, we look at TCastleThirdPersonNavigation.AvatarHierarchy or (if it's Nil ) at TCastleThirdPersonNavigation.Avatar. In this transform, we check existence of TCastleRigidBody and TCastleCollider.
In the future, this auto-detection may change, to follow our best recommended practices. In particular, when ctForce approach (see below) will be fully implemented, it will likely become the new automatic behavior when TCastleRigidBody and TCastleCollider behaviors are present.
-
ctDirect: Directly change the avatar TCastleTransform.Translation, TCastleTransform.Rotation.
You should not have physics components (TCastleRigidBody and TCastleCollider and TCastleRigidBody.Exists = True ) set up on the TCastleThirdPersonNavigation.AvatarHierarchy or TCastleThirdPersonNavigation.Avatar in this case. Having physics components will make it impossible to change TCastleTransform.Translation, TCastleTransform.Rotation each frame.
This also means that if you want to have gravity (and stair climbing), you need to use deprecated TCastleTransform.Gravity, TCastleTransform.GrowSpeed, TCastleTransform.FallSpeed. They are part of the old simple physics engine: https://castle-engine.io/physics#_old_system_for_collisions_and_gravity .
TODO: Jumping and falling doesn't work in this case.
-
ctVelocity: Change the avatar using rigid body TCastleRigidBody.LinearVelocity, TCastleRigidBody.AngularVelocity.
This is not fully realistic (instead of calculating velocities explicitly we should be using forces). But it cooperates nicely with physics engine.
It requires a TCastleRigidBody and TCastleCollider components to be attached to the TCastleThirdPersonNavigation.AvatarHierarchy (or TCastleThirdPersonNavigation.Avatar, if TCastleThirdPersonNavigation.AvatarHierarchy is Nil ). Also TCastleRigidBody.Exists must be True to make navigation have any effect.
This also means that gravity should be handled by the physics engine. You should not use deprecated TCastleTransform.Gravity, TCastleTransform.GrowSpeed, TCastleTransform.FallSpeed in this case.
TODO: Climbing stairs doesn't work in this case (but you can jump on them).
|
TCastleThirdPersonNavigationAnimationEvent = procedure ( const Sender: TCastleThirdPersonNavigation; const AnimationNames: array of String) of object; |
This item has no description. |
Generated by PasDoc 0.16.0-snapshot.