From c4ddff19fc9c9eac89757eef076d2c939cd31dc6 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 31 Mar 2005 00:32:04 +0000 Subject: [PATCH] local forces seem to be computed incorrectly --- panda/src/physics/baseIntegrator.cxx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/panda/src/physics/baseIntegrator.cxx b/panda/src/physics/baseIntegrator.cxx index ea16be7fc0..dd0f134d55 100644 --- a/panda/src/physics/baseIntegrator.cxx +++ b/panda/src/physics/baseIntegrator.cxx @@ -68,7 +68,7 @@ precompute_linear_matrices(Physical *physical, _precomputed_linear_matrices.reserve(global_force_vec_size + local_force_vec_size); NodePath physical_np(physical_node); - NodePath global_physical_np = physical_np.get_parent(); + NodePath parent_physical_np = physical_np.get_parent(); // tally the global xforms LinearForceVector::const_iterator fi; @@ -78,8 +78,7 @@ precompute_linear_matrices(Physical *physical, nassertv(force_node != (ForceNode *) NULL); NodePath force_np(force_node); - //_precomputed_linear_matrices.push_back(global_physical_np.get_mat(force_node)); - _precomputed_linear_matrices.push_back(force_np.get_mat(global_physical_np)); + _precomputed_linear_matrices.push_back(force_np.get_mat(parent_physical_np)); } // tally the local xforms @@ -89,7 +88,7 @@ precompute_linear_matrices(Physical *physical, nassertv(force_node != (ForceNode *) NULL); NodePath force_np(force_node); - _precomputed_linear_matrices.push_back(physical_np.get_mat(force_node)); + _precomputed_linear_matrices.push_back(force_np.get_mat(parent_physical_np)); } } @@ -122,7 +121,7 @@ precompute_angular_matrices(Physical *physical, _precomputed_angular_matrices.reserve(global_force_vec_size + local_force_vec_size); NodePath physical_np(physical_node); - NodePath global_physical_np = physical_np.get_parent(); + NodePath parent_physical_np = physical_np.get_parent(); // tally the global xforms AngularForceVector::const_iterator fi; @@ -131,8 +130,7 @@ precompute_angular_matrices(Physical *physical, nassertv(force_node != (ForceNode *) NULL); NodePath force_np(force_node); - //_precomputed_angular_matrices.push_back(physical_np.get_mat(force_node)); - _precomputed_angular_matrices.push_back(force_np.get_mat(global_physical_np)); + _precomputed_angular_matrices.push_back(force_np.get_mat(parent_physical_np)); } // tally the local xforms @@ -142,7 +140,7 @@ precompute_angular_matrices(Physical *physical, nassertv(force_node != (ForceNode *) NULL); NodePath force_np(force_node); - _precomputed_angular_matrices.push_back(physical_np.get_mat(force_node)); + _precomputed_angular_matrices.push_back(force_np.get_mat(parent_physical_np)); } }