Representación de vectores y puntos 3D.
This structure is used throughout Unity to pass 3D positions and directions around.
También contiene funciones para realizar operaciones vectoriales comunes.
Besides the functions listed below, other classes can be used to manipulate vectors and points as well.
For example the Quaternion and the Matrix4x4 classes are useful for rotating or transforming vectors and points.
back | Shorthand for writing Vector3(0, 0, -1). |
down | Shorthand for writing Vector3(0, -1, 0). |
forward | Shorthand for writing Vector3(0, 0, 1). |
left | Shorthand for writing Vector3(-1, 0, 0). |
one | Shorthand for writing Vector3(1, 1, 1). |
right | Shorthand for writing Vector3(1, 0, 0). |
up | Shorthand for writing Vector3(0, 1, 0). |
zero | Shorthand for writing Vector3(0, 0, 0). |
magnitude | Returns the length of this vector (Read Only). |
normalized | Returns this vector with a magnitude of 1 (Read Only). |
sqrMagnitude | Returns the squared length of this vector (Read Only). |
this[int] | Acceda a los componentes x , y , z usando [0], [1], [2] respectivamente. |
x | Componente X del vector. |
y | Componente Y del vector. |
z | Componente Z del vector. |
Vector3 | Crea un nuevo vector con los componentes x, y, z. |
Set | Set x, y and z components of an existing Vector3. |
ToString | Returns a nicely formatted string for this vector. |
Angle | Devuelve el ángulo en grados entre from y to. |
ClampMagnitude | Returns a copy of vector with its magnitude clamped to maxLength. |
Cross | Producto vectorial de dos vectores. |
Distance | Devuelve la distancia entre a y b. |
Dot | Producto escalar de dos vetores. |
Lerp | Interpolación lineal entre dos vectores. |
LerpUnclamped | Interpolación lineal entre dos vectores. |
Max | Returns a vector that is made from the largest components of two vectors. |
Min | Returns a vector that is made from the smallest components of two vectors. |
MoveTowards | Moves a point current in a straight line towards a target point. |
Normalize | |
OrthoNormalize | Makes vectors normalized and orthogonal to each other. |
Project | Proyecta un vector sobre otro. |
ProjectOnPlane | Projects a vector onto a plane defined by a normal orthogonal to the plane. |
Reflect | Reflects a vector off the plane defined by a normal. |
RotateTowards | Rota el vectro current hacia target. |
Scale | Multiplies two vectors component-wise. |
Slerp | Spherically interpolates between two vectors. |
SlerpUnclamped | Spherically interpolates between two vectors. |
SmoothDamp | Gradually changes a vector towards a desired goal over time. |
operator - | Resta un vector a otro. |
operator != | Devuelve verdadero si los vectores son diferentes. |
operator * | Multiplica un vector por un número. |
operator / | Divide un vector por un número. |
operator + | Suma dos vectores. |
operator == | Devuelve true si dos vectores son iguales. |