Verctor3 Information And Methods Flashcards

1
Q

Vector3
Representation of 3D vectors and points.
This structure is used throughout unity to pass 3D positions and directions around. It also contains functions for doing common vector operations.

A

Other classes can be used to manipulate vectors and points as well. For example Quaternion and Matrix4x4 classes are useful for rotating or transforming vectors and points.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Vector3 Static Properties list

A

Back (0.0-1)
Down(0.-1.0)
Forward(0.0.1)
Left(-1.0.0)
NegativeInfinity( Shorthand for writing Vector3, float.NegavtiveInfinity, float.NegavtiveInfinity, float.NegavtiveInfinity)
One, shorthand for writing Vector3 (1.1.1)
PositiveInfinity, shorthand for writing Vector3 (float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity)
Right, shorthand for writing Vector3 (1.0.0)
Up(0.1.0)
Zero(0.0.0)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Vector3 is a Constructor that creates a new vector with given x, y, z components

A

Properties
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], Access the x, y, z components using[0],[1],[2] respectively
X, x component of the vector
Y, y component of the vector
Z, z component of the vector

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Operators in unity

A
  • subtracts one vector from another
    ! = Returns true of vectors are different
  • Multiplies a vector by a number
    / Divides a vector by a number
    + Adds two vectors
    == Returns true of two vectors are approximately equal.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly