Plane.SetNormalAndPosition

Cambiar al Manual
public void SetNormalAndPosition (Vector3 inNormal, Vector3 inPoint);

Parámetros

inNormalEl vector normal del plano.
inPointUn punto que se encuentra en el plano.

Descripción

Establece un plano usando un punto que se encuentra dentro de él junto con una normal para orientarlo.

Tenga en cuenta que la normal debe ser un vector normalizada.

using UnityEngine;

public class Example : MonoBehaviour { public float fieldLength; public float fieldWidth; public Plane goalLine1; public Plane goalLine2; public Plane leftSideLine; public Plane rightSideLine;

void Start() { // Set up goal lines of a playing field. goalLine1.SetNormalAndPosition(Vector3.forward, Vector3.forward * fieldLength / 2); goalLine1.SetNormalAndPosition(-Vector3.forward, -Vector3.forward * fieldLength / 2);

// Set up side lines. leftSideLine.SetNormalAndPosition(-Vector3.right, -Vector3.right * fieldWidth / 2); leftSideLine.SetNormalAndPosition(Vector3.right, Vector3.right * fieldWidth / 2); } }

See Also: Set3Points.