ramokz / phantom-camera

👻🎥 Control the movement and dynamically tween 2D & 3D cameras. Built for Godot 4. Inspired by Cinemachine.
https://phantom-camera.dev/
MIT License
2.18k stars 72 forks source link

Setting a Pcam's Cull Mask Layer using Helper Function #204

Closed ramokz closed 8 months ago

ramokz commented 8 months ago

Project Type

3D

Feature Description

From #202

The way you assign a cull mask to a PCam3D is by using the function set_camera_cull_mask(value: int).

The challenge with this is that you have to assign the bit value, which requires calculating the power of the layer you wish to change on top of the existing cull mask value, which isn't very straightforward — especially for beginners.

Godot's Camera3D class provides a helper function for this with set_cull_mask_value(layer_number: int, enabled: bool), which simplifies the process of modifying the cull mask by just saying which layer to change and then whether to enable or disable them.

The proposal is to duplicate that same helper function into the PCam3D as well.

Use Cases

For when you want to adjust a PCam's, and in turn a Camera3D's, cull mask during runtime.

Importance

Low - there are workarounds where the proposed feature would just simplify things

Usage

Often - a significant amount of projects can find this useful

(Optional) Proposed Solution

No response