17 float getX()
const {
return x_; }
19 float getY()
const {
return y_; }
21 float getZ()
const {
return z_; }
29 void set(
float x,
float y,
float z) {
36 float length()
const {
return std::sqrt(x_ * x_ + y_ * y_ + z_ * z_); }
42 Vec3 *normalized()
const;
45 float dot(
const Vec3 *other)
const;
46 Vec3 *cross(
const Vec3 *other)
const;
48 float distanceTo(
const Vec3 *other)
const;
55 Vec3 *lerpTo(
const Vec3 *other,
float t)
const;
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
std::array< float, 3 > scale
3D float vector (script-facing math module value).
Vec3(float x, float y, float z)
Creates a vector from components.
float getY() const
Y component.
float getZ() const
Z component.
void setX(float x)
Sets the X component.
float length() const
Magnitude (and squared magnitude).
void setY(float y)
Sets the Y component.
float lengthSquared() const
Squared Euclidean magnitude.
void setZ(float z)
Sets the Z component.
float getX() const
Component accessors.
void set(float x, float y, float z)
Sets all three components.