Vec2F

Description

struct Tinman.Core.Math.Vectors.Vec2F

A two-dimensional vector with 32-bit floating-point precision.

/     \
|  X  |
|  Y  |
\     /

Public / Constants

Undefined


public static readonly attribute Undefined → (Vec2F)

A vector with undefined value.

Zero


public static readonly attribute Zero → (Vec2F)

The zero vector.

Public / Constructors

Vec2F


public constructor Vec2F → (2)

x in : float32

X-coordinate of vector.

y in : float32

Y-coordinate of vector.

Creates a new instance of Vec2F.

Public / Methods

Barycentric


[Pure]
public method Barycentric → (3)

a in : Vec2F

First vertex of triangle.

b in : Vec2F

Second vertex of triangle.

c in : Vec2F

Third vertex of triangle.

returns → Vec3F

The barycentric coordinates of this vector, where Vec3F.X, Vec3F.Y and Vec3F.Z represent the weights for the triangle vertices a in, b in and c in (in this order). This vector lies inside of the given triangle iff Vec3F.X, Vec3F.Y and Vec3F.Z are non-negative.

Computes the barycentric coordinates of this vector in the given triangle.

Public / Attributes

X


public readonly attribute X → (float32)

X-coordinate of vector.

Y


public readonly attribute Y → (float32)

Y-coordinate of vector.

Configuration

Config


public static attribute Config → (get)

value : IConfigurator<Vec2D>

[not-null]
The configurator object.

The configurator object for this type.

See also

Vec.To2D3

Serialization

Serializer


public static readonly attribute Serializer → (ITypeSerializerEx<Vec2F>)

The serialization helper object for values of Vec2F.