physics-module-ammonext
physics-module-ammonext copied to clipboard
A possible typo and undefined attributes - reportConstraints function
Hello!
Ive been looking through your nice library and I found some puzzling things about the reportConstraints
function.
1. Typo
It seems like there might be a typo here where .lenght
should be .length
https://github.com/WhitestormJS/physics-module-ammonext/blob/5f58d67972789f9ac1dffa973305f4f5f0db419e/bundle-worker/physics-module.js#L3139
It also seems as if it was not fixed for quite a while.
2. .ta
attribute is defined conditionally
The .ta
attribute is set in the addConstraint
function for the slider
, conetwist
, and dof
types.
https://github.com/WhitestormJS/physics-module-ammonext/blob/5f58d67972789f9ac1dffa973305f4f5f0db419e/bundle-worker/physics-module.js#L2527-L2528
The .ta
attribute is only used in the reportConstraints
function for ALL constraints regardless of type.
https://github.com/WhitestormJS/physics-module-ammonext/blob/5f58d67972789f9ac1dffa973305f4f5f0db419e/bundle-worker/physics-module.js#L3141-L3158
Therefore, if you create a constraint that does not set the .ta
attribute, you will get an error when this function is run:
