diff --git a/panda/src/physics/linearEulerIntegrator.cxx b/panda/src/physics/linearEulerIntegrator.cxx index 5c34fd29f6..f50d976d9f 100644 --- a/panda/src/physics/linearEulerIntegrator.cxx +++ b/panda/src/physics/linearEulerIntegrator.cxx @@ -66,6 +66,12 @@ child_integrate(Physical *physical, // otherwise your transforms will be VERY bad. precompute_linear_matrices(physical, forces); const MatrixVector &matrices = get_precomputed_linear_matrices(); +#ifndef NDEBUG + MatrixVector::const_iterator mi; + for (mi = matrices.begin(); mi != matrices.end(); ++mi) { + nassertv(!(*mi).is_nan()); + } +#endif // NDEBUG // Get the greater of the local or global viscosity: float viscosityDamper=1.0f-physical->get_viscosity(); @@ -148,13 +154,16 @@ child_integrate(Physical *physical, // go from force space to object space f = cur_force->get_vector(current_object) * matrices[index++]; + nassertv(!f.is_nan()); physics_spam("child_integrate "<get_mass_dependent() == true) { md_accum_vec += f; + nassertv(!md_accum_vec.is_nan()); } else { non_md_accum_vec += f; + nassertv(!non_md_accum_vec.is_nan()); } } diff --git a/panda/src/physics/linearForce.cxx b/panda/src/physics/linearForce.cxx index ff55abcf0a..03405807da 100644 --- a/panda/src/physics/linearForce.cxx +++ b/panda/src/physics/linearForce.cxx @@ -68,6 +68,7 @@ LinearForce:: LVector3f LinearForce:: get_vector(const PhysicsObject *po) { LVector3f child_vector = get_child_vector(po) * _amplitude; + nassertr(!child_vector.is_nan(), LVector3f::zero()); if (_x_mask == false) child_vector[0] = 0.0f;