跳到主要内容

CollisionObject

继承

Spatial

简要描述

碰撞对象的基础节点。

描述

CollisionObject是物理对象的基类。

成员

类型属性名默认值
boolinput_capture_on_dragfalse
boolinput_ray_pickabletrue

方法

返回值类型方法名称
void_input_event(camera: Object, event: InputEvent, click_position: Vector3, click_normal: Vector3, shape_idx: int) virtual
intcreate_shape_owner(owner: Object)
RIDget_rid() const
Arrayget_shape_owners()
boolis_shape_owner_disabled(owner_id: int) const
voidremove_shape_owner(owner_id: int)
intshape_find_owner(shape_index: int) const
voidshape_owner_add_shape(owner_id: int, shape: Shape)
voidshape_owner_clear_shapes(owner_id: int)
Objectshape_owner_get_owner(owner_id: int) const
Shapeshape_owner_get_shape(owner_id: int, shape_id: int) const
intshape_owner_get_shape_count(owner_id: int) const
intshape_owner_get_shape_index(owner_id: int, shape_id: int) const
Transformshape_owner_get_transform(owner_id: int) const
voidshape_owner_remove_shape(owner_id: int, shape_id: int)
voidshape_owner_set_disabled(owner_id: int, disabled: bool)
voidshape_owner_set_transform(owner_id: int, transform: Transform)

信号

  • **input_event**

method_input_event收到事件时发出。


  • **mouse_entered**

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


  • **mouse_exited**

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


常量

成员说明

  • bool input_capture_on_drag
Defaultfalse
setterset_capture_input_on_drag(value)
getterget_capture_input_on_drag
  • bool input_ray_pickable
Defaulttrue
setterset_ray_pickable(value)
getteris_ray_pickable

方法说明

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

接受未处理的InputEvent


  • create_shape_owner create_shape_owner(owner: Object)

为给定对象创建一个新的形状。


  • get_rid get_rid() const

返回对象的RID


  • get_shape_owners get_shape_owners()

返回owner_id标识符的Array


  • is_shape_owner_disabled is_shape_owner_disabled(owner_id: int) const

如果true,则禁用形状及其形状。


  • remove_shape_owner remove_shape_owner(owner_id: int)

删除给定的形状。


  • shape_find_owner shape_find_owner(shape_index: int) const

返回给定形状的owner_id


  • shape_owner_add_shape shape_owner_add_shape(owner_id: int, shape: Shape)

Shape添加到形状。


  • shape_owner_clear_shapes shape_owner_clear_shapes(owner_id: int)

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


  • shape_owner_get_owner shape_owner_get_owner(owner_id: int) const

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


  • shape_owner_get_shape shape_owner_get_shape(owner_id: int, shape_id: int) const

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


  • shape_owner_get_shape_count shape_owner_get_shape_count(owner_id: int) const

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


  • shape_owner_get_shape_index shape_owner_get_shape_index(owner_id: int, shape_id: int) const

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


  • shape_owner_get_transform shape_owner_get_transform(owner_id: int) const

返回形状所有者的Transform


  • shape_owner_remove_shape shape_owner_remove_shape(owner_id: int, shape_id: int)

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


  • shape_owner_set_disabled shape_owner_set_disabled(owner_id: int, disabled: bool)

如果true,则禁用给定的形状。


  • shape_owner_set_transform shape_owner_set_transform(owner_id: int, transform: Transform)

设置给定形状的Transform