CollisionObject3D

package
v0.0.0-...-ae8aae0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package CollisionObject3D provides methods for working with CollisionObject3D object instances.

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
	AsCollisionObject3D() Instance
}

type DisableMode

type DisableMode = gdclass.CollisionObject3DDisableMode //gd:CollisionObject3D.DisableMode
const (
	/*When [member Node.process_mode] is set to [constant Node.PROCESS_MODE_DISABLED], remove from the physics simulation to stop all physics interactions with this [CollisionObject3D].
	  Automatically re-added to the physics simulation when the [Node] is processed again.*/
	DisableModeRemove DisableMode = 0
	/*When [member Node.process_mode] is set to [constant Node.PROCESS_MODE_DISABLED], make the body static. Doesn't affect [Area3D]. [PhysicsBody3D] can't be affected by forces or other bodies while static.
	  Automatically set [PhysicsBody3D] back to its original mode when the [Node] is processed again.*/
	DisableModeMakeStatic DisableMode = 1
	/*When [member Node.process_mode] is set to [constant Node.PROCESS_MODE_DISABLED], do not affect the physics simulation.*/
	DisableModeKeepActive DisableMode = 2
)

type Implementation

type Implementation = implementation

Implementation implements Interface with empty methods.

type Instance

type Instance [1]gdclass.CollisionObject3D

Abstract base class for 3D physics objects. [CollisionObject3D] can hold any number of [Shape3D]s for collision. Each shape must be assigned to a [i]shape owner[/i]. Shape owners are not nodes and do not appear in the editor, but are accessible through code using the [code]shape_owner_*[/code] methods. [b]Warning:[/b] With a non-uniform scale, this node will likely not behave as expected. It is advised to keep its scale the same on all axes and adjust its collision shape(s) instead.

See [Interface] for methods that can be overridden by a [Class] that extends it.

%!(EXTRA string=CollisionObject3D)

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsCollisionObject3D

func (self Instance) AsCollisionObject3D() Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsNode3D

func (self Instance) AsNode3D() Node3D.Instance

func (Instance) AsObject

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

func (Instance) CollisionLayer

func (self Instance) CollisionLayer() int

func (Instance) CollisionMask

func (self Instance) CollisionMask() int

func (Instance) CollisionPriority

func (self Instance) CollisionPriority() Float.X

func (Instance) CreateShapeOwner

func (self Instance) CreateShapeOwner(owner Object.Instance) int

Creates a new shape owner for the given object. Returns [code]owner_id[/code] of the new owner for future reference.

func (Instance) DisableMode

func (self Instance) DisableMode() gdclass.CollisionObject3DDisableMode

func (Instance) GetCollisionLayerValue

func (self Instance) GetCollisionLayerValue(layer_number int) bool

Returns whether or not the specified layer of the [member collision_layer] is enabled, given a [param layer_number] between 1 and 32.

func (Instance) GetCollisionMaskValue

func (self Instance) GetCollisionMaskValue(layer_number int) bool

Returns whether or not the specified layer of the [member collision_mask] is enabled, given a [param layer_number] between 1 and 32.

func (Instance) GetRid

func (self Instance) GetRid() RID.Body3D

Returns the object's [RID].

func (Instance) GetShapeOwners

func (self Instance) GetShapeOwners() []int32

Returns an [Array] of [code]owner_id[/code] identifiers. You can use these ids in other methods that take [code]owner_id[/code] as an argument.

func (Instance) InputCaptureOnDrag

func (self Instance) InputCaptureOnDrag() bool

func (Instance) InputRayPickable

func (self Instance) InputRayPickable() bool

func (Instance) IsShapeOwnerDisabled

func (self Instance) IsShapeOwnerDisabled(owner_id int) bool

If [code]true[/code], the shape owner and its shapes are disabled.

func (Instance) OnInputEvent

func (self Instance) OnInputEvent(cb func(camera [1]gdclass.Node, event [1]gdclass.InputEvent, event_position Vector3.XYZ, normal Vector3.XYZ, shape_idx int))

func (Instance) OnMouseEntered

func (self Instance) OnMouseEntered(cb func())

func (Instance) OnMouseExited

func (self Instance) OnMouseExited(cb func())

func (Instance) RemoveShapeOwner

func (self Instance) RemoveShapeOwner(owner_id int)

Removes the given shape owner.

func (Instance) SetCollisionLayer

func (self Instance) SetCollisionLayer(value int)

func (Instance) SetCollisionLayerValue

func (self Instance) SetCollisionLayerValue(layer_number int, value bool)

Based on [param value], enables or disables the specified layer in the [member collision_layer], given a [param layer_number] between 1 and 32.

func (Instance) SetCollisionMask

func (self Instance) SetCollisionMask(value int)

func (Instance) SetCollisionMaskValue

func (self Instance) SetCollisionMaskValue(layer_number int, value bool)

Based on [param value], enables or disables the specified layer in the [member collision_mask], given a [param layer_number] between 1 and 32.

func (Instance) SetCollisionPriority

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

func (Instance) SetDisableMode

func (self Instance) SetDisableMode(value gdclass.CollisionObject3DDisableMode)

func (Instance) SetInputCaptureOnDrag

func (self Instance) SetInputCaptureOnDrag(value bool)

func (Instance) SetInputRayPickable

func (self Instance) SetInputRayPickable(value bool)

func (Instance) ShapeFindOwner

func (self Instance) ShapeFindOwner(shape_index int) int

Returns the [code]owner_id[/code] of the given shape.

func (Instance) ShapeOwnerAddShape

func (self Instance) ShapeOwnerAddShape(owner_id int, shape [1]gdclass.Shape3D)

Adds a [Shape3D] to the shape owner.

func (Instance) ShapeOwnerClearShapes

func (self Instance) ShapeOwnerClearShapes(owner_id int)

Removes all shapes from the shape owner.

func (Instance) ShapeOwnerGetOwner

func (self Instance) ShapeOwnerGetOwner(owner_id int) Object.Instance

Returns the parent object of the given shape owner.

func (Instance) ShapeOwnerGetShape

func (self Instance) ShapeOwnerGetShape(owner_id int, shape_id int) [1]gdclass.Shape3D

Returns the [Shape3D] with the given ID from the given shape owner.

func (Instance) ShapeOwnerGetShapeCount

func (self Instance) ShapeOwnerGetShapeCount(owner_id int) int

Returns the number of shapes the given shape owner contains.

func (Instance) ShapeOwnerGetShapeIndex

func (self Instance) ShapeOwnerGetShapeIndex(owner_id int, shape_id int) int

Returns the child index of the [Shape3D] with the given ID from the given shape owner.

func (Instance) ShapeOwnerGetTransform

func (self Instance) ShapeOwnerGetTransform(owner_id int) Transform3D.BasisOrigin

Returns the shape owner's [Transform3D].

func (Instance) ShapeOwnerRemoveShape

func (self Instance) ShapeOwnerRemoveShape(owner_id int, shape_id int)

Removes a shape from the given shape owner.

func (Instance) ShapeOwnerSetDisabled

func (self Instance) ShapeOwnerSetDisabled(owner_id int, disabled bool)

If [code]true[/code], disables the given shape owner.

func (Instance) ShapeOwnerSetTransform

func (self Instance) ShapeOwnerSetTransform(owner_id int, transform Transform3D.BasisOrigin)

Sets the [Transform3D] of the given shape owner.

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

func (Instance) Virtual

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

type Interface

type Interface interface {
	//Receives unhandled [InputEvent]s. [param event_position] is the location in world space of the mouse pointer on the surface of the shape with index [param shape_idx] and [param normal] is the normal vector of the surface at that point. Connect to the [signal input_event] signal to easily pick up these events.
	//[b]Note:[/b] [method _input_event] requires [member input_ray_pickable] to be [code]true[/code] and at least one [member collision_layer] bit to be set.
	InputEvent(camera [1]gdclass.Camera3D, event [1]gdclass.InputEvent, event_position Vector3.XYZ, normal Vector3.XYZ, shape_idx int)
	//Called when the mouse pointer enters any of this object's shapes. Requires [member input_ray_pickable] to be [code]true[/code] and at least one [member collision_layer] bit to be set. Note that moving between different shapes within a single [CollisionObject3D] won't cause this function to be called.
	MouseEnter()
	//Called when the mouse pointer exits all this object's shapes. Requires [member input_ray_pickable] to be [code]true[/code] and at least one [member collision_layer] bit to be set. Note that moving between different shapes within a single [CollisionObject3D] won't cause this function to be called.
	MouseExit()
}

Jump to

Keyboard shortcuts

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