|
@@ -81,7 +81,7 @@ public class Geometry extends Spatial {
|
|
* The start index of this <code>Geometry's</code> inside
|
|
* The start index of this <code>Geometry's</code> inside
|
|
* the {@link GeometryGroupNode}.
|
|
* the {@link GeometryGroupNode}.
|
|
*/
|
|
*/
|
|
- protected int startIndex;
|
|
|
|
|
|
+ protected int startIndex = -1;
|
|
/**
|
|
/**
|
|
* Serialization only. Do not use.
|
|
* Serialization only. Do not use.
|
|
*/
|
|
*/
|
|
@@ -316,7 +316,7 @@ public class Geometry extends Spatial {
|
|
* @param node Which {@link GeometryGroupNode} to associate with.
|
|
* @param node Which {@link GeometryGroupNode} to associate with.
|
|
* @param startIndex The starting index of this geometry in the group.
|
|
* @param startIndex The starting index of this geometry in the group.
|
|
*/
|
|
*/
|
|
- protected void associateWithGroupNode(GeometryGroupNode node, int startIndex) {
|
|
|
|
|
|
+ public void associateWithGroupNode(GeometryGroupNode node, int startIndex) {
|
|
if (isGrouped()) {
|
|
if (isGrouped()) {
|
|
unassociateFromGroupNode();
|
|
unassociateFromGroupNode();
|
|
}
|
|
}
|
|
@@ -331,13 +331,15 @@ public class Geometry extends Spatial {
|
|
*
|
|
*
|
|
* Should only be called by the parent {@link GeometryGroupNode}.
|
|
* Should only be called by the parent {@link GeometryGroupNode}.
|
|
*/
|
|
*/
|
|
- protected void unassociateFromGroupNode() {
|
|
|
|
|
|
+ public void unassociateFromGroupNode() {
|
|
if (groupNode != null) {
|
|
if (groupNode != null) {
|
|
// Once the geometry is removed
|
|
// Once the geometry is removed
|
|
// from the parent, the group node needs to be updated.
|
|
// from the parent, the group node needs to be updated.
|
|
groupNode.onGeoemtryUnassociated(this);
|
|
groupNode.onGeoemtryUnassociated(this);
|
|
groupNode = null;
|
|
groupNode = null;
|
|
- startIndex = 0;
|
|
|
|
|
|
+
|
|
|
|
+ // change the default to -1 to make error detection easier
|
|
|
|
+ startIndex = -1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -486,7 +488,7 @@ public class Geometry extends Spatial {
|
|
// but the cloned one is not attached to anything, hence not managed.
|
|
// but the cloned one is not attached to anything, hence not managed.
|
|
if (isGrouped()) {
|
|
if (isGrouped()) {
|
|
groupNode = null;
|
|
groupNode = null;
|
|
- startIndex = 0;
|
|
|
|
|
|
+ startIndex = -1;
|
|
}
|
|
}
|
|
|
|
|
|
geomClone.cachedWorldMat = cachedWorldMat.clone();
|
|
geomClone.cachedWorldMat = cachedWorldMat.clone();
|