summaryrefslogtreecommitdiff
path: root/servers/physics_3d/body_pair_3d_sw.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-06-03 23:07:21 +0200
committerGitHub <noreply@github.com>2021-06-03 23:07:21 +0200
commit5d9cab3aeb3c62df6b7b44e6e68c0ebbb67f7a45 (patch)
tree619055aeb386211fb83a7c861ab0f79a34aedb2d /servers/physics_3d/body_pair_3d_sw.cpp
parentea2a0b54554c09999d74212925322e8c7b2437e0 (diff)
parent0ac4051c00898b316ae11e7075d3f3a9e3c46be3 (diff)
Merge pull request #38430 from aaronfranke/transform3d
Diffstat (limited to 'servers/physics_3d/body_pair_3d_sw.cpp')
-rw-r--r--servers/physics_3d/body_pair_3d_sw.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/servers/physics_3d/body_pair_3d_sw.cpp b/servers/physics_3d/body_pair_3d_sw.cpp
index cdb3da665e..aed4815c5e 100644
--- a/servers/physics_3d/body_pair_3d_sw.cpp
+++ b/servers/physics_3d/body_pair_3d_sw.cpp
@@ -161,7 +161,7 @@ void BodyPair3DSW::validate_contacts() {
}
}
-bool BodyPair3DSW::_test_ccd(real_t p_step, Body3DSW *p_A, int p_shape_A, const Transform &p_xform_A, Body3DSW *p_B, int p_shape_B, const Transform &p_xform_B) {
+bool BodyPair3DSW::_test_ccd(real_t p_step, Body3DSW *p_A, int p_shape_A, const Transform3D &p_xform_A, Body3DSW *p_B, int p_shape_B, const Transform3D &p_xform_B) {
Vector3 motion = p_A->get_linear_velocity() * p_step;
real_t mlen = motion.length();
if (mlen < CMP_EPSILON) {
@@ -184,7 +184,7 @@ bool BodyPair3DSW::_test_ccd(real_t p_step, Body3DSW *p_A, int p_shape_A, const
Vector3 from = p_xform_A.xform(s);
Vector3 to = from + motion;
- Transform from_inv = p_xform_B.affine_inverse();
+ Transform3D from_inv = p_xform_B.affine_inverse();
Vector3 local_from = from_inv.xform(from - mnormal * mlen * 0.1); //start from a little inside the bounding box
Vector3 local_to = from_inv.xform(to);
@@ -240,12 +240,12 @@ bool BodyPair3DSW::setup(real_t p_step) {
validate_contacts();
const Vector3 &offset_A = A->get_transform().get_origin();
- Transform xform_Au = Transform(A->get_transform().basis, Vector3());
- Transform xform_A = xform_Au * A->get_shape_transform(shape_A);
+ Transform3D xform_Au = Transform3D(A->get_transform().basis, Vector3());
+ Transform3D xform_A = xform_Au * A->get_shape_transform(shape_A);
- Transform xform_Bu = B->get_transform();
+ Transform3D xform_Bu = B->get_transform();
xform_Bu.origin -= offset_A;
- Transform xform_B = xform_Bu * B->get_shape_transform(shape_B);
+ Transform3D xform_B = xform_Bu * B->get_shape_transform(shape_B);
Shape3DSW *shape_A_ptr = A->get_shape(shape_A);
Shape3DSW *shape_B_ptr = B->get_shape(shape_B);
@@ -571,7 +571,7 @@ void BodySoftBodyPair3DSW::contact_added_callback(const Vector3 &p_point_A, int
void BodySoftBodyPair3DSW::validate_contacts() {
// Make sure to erase contacts that are no longer valid.
- const Transform &transform_A = body->get_transform();
+ const Transform3D &transform_A = body->get_transform();
real_t contact_max_separation = space->get_contact_max_separation();
@@ -612,11 +612,11 @@ bool BodySoftBodyPair3DSW::setup(real_t p_step) {
return false;
}
- const Transform &xform_Au = body->get_transform();
- Transform xform_A = xform_Au * body->get_shape_transform(body_shape);
+ const Transform3D &xform_Au = body->get_transform();
+ Transform3D xform_A = xform_Au * body->get_shape_transform(body_shape);
- Transform xform_Bu = soft_body->get_transform();
- Transform xform_B = xform_Bu * soft_body->get_shape_transform(0);
+ Transform3D xform_Bu = soft_body->get_transform();
+ Transform3D xform_B = xform_Bu * soft_body->get_shape_transform(0);
validate_contacts();
@@ -647,7 +647,7 @@ bool BodySoftBodyPair3DSW::pre_solve(real_t p_step) {
bool do_process = false;
- const Transform &transform_A = body->get_transform();
+ const Transform3D &transform_A = body->get_transform();
uint32_t contact_count = contacts.size();
for (uint32_t contact_index = 0; contact_index < contact_count; ++contact_index) {