DOTS Geometry
 
Loading...
Searching...
No Matches
Float2Extension Class Reference

Static Public Member Functions

static bool ApproximatelyEquals (this float2 vec, float2 other, float epsilon=10e-5f)
 
static float3 AsFloat3 (this float2 vec, CardinalPlane cardinalPlane)
 
static bool ContainsInfinities (this float2 vec)
 
static bool ContaintsNaNs (this float2 vec)
 
static float2 Perpendicular (this float2 vec)
 Returns the perpendicular vector to the left (rotated counter-clockwise)
 

Static Public Attributes

static readonly float2 Down = new float2(0.0f, -1.0f)
 
static readonly float2 Left = new float2(-1.0f, 0.0f)
 
static readonly float2 Right = new float2(1.0f, 0.0f)
 
static readonly float2 Up = new float2(0.0f, 1.0f)
 

Member Function Documentation

◆ ApproximatelyEquals()

static bool ApproximatelyEquals ( this float2 vec,
float2 other,
float epsilon = 10e-5f )
static
Parameters
vec
other
epsilon
Returns
True if the values of the coordinates are all within epsilon or less from each other

◆ AsFloat3()

static float3 AsFloat3 ( this float2 vec,
CardinalPlane cardinalPlane )
static
Parameters
vec
cardinalPlane
Returns
Creates a float3 fomr a float2 with the free axis set to 0

◆ ContainsInfinities()

static bool ContainsInfinities ( this float2 vec)
static
Parameters
vec
Returns
True if the vector contains Infinities

◆ ContaintsNaNs()

static bool ContaintsNaNs ( this float2 vec)
static
Parameters
vec
Returns
True if the vector contains NaNs

◆ Perpendicular()

static float2 Perpendicular ( this float2 vec)
static

Returns the perpendicular vector to the left (rotated counter-clockwise)

Parameters
vec
Returns