Divide By Zero Error
by Jay Barnson · in Torque Game Engine · 01/19/2006 (10:23 pm) · 2 replies
Not sure what I'm doing to cause this, but in debug mode I'm getting a divide by zero error in sgShadow.cc at around line 165:
I've got some situation occuring where light->mPos is exactly equal to the ShapeBase's position --- probably because a lit explosion is originating at exactly the position of the unmoving object? Anyway, I'm just having it abort casting a shadow in this case for now.
lightDir = getPosition() - light->mPos; F32 len = lightDir.len(); lightDir /= len;
I've got some situation occuring where light->mPos is exactly equal to the ShapeBase's position --- probably because a lit explosion is originating at exactly the position of the unmoving object? Anyway, I'm just having it abort casting a shadow in this case for now.
About the author
Jay has been a mainstream and indie game developer for a... uh, long time. His professional start came in 1994 developing titles for the then-unknown and upcoming Sony Playstation. He runs Rampant Games and blogs at Tales of the Rampant Coyote.
Torque Owner John Kabus (BobTheCBuilder)
Here is what I added:
-John