Read and control cameras.
27 natives. Read-only natives only look things up; the rest change something. Parameter types use the language's names (Types ).
$ camera . blend_spring (user: User , property_index: int , previous: float , weight: float ) -> float
Interpolate a property's spring with a previous value at a given weight
Parameter Type Meaning userUserThe camera's user. property_indexintThe property index to update. previousfloatThe spring's last value weightfloatThe interpolation factor
Returns float: The blended value the spring was set to
$ camera . blend_target_spring (user: User , previous: vec3 , weight: float ) -> vec3
Interpolate a target's spring with a previous value at a given weight
Parameter Type Meaning userUserThe camera's user. previousvec3The spring's last value weightfloatThe interpolation factor
Returns vec3: The blended value the spring was set to
$ camera . clear_properties (user: User )
Reverts properties to 0 and saves off active values into last_frame.
Parameter Type Meaning userUserThe camera's user.
$ camera . get_clamp (user: User , property_index: int , is_min: bool ) -> float
Gets the clamp value of a given property
Parameter Type Meaning userUserThe camera's user. property_indexintThe property index to update. is_minboolTrue if trying to get the minimum clamp value
Returns float: The clamp value of the camera property.
$ camera . get_clamped_property (user: User , property_index: int ) -> float
Gets the clamped value of a given property
Parameter Type Meaning userUserThe camera's user. property_indexintThe property index to update.
Returns float: The clamped value of a given property.
$ camera . get_controller_spring_names (user: User ) -> list
Get a list of active spring controller names
Parameter Type Meaning userUserThe camera's user.
Returns list: Active spring controller for each property.
$ camera . get_controller_spring_values (user: User ) -> list
Get a list of spring values
Parameter Type Meaning userUserThe camera's user.
Returns list: Spring values for each property.
$ camera . get_controller_value_names (user: User ) -> list
Get a list of active controller names
Parameter Type Meaning userUserThe camera's user.
Returns list: Active controller for each property.
$ camera . get_controller_values (user: User ) -> list
Get a list of controller values
Parameter Type Meaning userUserThe camera's user.
Returns list: Controller values for each property.
$ camera . get_manual_camera_enabled (index: int ) -> bool
Gets the value of the manual_camera_enabled debug toggle.
Parameter Type Meaning indexintThe camera index. If no index is specified, it will return true if any index manual_camera_enabled is true
Returns bool: The value of manual_camera_enabled
$ camera . get_name (user: User , property_index: int ) -> string
Gets the name a given property
Parameter Type Meaning userUserThe camera's user. property_indexintThe property index to update.
Returns string: The name of the controller for the camera property.
$ camera . get_property_value (user: User , property_index: int ) -> float
Gets the value of a given property
Parameter Type Meaning userUserThe camera's user. property_indexintThe property index to update.
Returns float: The value of the camera property.
$ camera . get_spring (user: User , property_index: int ) -> float
Gets the spring value of a given property
Parameter Type Meaning userUserThe camera's user. property_indexintThe property index to update.
Returns float: The spring value of the camera property.
$ camera . get_spring_name (user: User , property_index: int ) -> string
Gets the name a given property
Parameter Type Meaning userUserThe camera's user. property_indexintThe property index to update.
Returns string: The name of the spring controller for the camera property.
$ camera . get_target_spring (user: User ) -> vec3
Gets the spring value of a target property
Parameter Type Meaning userUserThe camera's user.
Returns vec3: The base value of the target property.
$ camera . get_target_value (user: User ) -> vec3
Gets the base value of a target property
Parameter Type Meaning userUserThe camera's user.
Returns vec3: The base value of the target property.
$ camera . set_clamp (user: User , property_index: int , priority: int , value: float , is_min: bool )
Tries to set the clamp value of a given property
Parameter Type Meaning userUserThe camera's user. property_indexintThe property index to update. priorityintA unique priority level. valuefloatThe value the clamp should be set to. is_minboolTrue if trying to set the minimum clamp value
$ camera . set_clip_planes_global (near: float , far: float )
Set the global near and far plane distances for the cameras in the level. Transient and should be called every frame in draw()
Parameter Type Meaning nearfloatNear plane distance farfloatFar plane distance
$ camera . set_debug_camera_fov (fov: float )
Sets the debug camera fov.
Parameter Type Meaning fovfloatThe camera fov, between 30 and 80.
$ camera . set_debug_camera_speed (speed: float )
Sets the debug camera speed.
Parameter Type Meaning speedfloatThe camera speed.
$ camera . set_manual_camera_enabled (index: int , enabled: bool , gamepad_enabled: bool )
Sets the value of the manual_camera_enabled and manual_camera_gamepad_enabled toggles.
Parameter Type Meaning indexintThe camera index. If no index is specified, it will use index 0. enabledboolWhether we want to enable the debug camera at the given index. gamepad_enabledboolWhether we want to enable gamepad controls for the debug camera at the given index.
$ camera . set_property (user: User , property_index: int , priority: int , value: float )
Does a priority check and tries to set the base value of a given property
Parameter Type Meaning userUserThe camera's user. property_indexintThe property index to update. priorityintA unique priority level. valuefloatThe value the property should be set to.
$ camera . set_spring (user: User , property_index: int , priority: int , value: float )
Tries to set the spring value of a given property
Parameter Type Meaning userUserThe camera's user. property_indexintThe property index to update. priorityintA unique priority level. valuefloatThe value the spring should be set to.
$ camera . set_target (user: User , priority: int , value: vec3 )
Tries to set the base value of a given target
Parameter Type Meaning userUserThe camera's user. priorityintA unique priority level. valuevec3The value the target should be set to.
$ camera . set_target_spring (user: User , priority: int , value: vec3 )
Tries to set the spring value of a given target
Parameter Type Meaning userUserThe camera's user. priorityintA unique priority level. valuevec3The value the spring should be set to.
$ camera . update_projection (mode: int , vfov: float , ortho_height: float , user: User , near: float , far: float , name: string , interpolation_id: int )
Update the camera projection matrix with the specified dimensions.
Parameter Type Meaning modeintProjection mode from k_camera_projection_mode*. vfovfloatFull vertical field of view in degrees, between 0 and 180 (exclusive) for perspective cameras; ignored for others. ortho_heightfloatHeight (positive non-zero) for ortho cameras; ignored for others. userUserThe camera's user. nearfloatnear plane distance of the camera. Using global settings when set to 0 farfloatfar plane distance of the camera. Using global settings when set to 0 namestring(optional) Camera name to control; if unset, default to user camera. interpolation_idint(optional) The interpolation id. Out thread won't interpolate across different interpolation_ids. If name is null, interpolation id will be an offset based on component and will never interpolate if different components are calling this function. Should not be decreasing to avoid (1->2->1) where the frame with 2 can be skipped at out.
$ camera . update_view (position: vec3 , rotation: vec4 , user: User , name: string , interpolation_id: int , pivot: vec3 )
Update the camera matrix with the specified position and rotation.
Parameter Type Meaning positionvec3The camera position. rotationvec4The camera rotation quaternion. userUserThe camera's user. namestring(optional) Camera name to control; if unset, default to user camera. interpolation_idint(optional) The interpolation id. Out thread won't interpolate across different interpolation_ids. If name is null, interpolation id will be an offset based on component and will never interpolate if different components are calling this function. Should not be decreasing to avoid (1->2->1) where the frame with 2 can be skipped at out. pivotvec3The pivot position used for interpolation. If set, camera will interpolate as "pivot+local offset+rotation" instead of "world position+rotation". This helps stabilize camera interpolation when rotating around an object.