Vec2F

Description

struct Tinman.Core.Math.Vectors.Vec2F

Derived from

IVec2Ops<Vec2F, float32>

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

Vec2​F


public constructor Vec2F → (2)

in : float32

X-coordinate of vector.

in : float32

Y-coordinate of vector.

Creates a new instance of Vec2F.

Public / Methods

Barycentric


[Pure]
public method Barycentric → (3)

in : Vec2F

First vertex of triangle.

in : Vec2F

Second vertex of triangle.

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 in, in and 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.

Serialization

Serializer


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

The serialization helper object for values of Vec2F.