summaryrefslogtreecommitdiff
path: root/servers/physics/shape_sw.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'servers/physics/shape_sw.cpp')
-rw-r--r--servers/physics/shape_sw.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/servers/physics/shape_sw.cpp b/servers/physics/shape_sw.cpp
index 6dafaac115..b204ff7a33 100644
--- a/servers/physics/shape_sw.cpp
+++ b/servers/physics/shape_sw.cpp
@@ -37,7 +37,7 @@
#define _EDGE_IS_VALID_SUPPORT_THRESHOLD 0.0002
#define _FACE_IS_VALID_SUPPORT_THRESHOLD 0.9998
-void ShapeSW::configure(const Rect3 &p_aabb) {
+void ShapeSW::configure(const AABB &p_aabb) {
aabb = p_aabb;
configured = true;
for (Map<ShapeOwnerSW *, int>::Element *E = owners.front(); E; E = E->next()) {
@@ -141,7 +141,7 @@ Vector3 PlaneShapeSW::get_moment_of_inertia(real_t p_mass) const {
void PlaneShapeSW::_setup(const Plane &p_plane) {
plane = p_plane;
- configure(Rect3(Vector3(-1e4, -1e4, -1e4), Vector3(1e4 * 2, 1e4 * 2, 1e4 * 2)));
+ configure(AABB(Vector3(-1e4, -1e4, -1e4), Vector3(1e4 * 2, 1e4 * 2, 1e4 * 2)));
}
void PlaneShapeSW::set_data(const Variant &p_data) {
@@ -223,7 +223,7 @@ Vector3 RayShapeSW::get_moment_of_inertia(real_t p_mass) const {
void RayShapeSW::_setup(real_t p_length) {
length = p_length;
- configure(Rect3(Vector3(0, 0, 0), Vector3(0.1, 0.1, length)));
+ configure(AABB(Vector3(0, 0, 0), Vector3(0.1, 0.1, length)));
}
void RayShapeSW::set_data(const Variant &p_data) {
@@ -299,7 +299,7 @@ Vector3 SphereShapeSW::get_moment_of_inertia(real_t p_mass) const {
void SphereShapeSW::_setup(real_t p_radius) {
radius = p_radius;
- configure(Rect3(Vector3(-radius, -radius, -radius), Vector3(radius * 2.0, radius * 2.0, radius * 2.0)));
+ configure(AABB(Vector3(-radius, -radius, -radius), Vector3(radius * 2.0, radius * 2.0, radius * 2.0)));
}
void SphereShapeSW::set_data(const Variant &p_data) {
@@ -430,7 +430,7 @@ void BoxShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_sup
bool BoxShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const {
- Rect3 aabb(-half_extents, half_extents * 2.0);
+ AABB aabb(-half_extents, half_extents * 2.0);
return aabb.intersects_segment(p_begin, p_end, &r_result, &r_normal);
}
@@ -504,7 +504,7 @@ void BoxShapeSW::_setup(const Vector3 &p_half_extents) {
half_extents = p_half_extents.abs();
- configure(Rect3(-half_extents, half_extents * 2));
+ configure(AABB(-half_extents, half_extents * 2));
}
void BoxShapeSW::set_data(const Variant &p_data) {
@@ -684,7 +684,7 @@ void CapsuleShapeSW::_setup(real_t p_height, real_t p_radius) {
height = p_height;
radius = p_radius;
- configure(Rect3(Vector3(-radius, -radius, -height * 0.5 - radius), Vector3(radius * 2, radius * 2, height + radius * 2.0)));
+ configure(AABB(Vector3(-radius, -radius, -height * 0.5 - radius), Vector3(radius * 2, radius * 2, height + radius * 2.0)));
}
void CapsuleShapeSW::set_data(const Variant &p_data) {
@@ -957,7 +957,7 @@ void ConvexPolygonShapeSW::_setup(const Vector<Vector3> &p_vertices) {
if (err != OK)
ERR_PRINT("Failed to build QuickHull");
- Rect3 _aabb;
+ AABB _aabb;
for (int i = 0; i < mesh.vertices.size(); i++) {
@@ -1102,7 +1102,7 @@ Vector3 FaceShapeSW::get_moment_of_inertia(real_t p_mass) const {
FaceShapeSW::FaceShapeSW() {
- configure(Rect3());
+ configure(AABB());
}
PoolVector<Vector3> ConcavePolygonShapeSW::get_faces() const {
@@ -1300,13 +1300,13 @@ void ConcavePolygonShapeSW::_cull(int p_idx, _CullParams *p_params) const {
}
}
-void ConcavePolygonShapeSW::cull(const Rect3 &p_local_aabb, Callback p_callback, void *p_userdata) const {
+void ConcavePolygonShapeSW::cull(const AABB &p_local_aabb, Callback p_callback, void *p_userdata) const {
// make matrix local to concave
if (faces.size() == 0)
return;
- Rect3 local_aabb = p_local_aabb;
+ AABB local_aabb = p_local_aabb;
// unlock data
PoolVector<Face>::Read fr = faces.read();
@@ -1341,7 +1341,7 @@ Vector3 ConcavePolygonShapeSW::get_moment_of_inertia(real_t p_mass) const {
struct _VolumeSW_BVH_Element {
- Rect3 aabb;
+ AABB aabb;
Vector3 center;
int face_index;
};
@@ -1372,7 +1372,7 @@ struct _VolumeSW_BVH_CompareZ {
struct _VolumeSW_BVH {
- Rect3 aabb;
+ AABB aabb;
_VolumeSW_BVH *left;
_VolumeSW_BVH *right;
@@ -1396,7 +1396,7 @@ _VolumeSW_BVH *_volume_sw_build_bvh(_VolumeSW_BVH_Element *p_elements, int p_siz
bvh->face_index = -1;
}
- Rect3 aabb;
+ AABB aabb;
for (int i = 0; i < p_size; i++) {
if (i == 0)
@@ -1467,7 +1467,7 @@ void ConcavePolygonShapeSW::_setup(PoolVector<Vector3> p_faces) {
int src_face_count = p_faces.size();
if (src_face_count == 0) {
- configure(Rect3());
+ configure(AABB());
return;
}
ERR_FAIL_COND(src_face_count % 3);
@@ -1491,7 +1491,7 @@ void ConcavePolygonShapeSW::_setup(PoolVector<Vector3> p_faces) {
PoolVector<Vector3>::Write vw = vertices.write();
Vector3 *verticesw = vw.ptr();
- Rect3 _aabb;
+ AABB _aabb;
for (int i = 0; i < src_face_count; i++) {
@@ -1588,7 +1588,7 @@ Vector3 HeightMapShapeSW::get_closest_point_to(const Vector3 &p_point) const {
return Vector3();
}
-void HeightMapShapeSW::cull(const Rect3 &p_local_aabb, Callback p_callback, void *p_userdata) const {
+void HeightMapShapeSW::cull(const AABB &p_local_aabb, Callback p_callback, void *p_userdata) const {
}
Vector3 HeightMapShapeSW::get_moment_of_inertia(real_t p_mass) const {
@@ -1611,7 +1611,7 @@ void HeightMapShapeSW::_setup(PoolVector<real_t> p_heights, int p_width, int p_d
PoolVector<real_t>::Read r = heights.read();
- Rect3 aabb;
+ AABB aabb;
for (int i = 0; i < depth; i++) {