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;
最后修改:2011年2月9日 Wednesday 19:52

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。