载入中...
搜索中...
未找到
eve::math::Vec2类 参考

2D float vector (script-facing math module value). 更多...

#include <Vec2.h>

Public 成员函数

 Vec2 ()=default
 
 Vec2 (float x, float y)
 Creates a vector from components.
 
float getX () const
 Component accessors.
 
float getY () const
 
void setX (float x)
 
void setY (float y)
 
void set (float x, float y)
 Sets both components.
 
float length () const
 Magnitude (and squared magnitude).
 
float lengthSquared () const
 
void normalize ()
 Normalizes in place / returns a normalized copy.
 
Vec2normalized () const
 
float dot (const Vec2 *other) const
 Dot/cross product, distance, angle (radians).
 
float cross (const Vec2 *other) const
 
float distanceTo (const Vec2 *other) const
 
float angle () const
 
Vec2add (const Vec2 *other) const
 Arithmetic helpers returning new (caller-owned) vectors.
 
Vec2sub (const Vec2 *other) const
 
Vec2scale (float s) const
 
Vec2lerpTo (const Vec2 *other, float t) const
 Linear interpolation to other at t in [0,1].
 
Vec2clone () const
 Copies this vector.
 

详细描述

2D float vector (script-facing math module value).

在文件 Vec2.h8 行定义.

构造及析构函数说明

◆ Vec2() [1/2]

eve::math::Vec2::Vec2 ( )
default

被这些函数引用 add(), clone(), lerpTo(), normalized(), scale() , 以及 sub().

◆ Vec2() [2/2]

eve::math::Vec2::Vec2 ( float  x,
float  y 
)
inline

Creates a vector from components.

在文件 Vec2.h12 行定义.

成员函数说明

◆ add()

Vec2 * eve::math::Vec2::add ( const Vec2 other) const

Arithmetic helpers returning new (caller-owned) vectors.

在文件 Vec2.cpp42 行定义.

引用了 Vec2().

◆ angle()

float eve::math::Vec2::angle ( ) const

在文件 Vec2.cpp40 行定义.

◆ clone()

Vec2 * eve::math::Vec2::clone ( ) const

Copies this vector.

在文件 Vec2.cpp59 行定义.

引用了 Vec2().

◆ cross()

float eve::math::Vec2::cross ( const Vec2 other) const

在文件 Vec2.cpp28 行定义.

◆ distanceTo()

float eve::math::Vec2::distanceTo ( const Vec2 other) const

在文件 Vec2.cpp33 行定义.

◆ dot()

float eve::math::Vec2::dot ( const Vec2 other) const

Dot/cross product, distance, angle (radians).

在文件 Vec2.cpp23 行定义.

◆ getX()

float eve::math::Vec2::getX ( ) const
inline

Component accessors.

在文件 Vec2.h15 行定义.

◆ getY()

float eve::math::Vec2::getY ( ) const
inline

在文件 Vec2.h16 行定义.

◆ length()

float eve::math::Vec2::length ( ) const
inline

Magnitude (and squared magnitude).

在文件 Vec2.h26 行定义.

被这些函数引用 normalize().

◆ lengthSquared()

float eve::math::Vec2::lengthSquared ( ) const
inline

在文件 Vec2.h27 行定义.

◆ lerpTo()

Vec2 * eve::math::Vec2::lerpTo ( const Vec2 other,
float  t 
) const

Linear interpolation to other at t in [0,1].

在文件 Vec2.cpp54 行定义.

引用了 Vec2().

◆ normalize()

void eve::math::Vec2::normalize ( )

Normalizes in place / returns a normalized copy.

在文件 Vec2.cpp9 行定义.

引用了 length().

◆ normalized()

Vec2 * eve::math::Vec2::normalized ( ) const

在文件 Vec2.cpp17 行定义.

引用了 v , 以及 Vec2().

◆ scale()

Vec2 * eve::math::Vec2::scale ( float  s) const

在文件 Vec2.cpp52 行定义.

引用了 s , 以及 Vec2().

◆ set()

void eve::math::Vec2::set ( float  x,
float  y 
)
inline

Sets both components.

在文件 Vec2.h20 行定义.

引用了 x , 以及 y.

◆ setX()

void eve::math::Vec2::setX ( float  x)
inline

在文件 Vec2.h17 行定义.

引用了 x.

◆ setY()

void eve::math::Vec2::setY ( float  y)
inline

在文件 Vec2.h18 行定义.

引用了 y.

◆ sub()

Vec2 * eve::math::Vec2::sub ( const Vec2 other) const

在文件 Vec2.cpp47 行定义.

引用了 Vec2().


该类的文档由以下文件生成: