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
3.0
Kae..pl 12 years ago
parent 7d82eb6ee0
commit 601a34ba99
  1. 3
      engine/src/blender/com/jme3/scene/plugins/blender/curves/CurvesHelper.java

@ -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;

Loading…
Cancel
Save