S&box Wiki

Vector2

Fields

static Vector2 Down
static Vector2 Left
static Vector2 One
Returns a Vector with every component set to 1
static Vector2 Right
static Vector2 Up
static Vector2 Zero
Returns a Vector with every component set to 0

Properties

bool IsNearZeroLength { get; }
returns true if the squared length is less than 1e-8 (which is really near zero)
float Length { get; }
Returns the magnitude of the vector
float LengthSquared { get; }
This is faster than Length, so is better to use in certain circumstances
Vector2 Normal { get; }
Return the same vector but with a length of one
static Vector2 Random { get; }
float x { get; set; }
float y { get; set; }

Methods

static Vector2 FromRadian( float radian )
TODO: Is this useful?
static double GetDistance( Vector2 a, Vector2 b )
static double GetDot( Vector2 a, Vector2 b )

Page Links


Special Pages


Wikis

?

Render Time: 41ms

DB GetPage 24
Generate Html 0
SaveChanges (1) 15
Render Body 0
Render Sidebar 0