Personal tools

Lua/Shared/Vector2

From JC2-MP Documentation

< Lua‎ | Shared
Jump to: navigation, search

Static functions

Returns Prototype
number Distance(Vector2, Vector2)
number DistanceSqr(Vector2, Vector2)
number Dot(Vector2, Vector2)
Vector2 Reflect(Vector2, Vector2)

Constructors

Constructor
Vector2(number, number)
Vector2()

Functions

Returns Prototype
number Distance(Vector2)
number DistanceSqr(Vector2)
number Dot(Vector2)
boolean IsNaN()
number Length()
number LengthSqr()
Normalize()
Vector2 Normalized()
Vector2 Reflect(Vector2)

Operators

Returns Prototype
Vector2 Vector2 + Vector2
Vector2 Vector2 / number
boolean Vector2 == Vector2
Vector2 Vector2 * number
Vector2 number * Vector2
Vector2 Vector2 - Vector2
string tostring(Vector2)
Vector2 -Vector2

Properties

Name Type
x number
y number

Statics

Name Value
Zero Vector2(0, 0)
One Vector2(1, 1)
Up Vector2(0, -1)
Down Vector2(0, 1)
Left Vector2(-1, 0)
Right Vector2(1, 0)