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:
parent
7d82eb6ee0
commit
601a34ba99
@ -421,6 +421,9 @@ public class CurvesHelper extends AbstractBlenderHelper {
|
|||||||
* @return scale on the pointed place along the curve
|
* @return scale on the pointed place along the curve
|
||||||
*/
|
*/
|
||||||
protected float getTaperScale(Spline taper, float percent) {
|
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);
|
percent = FastMath.clamp(percent, 0, 1);
|
||||||
List<Float> segmentLengths = taper.getSegmentsLength();
|
List<Float> segmentLengths = taper.getSegmentsLength();
|
||||||
float percentLength = taper.getTotalLength() * percent;
|
float percentLength = taper.getTotalLength() * percent;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user