Vector3
- Angle
- ClampMagnitude
- Cross
- Distance
- Dot
- forward
- Lerp
- magnitude
- Max
- Min
- MoveTowards
- normalized
- Normalize
- one
- operator !=
- operator *
- operator +
- operator -
- operator /
- operator ==
- OrthoNormalize
- Project
- Reflect
- right
- RotateTowards
- Scale
- Slerp
- SmoothDamp
- sqrMagnitude
- this [int index]
- ToString
- up
- Vector3
- x
- y
- zero
- z
Vector3.Reflect 反射
static function Reflect (inDirection : Vector3, inNormal : Vector3) : Vector3
Description描述
Reflects the vector along the normal.
沿着法线反射向量。
The returned value is inDirection reflected from a surface with a normal inNormal.
返回的值是被从带有法线inNormal的表面反射的inDirection。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public Transform originalObject;
public Transform reflectedObject;
void Update() {
eflectedObject.position = Vector3.Reflect(originalObject.position, Vector3.right);
}
}
var originalObject : Transform;
var reflectedObject : Transform;
function Update () {
// Makes the reflected object appear opposite of the original object,
// mirrored along the z-axis of the world
//使反射物体出现在原始物体的对面
//镜像是沿着世界的z轴
reflectedObject.position = Vector3.Reflect (originalObject.position, Vector3.right);
}
最后修改:2010年12月20日 Monday 16:42