15 float getX()
const {
return x_; }
16 float getY()
const {
return y_; }
17 float getZ()
const {
return z_; }
22 void set(
float x,
float y,
float z) {
29 float length()
const {
return std::sqrt(x_ * x_ + y_ * y_ + z_ * z_); }
37 float dot(
const Vec3 *other)
const;
3D float vector (script-facing math module value).
Vec3 * normalized() const
Vec3(float x, float y, float z)
Creates a vector from components.
Vec3 * cross(const Vec3 *other) const
Vec3 * clone() const
Copies this vector.
Vec3 * sub(const Vec3 *other) const
Vec3 * lerpTo(const Vec3 *other, float t) const
Linear interpolation to other at t in [0,1].
float length() const
Magnitude (and squared magnitude).
Vec3 * add(const Vec3 *other) const
Arithmetic helpers returning new (caller-owned) vectors.
float dot(const Vec3 *other) const
Dot/cross product and distance.
float distanceTo(const Vec3 *other) const
float lengthSquared() const
void normalize()
Normalizes in place / returns a normalized copy.
float getX() const
Component accessors.
void set(float x, float y, float z)
Sets all three components.