mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-26 05:37:13 +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);
|
||||
}
|
||||
|
||||
void Vector3::snap(Vector3 p_val) {
|
||||
void Vector3::snap(const Vector3 &p_val) {
|
||||
x = Math::stepify(x, p_val.x);
|
||||
y = Math::stepify(y, p_val.y);
|
||||
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;
|
||||
v.snap(p_val);
|
||||
return v;
|
||||
|
@ -90,8 +90,8 @@ struct _NO_DISCARD_CLASS_ Vector3 {
|
||||
|
||||
_FORCE_INLINE_ void zero();
|
||||
|
||||
void snap(Vector3 p_val);
|
||||
Vector3 snapped(Vector3 p_val) const;
|
||||
void snap(const Vector3 &p_val);
|
||||
Vector3 snapped(const Vector3 &p_val) const;
|
||||
|
||||
void rotate(const Vector3 &p_axis, real_t p_phi);
|
||||
Vector3 rotated(const Vector3 &p_axis, real_t p_phi) const;
|
||||
|
Loading…
Reference in New Issue
Block a user