summaryrefslogtreecommitdiffstats
path: root/scene/resources/capsule_shape.cpp
diff options
context:
space:
mode:
authorYuri Roubinsky <chaosus89@gmail.com>2020-02-23 21:41:31 +0300
committerYuri Roubinsky <chaosus89@gmail.com>2020-02-23 23:18:01 +0300
commit3b0638fe1c59d0065f5291265625d640301b4061 (patch)
tree366d6d1d826956ae8314b353a5d34354e73fae19 /scene/resources/capsule_shape.cpp
parent223c5ef8a3d07aa9b7fe226764ac473319c2d9cd (diff)
downloadredot-engine-3b0638fe1c59d0065f5291265625d640301b4061.tar.gz
Changed default capsule axis to vertical
Co-authored-by: Hugo Locurcio <https://hugo.pro>
Diffstat (limited to 'scene/resources/capsule_shape.cpp')
-rw-r--r--scene/resources/capsule_shape.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/scene/resources/capsule_shape.cpp b/scene/resources/capsule_shape.cpp
index 933129936a..d3458fb226 100644
--- a/scene/resources/capsule_shape.cpp
+++ b/scene/resources/capsule_shape.cpp
@@ -38,7 +38,7 @@ Vector<Vector3> CapsuleShape::get_debug_mesh_lines() {
Vector<Vector3> points;
- Vector3 d(0, 0, height * 0.5);
+ Vector3 d(0, height * 0.5, 0);
for (int i = 0; i < 360; i++) {
float ra = Math::deg2rad((float)i);
@@ -46,24 +46,24 @@ Vector<Vector3> CapsuleShape::get_debug_mesh_lines() {
Point2 a = Vector2(Math::sin(ra), Math::cos(ra)) * radius;
Point2 b = Vector2(Math::sin(rb), Math::cos(rb)) * radius;
- points.push_back(Vector3(a.x, a.y, 0) + d);
- points.push_back(Vector3(b.x, b.y, 0) + d);
+ points.push_back(Vector3(a.x, 0, a.y) + d);
+ points.push_back(Vector3(b.x, 0, b.y) + d);
- points.push_back(Vector3(a.x, a.y, 0) - d);
- points.push_back(Vector3(b.x, b.y, 0) - d);
+ points.push_back(Vector3(a.x, 0, a.y) - d);
+ points.push_back(Vector3(b.x, 0, b.y) - d);
if (i % 90 == 0) {
- points.push_back(Vector3(a.x, a.y, 0) + d);
- points.push_back(Vector3(a.x, a.y, 0) - d);
+ points.push_back(Vector3(a.x, 0, a.y) + d);
+ points.push_back(Vector3(a.x, 0, a.y) - d);
}
Vector3 dud = i < 180 ? d : -d;
- points.push_back(Vector3(0, a.y, a.x) + dud);
- points.push_back(Vector3(0, b.y, b.x) + dud);
- points.push_back(Vector3(a.y, 0, a.x) + dud);
- points.push_back(Vector3(b.y, 0, b.x) + dud);
+ points.push_back(Vector3(0, a.x, a.y) + dud);
+ points.push_back(Vector3(0, b.x, b.y) + dud);
+ points.push_back(Vector3(a.y, a.x, 0) + dud);
+ points.push_back(Vector3(b.y, b.x, 0) + dud);
}
return points;