using System.Collections; using System.Collections.Generic; using UnityEngine; public class TestSlerp : MonoBehaviour { public Transform a; public Transform b; void Start() { } bool kaishi = false; float T; void Update() { if (Input.GetKeyDown(KeyCod
Quaternions are used to represent rotations. 四元数用于表示旋转. They are compact, don't suffer from gimbal lock and can easily be interpolated. Unity internally uses Quaternions to represent all rotations. 它们是紧凑的,不会出现万向节锁并且能够很容易被插值.Unity内使用Quaternion表示所有旋转.
在实际的项目开发中,一般需要程序抽象出一些在几何意义上有明确意义的参数,这样方便策划或美术在自己的机器上进行调试. 下面是一个可变参的地下城摄像机的简单实现: // 第三人称摄像机,平移和旋转会同时进行平滑 public class ThirdPersonalCamera : MonoBehaviour { /// Camera Control Params public GameObject Target = null; public float Distance = 10f; public