moonshineTheleocat / bullet

Automatically exported from code.google.com/p/bullet
Other
0 stars 0 forks source link

btKinematicCharacterController::getNormalizedVector zero assertion #785

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of the product are you using?
bullet 282

code is:
32  btVector3 n = v.normalized();
33  if (n.length() < SIMD_EPSILON) {
34      n.setValue(0, 0, 0);
35  }

should be:

btVector3 n;
if(v.fuzzyZero()) {
    n.setValue(0, 0, 0);
} else {
    n = v.normalized();
}

Original issue reported on code.google.com by clemens....@gmail.com on 8 Jan 2014 at 1:30

GoogleCodeExporter commented 9 years ago
This assertion happens ALL over the place when using character controller.

I've seen other engines just simply return a 0,0,0 vector3 instead of crashing 
on the normalization method. You need about 3-4 guards to check for "fuzzyZero" 
before getting anywhere.

stepForwardAndStrafe : walkMove
convexSweepTest (if the start and end position are the same, it should just 
return, not throw an assertion)

I believe in release mode the crash won't happen and return a 0 vector, so why 
not just have a soft interrupt like a log message?

Original comment by AdventUn...@gmail.com on 17 Feb 2014 at 6:54

GoogleCodeExporter commented 9 years ago
moved to github https://github.com/bulletphysics/bullet3/issues/61

Original comment by erwin.coumans on 30 Mar 2014 at 5:04