SpringArm

A helper node, mostly used in 3rd person cameras.

The SpringArm node is a node that casts a ray (or collision shape) along its z axis and moves all its direct children to the collision point, minus a margin. The most common use case for this is to make a 3rd person camera that reacts to collisions in the environment. The SpringArm will either cast a ray, or if a shape is given, it will cast the shape in the direction of its z axis. If you use the SpringArm as a camera controller for your player, you might need to exclude the player's collider from the SpringArm's collision check.

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

addExcludedObject
void addExcludedObject(RID RID)

Adds the PhysicsBody object with the given RID to the list of PhysicsBody objects excluded from the collision check.

clearExcludedObjects
void clearExcludedObjects()

Clears the list of PhysicsBody objects excluded from the collision check.

getCollisionMask
long getCollisionMask()
getHitLength
double getHitLength()

Returns the spring arm's current length.

getLength
double getLength()
getMargin
double getMargin()
getShape
Ref!Shape getShape()
opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(SpringArm other)
opEquals
bool opEquals(typeof(null) n)
removeExcludedObject
bool removeExcludedObject(RID RID)

Removes the given RID from the list of PhysicsBody objects excluded from the collision check.

setCollisionMask
void setCollisionMask(long mask)
setLength
void setLength(double length)
setMargin
void setMargin(double margin)
setShape
void setShape(Shape shape)
toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

collisionMask
long collisionMask [@property getter]
long collisionMask [@property setter]

The layers against which the collision check shall be done. See url=https://docs.godotengine.org/en/3.3/tutorials/physics/physics_introduction.html#collision-layers-and-masksCollision layers and masks/url in the documentation for more information.

margin
double margin [@property getter]
double margin [@property setter]

When the collision check is made, a candidate length for the SpringArm is given. The margin is then subtracted to this length and the translation is applied to the child objects of the SpringArm. This margin is useful for when the SpringArm has a Camera as a child node: without the margin, the Camera would be placed on the exact point of collision, while with the margin the Camera would be placed close to the point of collision.

shape
Shape shape [@property getter]
Shape shape [@property setter]

The Shape to use for the SpringArm. When the shape is set, the SpringArm will cast the Shape on its z axis instead of performing a ray cast.

springLength
double springLength [@property getter]
double springLength [@property setter]

The maximum extent of the SpringArm. This is used as a length for both the ray and the shape cast used internally to calculate the desired position of the SpringArm's child nodes. To know more about how to perform a shape cast or a ray cast, please consult the PhysicsDirectSpaceState documentation.

Static functions

_new
SpringArm _new()

Construct a new instance of SpringArm. Note: use memnew!SpringArm instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta