PhantomCamera3D
Inherits: Node3D
PhantomCamera3D
, shortened to PCam3D
(text) and pcam_3d
(code), is used in 3D scenes.
Core Properties
Follow Mode
Enables the PCam3D
to follow specific target(s) using various logics.
Secondary Properties
Active State
Type: bool
Default: false
Returns true
if this PCam
is the one controlling the scene's Camera
.
Tween on Load
Type: bool
Default: true
By default, the moment a PCam
is instantiated into a scene, and has the highest priority, it will perform its tween transition.
This is most obvious if a PCam
has a long duration and is attached to a playable character that can be moved the moment a scene is loaded.
Disabling the Tween on Load property will disable this behaviour and skip the tweening entirely when instantiated.
Note: During runtime, properties should be modified and read via their setters & getters respectively.
Inactive Update Mode
Type: int
Default: 0
Determines how often an inactive PCam
should update its positional and rotational values. This is meant to reduce the amount of calculations inactive PCams
are doing when idling to improve performance. The value is based on the enum type Constants.InactiveUpdateMode
.
Inactive Update Mode | Value |
---|---|
ALWAYS | 0 |
NEVER | 1 |
Note: This property is only modifiable within the node's inspector panel in the editor.
Camera3D Resource
Type: Camera3DResource
Default: null
A resource type that allows for overriding the Camera3D
node's properties.
Note: During runtime, properties should be modified and read via their setters & getters respectively.
Setter
void
set_camera_3D_resource(Camera3DResource
resource)
Example
pcam.set_camera_3D_resource(resource)
Camera Cull Mask
Type: int
Default: 1048575
Overrides the Camera Cull Mask property of the Camera3D
once becoming active.
A simplified helper setter method can be found in the example code below.
Note: During runtime, properties should be modified and read via their setters & getters respectively.
Setter
void
set_camera_cull_mask(int
cull_mask)
Example
pcam.set_camera_cull_mask(cull_mask)
# Use this helper method to enable or disable a specific layer.
pcam.set_cull_mask_value(int layer_number, bool value)
H Offset
Type: float
Default: 0
Overrides the H Offset property of the Camera3D
once becoming active.
Note: During runtime, properties should be modified and read via their setters & getters respectively.
V Offset
Type: float
Default: 0
Overrides the V Offset property of the Camera3D
once becoming active.
Note: During runtime, properties should be modified and read via their setters & getters respectively.
FOV
Type: float
Default: 75
Overrides the FOV (Field of View) property of the Camera3D
once becoming active.
Note: During runtime, properties should be modified and read via their setters & getters respectively.
Signals
Tween Interrupted
Signal
tween_interrupted (PhantomCamera
pcam)
Emitted when the tween is interrupted due to another PCam
becoming active.
The argument is the PCam
that interrupted the tween.