Rigidbody.interpolation 插值

var interpolation : RigidbodyInterpolation

Description描述

Interpolation allows you to smooth out the effect of running physics at a fixed frame rate.

插值允许你以固定的帧率平滑物理运行效果。

By default interpolation is turned off. Commonly rigidbody interpolation is used on the player's character. Physics is running at discrete timesteps, while graphics is renderered at variable frame rates. This can lead to jittery looking objects, because physics and graphics are not completely in sync. The effect is subtle but often visible on the player character, especially if a camera follows the main character. It is recommended to turn on interpolation for the main character but disable it for everything else.

插值默认是关闭的。通常刚体插值用于玩家角色。物理是不连续的时间步运行,而显卡以可变的帧率渲染。这可能导致物体抖动,因为物理和显卡不完全同步。这个效果是细微的但是通常会在玩家角色上看到,尤其是如果相机跟随主角色。建议为主角色打开插值,但其他的禁用。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public void Awake() {
		rigidbody.interpolation = RigidbodyInterpolation.Interpolate;
	}
}
// Make the rigidbody interpolate the graphics
//在该对象上使用刚体插值

rigidbody.interpolation = RigidbodyInterpolation.Interpolate;
Page last updated: 2013-7-17