Look At Overview (3D)
Determines the rotational logic for a given PCam3D.
The different modes has different functionalities and purposes, so choosing the correct mode depends on what each PCam is meant to do.
Core Modes
Properties
look_at_mode
Type: LookAtEnum
Default: None
Value is based on LookAtMode enum.
| Look At Mode | Value |
|---|---|
| NONE | 0 |
| MIMIC | 1 |
| SIMPLE | 2 |
| GROUP | 3 |
Important
This property should not be changed during runtime, as such the setter for this has purposely been excluded.
To use another look_at_mode at runtime, switch to a separate PCam with the specific look_at_mode applied.
up
Type: Vector3
Default: Vector3(0, 1, 0)
Defines the upward direction of the PhantomCamera3D when look_at_mode is set.
This value will be overriden if up_target is defined.
up_target
Type: Node3D
Default: null
Applies and continuously updates the up direction of the PhantomCamera3D based on this target when look_at_mode is set.
Setting a value here will override the up value.
look_at_lookahead
Type: bool
Default: false
Enables velocity-based look-ahead. As the look at target moves the camera will move further ahead based on its velocity. The faster the look at target moves, the further ahead the camera will look.
look_at_lookahead_time
Type: float
Default: 0.1
The amount of seconds to look ahead of the follow target's position per axis based on the follow target's velocity.
Setter
void set_look_at_lookahead_time(float value)
Example
pcam.set_look_at_lookahead_time(0.5)look_at_lookahead_acceleration
Type: float
Default: 0.1
Determines the damping speed of how fast the camera should reach the look_at_lookahead_time target once the look_at target has positional velocity.
Lower value = faster
Higher value = slower
Setter
void set_look_at_lookahead_acceleration(float value)
Example
pcam.set_look_at_lookahead_acceleration(0.5)Getter
float get_look_at_lookahead_acceleration()
Example
pcam.get_look_at_lookahead_acceleration()look_at_lookahead_deacceleration
Type: float
Default: 0.1
Determines the damping speed of how fast the camera should decelerate back to the follow target's position once it has no positional velocity.
Lower value = faster
Higher value = slower
Setter
void set_look_at_lookahead_deacceleration(float value)
Example
pcam.set_look_at_lookahead_deacceleration(0.5)Getter
float get_look_at_lookahead_deacceleration()
Example
pcam.get_look_at_lookahead_deacceleration()look_at_lookahead_max
Type: bool
Default: false
Enables a maximum velocity limit in meters per second for look_at_lookahead.
If true, the look at target's velocity will be clamped to the look_at_lookahead_max_value.
In other words, no matter how fast the target's actual velocity is, the lookahead will only follow up to the speed defined here.
Setter
void set_look_at_lookahead_max(bool value)
Example
pcam.set_look_at_lookahead_max(true)look_at_lookahead_max_value
Type: float
Default: 5
The maximum look_at_lookahead velocity in meters per second that will be tracked.
Setter
void set_look_at_lookahead_max_value(float value)
Example
pcam.set_look_at_lookahead_max_value(10)Methods
bool is_looking
Returns true if look_at_mode is not set to NONE and has a valid look_at_target.
Example
pcam.is_looking()