PhysicsTestMotionParameters2D

package
v0.0.0-...-357ca8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

By changing various properties of this object, such as the motion, you can configure the parameters for PhysicsServer2D.BodyTestMotion.

Index

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 Any

type Any interface {
	gd.IsClass
	AsPhysicsTestMotionParameters2D() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

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]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsPhysicsTestMotionParameters2D

func (self *Extension[T]) AsPhysicsTestMotionParameters2D() Instance

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

type ID

type ID Object.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.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

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 New

func New() Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsPhysicsTestMotionParameters2D

func (self Instance) AsPhysicsTestMotionParameters2D() Instance

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) CollideSeparationRay

func (self Instance) CollideSeparationRay() bool

If set to true, shapes of type [Physicsserver2d.ShapeSeparationRay] are used to detect collisions and can stop the motion. Can be useful when snapping to the ground.

If set to false, shapes of type [Physicsserver2d.ShapeSeparationRay] are only used for separation when overlapping with other bodies. That's the main use for separation ray shapes.

func (Instance) ExcludeBodies

func (self Instance) ExcludeBodies() []RID.Any

Optional array of body Resource.ID to exclude from collision. Use CollisionObject2D.GetRid to get the Resource.ID associated with a CollisionObject2D-derived node.

func (Instance) ExcludeObjects

func (self Instance) ExcludeObjects() []int

Optional array of object unique instance ID to exclude from collision. See Object.GetInstanceId.

func (Instance) From

func (self Instance) From() Transform2D.OriginXY

Transform in global space where the motion should start. Usually set to Node2D.GlobalTransform for the current body's transform.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) Margin

func (self Instance) Margin() Float.X

Increases the size of the shapes involved in the collision detection.

func (Instance) Motion

func (self Instance) Motion() Vector2.XY

Motion vector to define the length and direction of the motion to test.

func (Instance) RecoveryAsCollision

func (self Instance) RecoveryAsCollision() bool

If set to true, any depenetration from the recovery phase is reported as a collision; this is used e.g. by CharacterBody2D for improving floor detection during floor snapping.

If set to false, only collisions resulting from the motion are reported, which is generally the desired behavior.

func (Instance) SetCollideSeparationRay

func (self Instance) SetCollideSeparationRay(value bool)

SetCollideSeparationRay sets the property returned by [IsCollideSeparationRayEnabled].

func (Instance) SetExcludeBodies

func (self Instance) SetExcludeBodies(value []RID.Any)

SetExcludeBodies sets the property returned by [GetExcludeBodies].

func (Instance) SetExcludeObjects

func (self Instance) SetExcludeObjects(value []int)

SetExcludeObjects sets the property returned by [GetExcludeObjects].

func (Instance) SetFrom

func (self Instance) SetFrom(value Transform2D.OriginXY)

SetFrom sets the property returned by [GetFrom].

func (Instance) SetMargin

func (self Instance) SetMargin(value Float.X)

SetMargin sets the property returned by [GetMargin].

func (Instance) SetMotion

func (self Instance) SetMotion(value Vector2.XY)

SetMotion sets the property returned by [GetMotion].

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetRecoveryAsCollision

func (self Instance) SetRecoveryAsCollision(value bool)

SetRecoveryAsCollision sets the property returned by [IsRecoveryAsCollisionEnabled].

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL