跳转至

3D 指针桥接

3D 鼠标或指针点击可使用 GFPointerInteraction3D 作为场景桥接节点。它监听绑定的 CollisionObject3D.input_eventmouse_enteredmouse_exited,把 hover、press、release、click、wheel 转为 GFInteractionContext

payload 中包含 pointer_positionpointer_normalpointer_shape_idxpointer_button_indexpointer_tagspointer_metadata 等通用字段。

var pointer := GFPointerInteraction3D.new()
pointer.interaction_id = &"inspect"
pointer.payload = { "source": "mouse" }
pointer.receiver_path = NodePath("../InteractionReceiver")
static_body.add_child(pointer)

默认只在 click 完成时发送交互;send_on_pressedsend_on_releasedsend_on_wheelsend_on_hover 可按需开启。桥接节点不会替项目判断距离、可见性、焦点、阵营、物品权限或点击后的效果,只负责把 Godot 3D 指针事件转换为 GF 通用交互上下文。