CollisionObject

Inherits: Spatial < Node < Object

继承人: AreaPhysicsBody

类别: 核心

简要说明

碰撞对象的基本节点。

方法

无效

_input_event ( Object camera, InputEvent event, Vector3 click_position, Vector3 click_normal, int shape_idx ) virtual

int

create_shape_owner ( Object owner )

RID

get_rid ( ) const

Array

get_shape_owners ( )

bool

is_shape_owner_disabled ( int owner_id ) const

无效

remove_shape_owner ( int owner_id )

int

shape_find_owner ( int shape_index ) const

无效

shape_owner_add_shape ( int owner_id, Shape shape )

无效

shape_owner_clear_shapes ( int owner_id )

Object

shape_owner_get_owner ( int owner_id ) const

Shape

shape_owner_get_shape ( int owner_id, int shape_id ) const

int

shape_owner_get_shape_count ( int owner_id ) const

int

shape_owner_get_shape_index ( int owner_id, int shape_id ) const

Transform

shape_owner_get_transform ( int owner_id ) const

无效

shape_owner_remove_shape ( int owner_id, int shape_id )

无效

shape_owner_set_disabled ( int owner_id, bool disabled )

无效

shape_owner_set_transform ( int owner_id, Transform transform )

信号

发射时间 _input_event 接收事件。详情请参见其说明。

  • mouse_entered ( )

当鼠标指针进入此对象的任何形状时发出。

  • mouse_exited ( )

当鼠标指针退出此对象的所有形状时发出。

描述

碰撞对象是物理对象的基类。它可以容纳任何数量的碰撞 Shape s.每个形状必须分配给 形状所有者 . 碰撞对象可以有任意数量的形状所有者。形状所有者不是节点,不会显示在编辑器中,但可以使用 shape_owner_* 方法。

属性描述

  • bool input_capture_on_drag

违约

设定器

设置拖动时的捕获输入(值)

吸气剂

在拖动()时获取捕获输入

如果 true , the CollisionObject 当鼠标被拖动过其形状时,将继续接收输入事件。

  • bool input_ray_pickable

违约

设定器

设置光线可拾取(值)

吸气剂

是可选择的吗?

如果 true , the CollisionObject 的形状将响应 RayCast S

方法说明

接受未处理的 InputEvent S click_position 是在世界空间中单击的位置 click_normal 是从 Shapeshape_idx . 连接到 input_event 信号可以很容易地接收到这些事件。

为给定对象创建新的形状所有者。退换商品 owner_id 以备将来参考。

  • RID get_rid ( ) const

返回对象的 RID .

  • Array get_shape_owners ( )

返回一个 Array 属于 owner_id 标识符。您可以在其他方法中使用这些ID owner_id 作为一个论点。

  • bool is_shape_owner_disabled ( int owner_id ) const

如果 true ,形状所有者及其形状被禁用。

  • void remove_shape_owner ( int owner_id )

删除给定的形状所有者。

  • int shape_find_owner ( int shape_index ) const

返回 owner_id 给定形状的。

  • void shape_owner_add_shape ( int owner_id, Shape shape )

添加一个 Shape 形状所有者。

  • void shape_owner_clear_shapes ( int owner_id )

从形状所有者中删除所有形状。

  • Object shape_owner_get_owner ( int owner_id ) const

返回给定形状所有者的父对象。

  • Shape shape_owner_get_shape ( int owner_id, int shape_id ) const

返回 Shape 具有给定形状所有者的给定ID。

  • int shape_owner_get_shape_count ( int owner_id ) const

返回给定形状所有者包含的形状数。

  • int shape_owner_get_shape_index ( int owner_id, int shape_id ) const

返回的子索引 Shape 具有给定形状所有者的给定ID。

  • Transform shape_owner_get_transform ( int owner_id ) const

返回形状所有者的 Transform .

  • void shape_owner_remove_shape ( int owner_id, int shape_id )

从给定形状所有者中删除形状。

  • void shape_owner_set_disabled ( int owner_id, bool disabled )

如果 true ,禁用给定的形状所有者。

  • void shape_owner_set_transform ( int owner_id, Transform transform )

设置 Transform 指定形状所有者的。