mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-26 13:47:12 +01:00
Made the parameter of snap and snapped in Vector3 const reference.
This commit is contained in:
parent
5cb00f3622
commit
2b24871814
@ -51,12 +51,12 @@ real_t Vector3::get_axis(int p_axis) const {
|
|||||||
return operator[](p_axis);
|
return operator[](p_axis);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Vector3::snap(Vector3 p_val) {
|
void Vector3::snap(const Vector3 &p_val) {
|
||||||
x = Math::stepify(x, p_val.x);
|
x = Math::stepify(x, p_val.x);
|
||||||
y = Math::stepify(y, p_val.y);
|
y = Math::stepify(y, p_val.y);
|
||||||
z = Math::stepify(z, p_val.z);
|
z = Math::stepify(z, p_val.z);
|
||||||
}
|
}
|
||||||
Vector3 Vector3::snapped(Vector3 p_val) const {
|
Vector3 Vector3::snapped(const Vector3 &p_val) const {
|
||||||
Vector3 v = *this;
|
Vector3 v = *this;
|
||||||
v.snap(p_val);
|
v.snap(p_val);
|
||||||
return v;
|
return v;
|
||||||
|
@ -90,8 +90,8 @@ struct _NO_DISCARD_CLASS_ Vector3 {
|
|||||||
|
|
||||||
_FORCE_INLINE_ void zero();
|
_FORCE_INLINE_ void zero();
|
||||||
|
|
||||||
void snap(Vector3 p_val);
|
void snap(const Vector3 &p_val);
|
||||||
Vector3 snapped(Vector3 p_val) const;
|
Vector3 snapped(const Vector3 &p_val) const;
|
||||||
|
|
||||||
void rotate(const Vector3 &p_axis, real_t p_phi);
|
void rotate(const Vector3 &p_axis, real_t p_phi);
|
||||||
Vector3 rotated(const Vector3 &p_axis, real_t p_phi) const;
|
Vector3 rotated(const Vector3 &p_axis, real_t p_phi) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user