ClippedCamera

Inherits: Camera < Spatial < Node < Object

A Camera that includes collision.

Description

This node extends Camera to add collisions with Area and/or PhysicsBody nodes. The camera cannot move through colliding objects.

Enumerations

enum ProcessMode:

  • CLIP_PROCESS_PHYSICS = 0 — The camera updates with the _physics_process callback.
  • CLIP_PROCESS_IDLE = 1 — The camera updates with the _process callback.

Property Descriptions

Defaultfalse
Setterset_clip_to_areas(value)
Getteris_clip_to_areas_enabled()

If true, the camera stops on contact with Areas.


Defaulttrue
Setterset_clip_to_bodies(value)
Getteris_clip_to_bodies_enabled()

If true, the camera stops on contact with PhysicsBodys.


  • int collision_mask
Default1
Setterset_collision_mask(value)
Getterget_collision_mask()

The camera’s collision mask. Only objects in at least one collision layer matching the mask will be detected.


Default0.0
Setterset_margin(value)
Getterget_margin()

The camera’s collision margin. The camera can’t get closer than this distance to a colliding object.


Default0
Setterset_process_mode(value)
Getterget_process_mode()

The camera’s process callback. See ProcessMode.

Method Descriptions

  • void add_exception ( Object node )

Adds a collision exception so the camera does not collide with the specified node.


  • void add_exception_rid ( RID rid )

Adds a collision exception so the camera does not collide with the specified RID.


  • void clear_exceptions ( )

Removes all collision exceptions.


  • float get_clip_offset ( ) const

Returns the distance the camera has been offset due to a collision.


  • bool get_collision_mask_bit ( int bit ) const

Returns true if the specified bit index is on.

Note: Bit indices range from 0-19.


  • void remove_exception ( Object node )

Removes a collision exception with the specified node.


  • void remove_exception_rid ( RID rid )

Removes a collision exception with the specified RID.


  • void set_collision_mask_bit ( int bit, bool value )

Sets the specified bit index to the value.

Note: Bit indices range from 0-19.

doradoro's advice! Getters and Setters will be deprecated! Avoid their use!

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 2020-03-07 at 01:30:41. It's the English Stable version because it's what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.