Documentation
¶
Overview ¶
SpringArm3D casts a ray or a shape along its Z axis and moves all its direct children to the collision point, with an optional margin. This is useful for 3rd person cameras that move closer to the player when inside a tight space (you may need to exclude the player's collider from the SpringArm3D's collision check).
Index ¶
- type Advanced
- type Any
- type Extension
- type ID
- type Instance
- func (self Instance) AddExcludedObject(rid RID.Body3D)
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode3D() Node3D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsSpringArm3D() Instance
- func (self Instance) ClearExcludedObjects()
- func (self Instance) CollisionMask() int
- func (self Instance) GetHitLength() Float.X
- func (self Instance) ID() ID
- func (self Instance) Margin() Float.X
- func (self Instance) RemoveExcludedObject(rid RID.Body3D) bool
- func (self Instance) SetCollisionMask(value int)
- func (self Instance) SetMargin(value Float.X)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetShape(value Shape3D.Instance)
- func (self Instance) SetSpringLength(value Float.X)
- func (self Instance) Shape() Shape3D.Instance
- func (self Instance) SpringLength() Float.X
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsSpringArm3D ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.SpringArm3D
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddExcludedObject ¶
Adds the PhysicsBody3D object with the given Resource.ID to the list of PhysicsBody3D objects excluded from the collision check.
func (Instance) AsSpringArm3D ¶
func (Instance) ClearExcludedObjects ¶
func (self Instance) ClearExcludedObjects()
Clears the list of PhysicsBody3D objects excluded from the collision check.
func (Instance) CollisionMask ¶
The layers against which the collision check shall be done. See Collision layers and masks in the documentation for more information.
func (Instance) GetHitLength ¶
Returns the spring arm's current length.
func (Instance) Margin ¶
When the collision check is made, a candidate length for the SpringArm3D is given.
The margin is then subtracted to this length and the translation is applied to the child objects of the SpringArm3D.
This margin is useful for when the SpringArm3D has a Camera3D as a child node: without the margin, the Camera3D would be placed on the exact point of collision, while with the margin the Camera3D would be placed close to the point of collision.
func (Instance) RemoveExcludedObject ¶
Removes the given Resource.ID from the list of PhysicsBody3D objects excluded from the collision check.
func (Instance) SetCollisionMask ¶
SetCollisionMask sets the property returned by [GetCollisionMask].
func (Instance) SetSpringLength ¶
SetSpringLength sets the property returned by [GetLength].
func (Instance) Shape ¶
The Shape3D to use for the SpringArm3D.
When the shape is set, the SpringArm3D will cast the Shape3D on its z axis instead of performing a ray cast.
func (Instance) SpringLength ¶
The maximum extent of the SpringArm3D. This is used as a length for both the ray and the shape cast used internally to calculate the desired position of the SpringArm3D's child nodes.
To know more about how to perform a shape cast or a ray cast, please consult the PhysicsDirectSpaceState3D documentation.