ContactPoint.normal 法线

var normal : Vector3

Description描述

Normal of the contact point.

接触点的法线。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OnCollisionEnter(Collision other) {
		print("Points colliding: " + other.contacts.Length);
		print("First normal of the point that collide: " + other.contacts[0].normal);
	}
}
// Print how many points are colliding this transform
//打印这个变换有多少碰撞点
// And print the first point normal that is colliding.
//并打印第一个碰撞点的法线
function OnCollisionEnter(other : Collision) {
	print("Points colliding: " + other.contacts.Length);
	print("First normal of the point that collide: " + other.contacts[0].normal);
}
最后修改:2011年1月7日 Friday 21:51

本脚本参考基于Unity 3.4.1f5

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