📜  godot 3d 缓慢地向对象旋转 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:48.177000             🧑  作者: Mango

代码示例1
# Slowly rotate towards object in 3D space
func turn_face(target, rotationSpeed, delta):
    var global_pos = global_transform.origin
    var wtransform = global_transform.looking_at(Vector3(target.x,global_pos.y,target.z),Vector3(0,1,0))
    var wrotation = Quat(global_transform.basis).slerp(Quat(wtransform.basis), rotationSpeed*delta)

    global_transform = Transform(Basis(wrotation), global_transform.origin)