Bugfix: fixed a bug that caused NURB lines did not use their proper

resolution.
cleanup_build_scripts
jmekaelthas 9 years ago
parent 7e185b25df
commit 8958459ef9
  1. 7
      jme3-core/src/main/java/com/jme3/scene/shape/Curve.java

@ -198,6 +198,12 @@ public class Curve extends Mesh {
* points * points
*/ */
private void createNurbMesh(int nbSubSegments) { private void createNurbMesh(int nbSubSegments) {
if(spline.getControlPoints() != null && spline.getControlPoints().size() > 0) {
if(nbSubSegments == 0) {
nbSubSegments = spline.getControlPoints().size() + 1;
} else {
nbSubSegments = spline.getControlPoints().size() * nbSubSegments + 1;
}
float minKnot = spline.getMinNurbKnot(); float minKnot = spline.getMinNurbKnot();
float maxKnot = spline.getMaxNurbKnot(); float maxKnot = spline.getMaxNurbKnot();
float deltaU = (maxKnot - minKnot) / nbSubSegments; float deltaU = (maxKnot - minKnot) / nbSubSegments;
@ -228,6 +234,7 @@ public class Curve extends Mesh {
this.updateBound(); this.updateBound();
this.updateCounts(); this.updateCounts();
} }
}
private void createLinearMesh() { private void createLinearMesh() {
float[] array = new float[spline.getControlPoints().size() * 3]; float[] array = new float[spline.getControlPoints().size() * 3];

Loading…
Cancel
Save