Vec2_tpl

#include

Inherits INumberVector< F, 2, Vec2_tpl< F > >.

Public Types

typedef INumberVector< F, 2, Vec2_tpl< F > > NV

Public Member Functions

ILINE Vec2_tpl (type_zero)
ILINE Vec2_tpl (F s)
template
ILINE Vec2_tpl (const Vec2_tpl< F2 > &in)
ILINE Vec2_tpl (F vx, F vy)
ILINE Vec2_tpl & set (F nx, F ny)
template
ILINE Vec2_tpl (const F1 *psrc)
Vec2_tpl & NormalizeSafe (const struct Vec2_tpl< F > &safe=Vec2Constants< F >::fVec2_Zero)
Normalize if non-0, otherwise set to specified "safe" value.
Vec2_tpl GetNormalizedSafe (const struct Vec2_tpl< F > &safe=Vec2Constants< F >::fVec2_OneX) const
ILINE F GetLength2 () const
void SetLength (F fLen)
ILINE F area () const
ILINE operator F* ()
ILINE Vec2_tpl & flip ()
ILINE Vec2_tpl & zero ()
ILINE Vec2_tpl rot90ccw () const
ILINE Vec2_tpl rot90cw () const
ILINE F atan2 () const
ILINE bool IsZeroFast (F e=(F) 0.0003) const
ILINE Vec2_tpl Perp () const
ILINE F Cross (const Vec2_tpl &v) const
The size of the "parallel-trapets" area spanned by the two vectors.
ILINE F operator^ (const Vec2_tpl &v) const
ILINE F operator* (const Vec2_tpl &v) const
ILINE bool operator== (const Vec2_tpl< F > &o) const
ILINE bool operator!= (const Vec2_tpl< F > &o) const
ILINE void SetLerp (const Vec2_tpl &p, const Vec2_tpl &q, F t)
void SetSlerp (const Vec2_tpl &p, const Vec2_tpl &q, F t)

Static Public Member Functions

static ILINE Vec2_tpl CreateLerp (const Vec2_tpl &p, const Vec2_tpl &q, F t)
static ILINE Vec2_tpl CreateSlerp (const Vec2_tpl &p, const Vec2_tpl &q, F t)

Public Attributes

F x
F y
AUTO_STRUCT_INFO

Detailed Description

template struct Vec2_tpl< F >

General-purpose 2D vector implementation

See also
Vec2, Vec2i

Member Function Documentation

◆ Perp()

template
ILINE Vec2_tpl Vec2_tpl< F >::Perp ( ) const
inline
Returns
A vector perpendicular to this one (this->Cross(newVec) points "up").

◆ SetLerp()

template
ILINE void Vec2_tpl< F >::SetLerp ( const Vec2_tpl< F > & p,
const Vec2_tpl< F > & q,
F t
)
inline

Linear-Interpolation between Vec3 (lerp). Example: Vec3 r=Vec3::CreateLerp( p, q, 0.345f );

◆ SetSlerp()

template
void Vec2_tpl< F >::SetSlerp ( const Vec2_tpl< F > & p,
const Vec2_tpl< F > & q,
F t
)
inline

Spherical-Interpolation between 3d-vectors (geometrical slerp). both vectors are assumed to be normalized. Example: Vec3 r=Vec3::CreateSlerp( p, q, 0.5674f );