Skip to content

DataTypes: Vector3.hpp

Alanzote edited this page Dec 25, 2018 · 1 revision

A Vector3 is used for object positioning in the world of LEGO Universe. It consists of 3 float values: X, Y, and Z. A good explanation of vector arithmetics can be found on Unity's Docs.

Constructors

  • No Parameters
    • Constructs an Empty Vector3.
  • Vector Base
    • Constructs a vector with another one as base.
  • float x, float y, float z
    • Constructs a vector with x, y and z values.
  • float a
    • Constructs a vector with a single value.
  • RakNet::BitStream* bs
    • Constructs a vector by reading it from a bit stream.

Methods

  • sqrMagnitude
    • Return Type: float
    • Comment: Return the sqrMagnitude of this vector.
  • magnitude
    • Return Type: float
    • Comment: Returns the magnitude of this vector.
  • normalized
    • Return Type: Vector3
    • Comment: Returns this vector, normalized.
  • equals
    • Return Type: bool
    • Input Type: Vector3
    • Comment: Weather a Vector3 is equal another Vector3.
  • equals
    • Return Type: bool
    • Input Type: float
    • Comment: Weahter a vector has the same value for it's 3 axis.
  • set
    • Return Type: void
    • Input Types: float x, float y, float z
    • Comment: Sets the x, y and z values of a vector.
  • toString
    • Return Type: std::string
    • Comment: Formats this Vector3 into a string representation.
  • normalize
    • Return Type: float
    • Input Type: bool inverse
    • Comment: Normalizes the vector.

Static Methods

  • Dot
    • Return Type: float
    • Input Types: Vector3, Vector3
    • Comment: Returns the dot product between two vectors.
  • Cross
    • Return Type: Vector3
    • Input Types: Vector3, Vector3
    • Comment: Returns the cross between two vectors.
  • Angle
    • Return Type: float
    • Input Types: Vector3, Vector3
    • Comment: Returns the angle between two vectors.
  • ClampMagnitude
    • Return Type: Vector3
    • Input Types: Vector3 vector, float max length
    • Comment: Clamps the vector's magnitude up to a max length.
  • Distance
    • Return Type: float
    • Input Types: Vector3, Vector3
    • Comment: Returns the distance between two vectors.
  • Lerp
    • Return Type: Vector3
    • Input Types: Vector3 a, Vector3 b, float t
    • Comment: Lerps a vector to another by a rate. (clamped)
  • LerpUncampled
    • Return Type: Vector3
    • Input Types: Vector3 a, Vector3 b, float t
    • Comment: Lerps a vector to another by a rate. (unclamped)
  • Max
    • Return Type: Vector3
    • Input Types: Vector3, Vector3
    • Comment: Returns the Max between two vectors.
  • Min
    • Return Type: Vector3
    • Input Types: Vector3, Vector3
    • Comment: Returns the Min between two vectors.
  • MoveTowards
    • Return Type: Vector3
    • Input Types: Vector3 current, Vector3 target, float max distance delta
    • Comment: Moves a vector towards another.
  • Normalize
    • Return Type: Vector3
    • Input Type: Vector3
    • Comment: Normalizes a vector.
  • RotateTowards
    • Return Type: Vector3
    • Input Types: Vector3 current, Vector3 target, float max radians delta, float max magnitude delta
    • Comment: Rotates a vector towards another.
  • Scale
    • Return Type: Vector3
    • Input Types: Vector3, Vector3
    • Comment: Scales a vector with another.
  • SignedAngle
    • Return Type: float
    • Input Types: Vector3 from, Vector3 to, Vector3 axis
    • Comment: Gets the signed angle between two vectors on an axis.
  • Slerp
    • Return Type: Vector3
    • Input Types: Vector3, Vector3, float
    • Comment: Slerps a vector.

Static Properties

  • up
    • Return Type: Vector3
    • Comment: Static Vector3 that points up.
  • down
    • Return Type: Vector3
    • Comment: Static Vector3 that points down.
  • forward
    • Return Type: Vector3
    • Comment: Static Vector3 that points forward.
  • back
    • Return Type: Vector3
    • Comment: Static Vector3 that points backward.
  • left
    • Return Type: Vector3
    • Comment: Static Vector3 that points to the left.
  • right
    • Return Type: Vector3
    • Comment: Static Vector3 that points to the right.
  • positiveInfinity
    • Return Type: Vector3
    • Comment: Static Vector3 that points to positive infinity.
  • negativeInfinity
    • Return Type: Vector3
    • Comment: Static Vector3 that points to negative infinity.
  • one
    • Return Type: Vector3
    • Comment: Static Vector3 that has all 3 properties with static value of 1.
  • zero
    • Return Type: Vector3
    • Comment: Static Vector3 that has all 3 properties with static value of 0.

Operators

Vector3 supports the following operators: + (float and Vector3), - (float, Vector3), * (float, Vector3), / (float, Vector3), += (float, Vector3), -= (float, Vector3), *= (float, Vector3), /= (float, Vector3), == (float, Vector3), != (float, Vector3), [] (for accessbility, array operator to access x, y and z).

Clone this wiki locally