class-description NEWS COMMUNITY STORE LABS SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE LABS TOGGLE FULLSCREEN VOLLBILD AN/AUS ObjectNodeNode3D CollisionObject3D
Abstract base class for 3D physics objects.

Abstract base class for 3D physics objects. CollisionObject3D can hold any number of Shape3Ds for collision. Each shape must be assigned to a shape owner. Shape owners are not nodes and do not appear in the editor, but are accessible through code using the shape_owner_* methods.

Warning: 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.

input_event input_event<>( Node camera=, camera:Node=, InputEvent event=, event:InputEvent=, Vector3 position=, position:Vector3=, Vector3 normal=, normal:Vector3=, int shape_idx=, shape_idx:int=, ):input_event

Emitted when the object receives an unhandled InputEvent. position is the location in world space of the mouse pointer on the surface of the shape with index shape_idx and normal is the normal vector of the surface at that point.

mouse_entered mouse_entered<>():mouse_entered

Emitted when the mouse pointer enters any of this object's shapes. Requires input_ray_pickable to be true and at least one collision_layer bit to be set.

Note: Due to the lack of continuous collision detection, this signal may not be emitted in the expected order if the mouse moves fast enough and the CollisionObject3D's area is small. This signal may also not be emitted if another CollisionObject3D is overlapping the CollisionObject3D in question.

mouse_exited mouse_exited<>():mouse_exited

Emitted when the mouse pointer exits all this object's shapes. Requires input_ray_pickable to be true and at least one collision_layer bit to be set.

Note: Due to the lack of continuous collision detection, this signal may not be emitted in the expected order if the mouse moves fast enough and the CollisionObject3D's area is small. This signal may also not be emitted if another CollisionObject3D is overlapping the CollisionObject3D in question.

Enum DisableMode<>():Enum

DISABLE_MODE_REMOVE = 0

When Node.process_mode is set to Node.PROCESS_MODE_DISABLED, remove from the physics simulation to stop all physics interactions with this CollisionObject3D.


DISABLE_MODE_MAKE_STATIC = 1

When Node.process_mode is set to Node.PROCESS_MODE_DISABLED, make the body static. Doesn't affect Area3D. PhysicsBody3D can't be affected by forces or other bodies while static.


DISABLE_MODE_KEEP_ACTIVE = 2

When Node.process_mode is set to Node.PROCESS_MODE_DISABLED, do not affect the physics simulation.

int collision_layer<>():int

The physics layers this CollisionObject3D is in. Collision objects can exist in one or more of 32 different layers. See also collision_mask.

Note: Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See Collision layers and masks in the documentation for more information.

int collision_mask<>():int

The physics layers this CollisionObject3D scans. Collision objects can scan one or more of 32 different layers. See also collision_layer.

Note: Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See Collision layers and masks in the documentation for more information.

float collision_priority<>():float

The priority used to solve colliding when occurring penetration. The higher the priority is, the lower the penetration into the object will be. This can for example be used to prevent the player from breaking through the boundaries of a level.

DisableMode disable_mode<>():DisableMode

Defines the behavior in physics when Node.process_mode is set to Node.PROCESS_MODE_DISABLED. See DisableMode for more details about the different modes.

bool input_capture_on_drag<>():bool

If true, the CollisionObject3D will continue to receive input events as the mouse is dragged across its shapes.

bool input_ray_pickable<>():bool

If true, this object is pickable. A pickable object can detect the mouse pointer entering/leaving, and if the mouse is inside it, report input events. Requires at least one collision_layer bit to be set.

void _input_event<>( Camera3D camera=, camera:Camera3D=, InputEvent event=, event:InputEvent=, Vector3 position=, position:Vector3=, Vector3 normal=, normal:Vector3=, int shape_idx=, shape_idx:int=, ):void

Receives unhandled InputEvents. position is the location in world space of the mouse pointer on the surface of the shape with index shape_idx and normal is the normal vector of the surface at that point. Connect to the input_event signal to easily pick up these events.

Note: _input_event requires input_ray_pickable to be true and at least one collision_layer bit to be set.

void _mouse_enter<>():void

Called when the mouse pointer enters any of this object's shapes. Requires input_ray_pickable to be true and at least one collision_layer bit to be set. Note that moving between different shapes within a single CollisionObject3D won't cause this function to be called.

void _mouse_exit<>():void

Called when the mouse pointer exits all this object's shapes. Requires input_ray_pickable to be true and at least one collision_layer bit to be set. Note that moving between different shapes within a single CollisionObject3D won't cause this function to be called.

int create_shape_owner<>( Object owner=, owner:Object=, ):int

Creates a new shape owner for the given object. Returns owner_id of the new owner for future reference.

bool get_collision_layer_value<>( int layer_number=, layer_number:int=, ):bool

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

bool get_collision_mask_value<>( int layer_number=, layer_number:int=, ):bool

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

RID get_rid<>():RID

Returns the object's RID.

PackedInt32Array get_shape_owners<>():PackedInt32Array

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

bool is_shape_owner_disabled<>( int owner_id=, owner_id:int=, ):bool

If true, the shape owner and its shapes are disabled.

void remove_shape_owner<>( int owner_id=, owner_id:int=, ):void

Removes the given shape owner.

void set_collision_layer_value<>( int layer_number=, layer_number:int=, bool value=, value:bool=, ):void

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

void set_collision_mask_value<>( int layer_number=, layer_number:int=, bool value=, value:bool=, ):void

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

int shape_find_owner<>( int shape_index=, shape_index:int=, ):int

Returns the owner_id of the given shape.

void shape_owner_add_shape<>( int owner_id=, owner_id:int=, Shape3D shape=, shape:Shape3D=, ):void

Adds a Shape3D to the shape owner.

void shape_owner_clear_shapes<>( int owner_id=, owner_id:int=, ):void

Removes all shapes from the shape owner.

Object shape_owner_get_owner<>( int owner_id=, owner_id:int=, ):Object

Returns the parent object of the given shape owner.

Shape3D shape_owner_get_shape<>( int owner_id=, owner_id:int=, int shape_id=, shape_id:int=, ):Shape3D

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

int shape_owner_get_shape_count<>( int owner_id=, owner_id:int=, ):int

Returns the number of shapes the given shape owner contains.

int shape_owner_get_shape_index<>( int owner_id=, owner_id:int=, int shape_id=, shape_id:int=, ):int

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

Transform3D shape_owner_get_transform<>( int owner_id=, owner_id:int=, ):Transform3D

Returns the shape owner's Transform3D.

void shape_owner_remove_shape<>( int owner_id=, owner_id:int=, int shape_id=, shape_id:int=, ):void

Removes a shape from the given shape owner.

void shape_owner_set_disabled<>( int owner_id=, owner_id:int=, bool disabled=, disabled:bool=, ):void

If true, disables the given shape owner.

void shape_owner_set_transform<>( int owner_id=, owner_id:int=, Transform3D transform=, transform:Transform3D=, ):void

Sets the Transform3D of the given shape owner.




All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...