Page tree
Skip to end of metadata
Go to start of metadata

#include <Cry_Vector2.h>

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<typename F2 >
ILINE Vec2_tpl (const Vec2_tpl< F2 > &in)
 
ILINE Vec2_tpl (F vx, F vy)
 
ILINE Vec2_tplset (F nx, F ny)
 
template<class F1 >
ILINE Vec2_tpl (const F1 *psrc)
 
Vec2_tplNormalizeSafe (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_tplflip ()
 
ILINE Vec2_tplzero ()
 
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

x
 
y
 
 AUTO_STRUCT_INFO
 

Detailed Description

template<class F>
struct Vec2_tpl< F >

General-purpose 2D vector implementation

See also
Vec2, Vec2i

Member Function Documentation

◆ Perp()

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

◆ SetLerp()

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

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

◆ SetSlerp()

template<class F>
void Vec2_tpl< F >::SetSlerp ( const Vec2_tpl< F > &  p,
const Vec2_tpl< F > &  q,
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 );

  • No labels