saharan / OimoPhysics

A cross-platform 3D physics engine
MIT License
863 stars 68 forks source link

Cannot read property 'x' of null in FaceClipper.reduce #32

Closed cjbailey closed 2 years ago

cjbailey commented 4 years ago

It seems possible that min1, min2, min1V and min2V sometimes aren't being set (and remain null), leading to the error mentioned in the title.

This seems to happen during BoxBoxDetector. Spheres and Boxes appear to collide just fine.

TypeError Cannot read property 'x' of null oimo_collision_narrowphase_detector__$BoxBoxDetector_FaceClipper.reduce https://j4k75.csb.app/node_modules/oimophysics/OimoPhysics.js:1:156619 oimo_collision_narrowphase_detector_BoxBoxDetector.detectImpl https://j4k75.csb.app/node_modules/oimophysics/OimoPhysics.js:1:145380 oimo_collision_narrowphase_detector_BoxBoxDetector.detect https://j4k75.csb.app/node_modules/oimophysics/OimoPhysics.js:1:122639 oimo_dynamics_Contact._updateManifold https://j4k75.csb.app/node_modules/oimophysics/OimoPhysics.js:1:374223 oimo_dynamics_World._updateContacts https://j4k75.csb.app/node_modules/oimophysics/OimoPhysics.js:1:416406 oimo_dynamics_World.step https://j4k75.csb.app/node_modules/oimophysics/OimoPhysics.js:1:615737

saharan commented 3 years ago

Thank you for reporting. It looks like this may happen when vertices went infinity for some reason...

saharan commented 2 years ago

fixed in 1.2.2.