载入中...
搜索中...
未找到
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
 Y component.
 
void setX (float x)
 Sets the X component.
 
void setY (float y)
 Sets the Y component.
 
void set (float x, float y)
 Sets both components.
 
float length () const
 Magnitude (and squared magnitude).
 
float lengthSquared () const
 Squared Euclidean magnitude.
 
void normalize ()
 Normalizes in place / returns a normalized copy.
 
Vec2 * normalized () const
 
float dot (const Vec2 *other) const
 Atan2 angle in radians.
 
float cross (const Vec2 *other) const
 Cross product with other.
 
float distanceTo (const Vec2 *other) const
 Euclidean distance to other.
 
float angle () const
 Atan2 angle in radians.
 
Vec2 * add (const Vec2 *other) const
 Arithmetic helpers returning new (caller-owned) vectors.
 
Vec2 * sub (const Vec2 *other) const
 
Vec2 * scale (float s) const
 
Vec2 * lerpTo (const Vec2 *other, float t) const
 Linear interpolation to other at t in [0,1].
 
Vec2 * clone () const
 Copies this vector.
 

详细描述

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

在文件 Vec2.h 第 10 行定义.

构造及析构函数说明

◆ 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.h 第 14 行定义.

成员函数说明

◆ add()

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

Arithmetic helpers returning new (caller-owned) vectors.

在文件 Vec2.cpp 第 42 行定义.

引用了 Vec2().

◆ angle()

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

Atan2 angle in radians.

在文件 Vec2.cpp 第 40 行定义.

◆ clone()

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

Copies this vector.

在文件 Vec2.cpp 第 59 行定义.

引用了 Vec2().

◆ cross()

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

Cross product with other.

在文件 Vec2.cpp 第 28 行定义.

◆ distanceTo()

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

Euclidean distance to other.

在文件 Vec2.cpp 第 33 行定义.

引用了 dx , 以及 dy.

◆ dot()

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

Atan2 angle in radians.

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

在文件 Vec2.cpp 第 23 行定义.

◆ getX()

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

Component accessors.

在文件 Vec2.h 第 17 行定义.

◆ getY()

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

Y component.

在文件 Vec2.h 第 19 行定义.

◆ length()

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

Magnitude (and squared magnitude).

在文件 Vec2.h 第 31 行定义.

被这些函数引用 normalize().

◆ lengthSquared()

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

Squared Euclidean magnitude.

在文件 Vec2.h 第 33 行定义.

◆ lerpTo()

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

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

在文件 Vec2.cpp 第 54 行定义.

引用了 t , 以及 Vec2().

◆ normalize()

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

Normalizes in place / returns a normalized copy.

在文件 Vec2.cpp 第 9 行定义.

引用了 length().

◆ normalized()

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

在文件 Vec2.cpp 第 17 行定义.

引用了 v , 以及 Vec2().

◆ scale()

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

在文件 Vec2.cpp 第 52 行定义.

引用了 s , 以及 Vec2().

◆ set()

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

Sets both components.

在文件 Vec2.h 第 25 行定义.

引用了 x , 以及 y.

◆ setX()

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

Sets the X component.

在文件 Vec2.h 第 21 行定义.

引用了 x.

◆ setY()

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

Sets the Y component.

在文件 Vec2.h 第 23 行定义.

引用了 y.

◆ sub()

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

在文件 Vec2.cpp 第 47 行定义.

引用了 Vec2().


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