Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete set_all, set_axis, and get_axis methods from Vector2/3/3i/4/4i #66133

Merged
merged 2 commits into from
Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove set_all methods from Vector2/3/4
  • Loading branch information
aaronfranke committed Sep 19, 2022
commit 436dcb3286da5cfa7e5249ee323c6970b0ecb58a
8 changes: 6 additions & 2 deletions core/math/bvh_abb.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ struct BVH_ABB {

void expand(real_t p_change) {
POINT change;
change.set_all(p_change);
for (int axis = 0; axis < POINT::AXIS_COUNT; ++axis) {
change[axis] = p_change;
}
grow(change);
}

Expand All @@ -262,7 +264,9 @@ struct BVH_ABB {
}

void set_to_max_opposite_extents() {
neg_max.set_all(FLT_MAX);
for (int axis = 0; axis < POINT::AXIS_COUNT; ++axis) {
neg_max[axis] = FLT_MAX;
}
min = neg_max;
}

Expand Down
4 changes: 0 additions & 4 deletions core/math/vector2.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ struct _NO_DISCARD_ Vector2 {
return coord[p_idx];
}

_FORCE_INLINE_ void set_all(const real_t p_value) {
x = y = p_value;
}

_FORCE_INLINE_ Vector2::Axis min_axis_index() const {
return x < y ? Vector2::AXIS_X : Vector2::AXIS_Y;
}
Expand Down
4 changes: 0 additions & 4 deletions core/math/vector3.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ struct _NO_DISCARD_ Vector3 {
return coord[p_axis];
}

_FORCE_INLINE_ void set_all(const real_t p_value) {
x = y = z = p_value;
}

_FORCE_INLINE_ Vector3::Axis min_axis_index() const {
return x < y ? (x < z ? Vector3::AXIS_X : Vector3::AXIS_Z) : (y < z ? Vector3::AXIS_Y : Vector3::AXIS_Z);
}
Expand Down
6 changes: 0 additions & 6 deletions core/math/vector4.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ struct _NO_DISCARD_ Vector4 {
return components[p_axis];
}

_FORCE_INLINE_ void set_all(const real_t p_value);

Vector4::Axis min_axis_index() const;
Vector4::Axis max_axis_index() const;

Expand Down Expand Up @@ -145,10 +143,6 @@ struct _NO_DISCARD_ Vector4 {
}
};

void Vector4::set_all(const real_t p_value) {
x = y = z = p_value;
}

real_t Vector4::dot(const Vector4 &p_vec4) const {
return x * p_vec4.x + y * p_vec4.y + z * p_vec4.z + w * p_vec4.w;
}
Expand Down