added accessors to allow for editing of discretelodnode and distancemodel after creation…
Index: src/com/jme/scene/lod/DiscreteLodNode.java
===================================================================
--- src/com/jme/scene/lod/DiscreteLodNode.java (revision 4052)
+++ src/com/jme/scene/lod/DiscreteLodNode.java (working copy)
@@ -68,6 +68,14 @@
+
+ /**
+ * Gets the switch model associated with this node.
+ * @return
+ */
+ public SwitchModel getSwitchModel() {
+ return model;
+ }
Index: src/com/jme/scene/DistanceSwitchModel.java
===================================================================
--- src/com/jme/scene/DistanceSwitchModel.java (revision 4052)
+++ src/com/jme/scene/DistanceSwitchModel.java (working copy)
@@ -90,6 +90,30 @@
/**
+ * Returns the number of children that distances exist for.
+ * @return
+ */
+ public int getNumChildren() {
+ return numChildren;
+ }
+
+ /**
+ * Gets all the model min distances.
+ * @return
+ */
+ public float[] getModelMinDistances() {
+ return modelMin;
+ }
+
+ /**
+ * Gets all the model maximum distances.
+ * @return
+ */
+ public float[] getModelMaxDistances() {
+ return modelMax;
+ }
+
+ /**
+ * Creates larger arrays for the max and mins while copying existing data.
+ * @param newLength
+ */
+ public void reallocateArrays(int newLength) {
+ // new size is less than the existing size....ignore the reallocation
+ if(newLength < numChildren) {
+ return;
+ }
+
+ // create the new arrays
+ float modelMinNew[] = new float[newLength];
+ float modelMaxNew[] = new float[newLength];
+ float worldMinNew[] = new float[newLength];
+ float worldMaxNew[] = new float[newLength];
+
+ // copy in existing
+ for(int i = 0; i < numChildren; i++) {
+ modelMinNew[i] = modelMin[i];
+ modelMaxNew[i] = modelMax[i];
+ worldMinNew[i] = worldMin[i];
+ worldMaxNew[i] = worldMax[i];
+ }
+
+ // reassign
+ modelMin = modelMinNew;
+ modelMax = modelMaxNew;
+ worldMin = worldMinNew;
+ worldMax = worldMaxNew;
+ numChildren = newLength;
+ }