Skip to content

Vector2 update #51

@TornadoTechnology

Description

@TornadoTechnology

We need to implement the following methods. If something is not described in enough detail, it is best to look at Untiy API: https://docs.unity3d.com/ScriptReference/

Static Properties

  • NaN
  • PositiveInfinity - Shorthand for writing Vector2(float.PositiveInfinity, float.PositiveInfinity)
  • NegativeInfinity - Shorthand for writing Vector2(float.NegativeInfinity, float.NegativeInfinity)
  • One
  • Zero
  • UnitX
  • UnitY

Properties

  • AspectRatio
  • LengthSquared
  • Length
  • Normalized
  • Angle
  • this - Access the x or y component using [0] or [1] respectively
  • Summation - The sum of all components of the vector, x + y
  • Production - The production of all components of the vector, x * y

Public Methods

  • Rotate
  • MoveTowards - Moves a point current towards target
  • DistanceSquared
  • Distance
  • Dot
  • Lerp
  • Max
  • Min
  • Abs
  • Sign
  • Floor
  • Ceiling
  • WithX
  • WithY
  • CompareTo(float)
  • CompareTo(Vector2)
  • Equals(Vector2)
  • Equals(object?)
  • GetHashCode
  • ToString

Static Methods

  • Lerp - Linearly interpolates between vectors a and b by t
  • Max
  • Min
  • Clamp
  • DistanceSquared
  • Distance
  • Dot- [x] MoveTowards - Moves a point current towards target

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions