Camera3D Resource
A resource type that overrides the various properties of the Camera3D that the PCam3D will control once becoming active.
Once a resource has been applied to a Camera3D it will retain those property values until overriden by another Pcam3D and its resource.
Properties
keep_aspect
Type: int
Default: 1
Overrides the keep_aspect property of the Camera3D once becoming active.
Setter
void set_keep_aspect(int value)
Example
# Applies KEEP_WIDTH values
pcam.set_keep_aspect(0)
# Alternatively, use the enum value
pcam.set_keep_aspect(Camera3DResource.KeepAspect.KEEP_WIDTH)cull_mask
Type: int
Default: 1048575
Overrides the cull_mask property of the Camera3D once becoming active.
A simplified helper setter method can be found in the example code below.
Setter
void set_cull_mask(int cull_mask_layer)
void set_cull_mask_value(int layer_number, bool value)
Example
# Use this to assign a specific layer value.
# Fairly complex to use, so the function below this is recommended.
pcam.set_cull_mask(1048575)
# Use this helper method to enable or disable a specific layer.
pcam.set_cull_mask_value(2, false)h_offset
Type: float
Default: 0
Overrides the h_offset property of the Camera3D once becoming active.
v_offset
Type: float
Default: 0
Overrides the v_offset property of the Camera3D once becoming active.
projection
Type: int
Default: 0
Overrides the projection property of the Camera3D once becoming active.
| Projection Type Name | Value |
|---|---|
| PERSPECTIVE | 0 |
| ORTHOGONAL | 1 |
| FRUSTUM | 2 |
Setter
void set_projection(int projection_type)
Example
pcam.set_projection(1)
# Instead of applying an int directly,
# it's also possible to supply an enum value like so:
pcam.set_projection(Camera3DResource.ProjectionType.ORTHOGONAL)fov
Type: float
Default: 75
Overrides the fov (Field of View) property of the Camera3D once becoming active.
Note
This property is only available when projection is set to Perspective.
size
Type: float
Default: 75
Overrides the size property of the Camera3D once becoming active.
Note
This property is only available when projection is set to either Orthogonal or Frustum.
frustum_offset
Type: Vector2
Default: 75
Overrides the frustum_offset property of the Camera3D once becoming active.
Note
This property is only available when projection is set to Frustum.
Setter
void set_frustum_offset(Vector2 frustum_offset)
Example
pcam.set_frustum_offset(Vector2(4.2, 4.2))