Fixed an error that caused NullPointerException to be raised if a curve had no taper object applied.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10069 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
Kae..pl 2013-01-14 16:39:57 +00:00
parent 7d82eb6ee0
commit 601a34ba99

View File

@ -421,6 +421,9 @@ public class CurvesHelper extends AbstractBlenderHelper {
* @return scale on the pointed place along the curve
*/
protected float getTaperScale(Spline taper, float percent) {
if(taper == null) {
return 1;//return scale = 1 if no taper is applied
}
percent = FastMath.clamp(percent, 0, 1);
List<Float> segmentLengths = taper.getSegmentsLength();
float percentLength = taper.getTotalLength() * percent;