Skip to content

Commit

Permalink
solve issue #1992: better messages in spatial assertions (#1993)
Browse files Browse the repository at this point in the history
* #1992 Improve the messages being reported from spatial assertions

* #1992 Make clear what name is in the assertion messages

* #1992 Whitespace correction
  • Loading branch information
richardTingle authored and stephengold committed Jun 8, 2023
1 parent 1fa62f0 commit 4b402b0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions jme3-core/src/main/java/com/jme3/scene/Spatial.java
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public boolean checkCulling(Camera cam) {
}

CullHint cm = getCullHint();
assert cm != CullHint.Inherit;
assert cm != CullHint.Inherit : "CullHint should never be inherit. Problem spatial name: " + getName();
if (cm == Spatial.CullHint.Always) {
setLastFrustumIntersection(Camera.FrustumIntersect.Outside);
return false;
Expand Down Expand Up @@ -586,7 +586,7 @@ protected void updateWorldLightList() {
worldLights.update(localLights, null);
refreshFlags &= ~RF_LIGHTLIST;
} else {
assert (parent.refreshFlags & RF_LIGHTLIST) == 0;
assert (parent.refreshFlags & RF_LIGHTLIST) == 0 : "Illegal light list update. Problem spatial name: " + getName();
worldLights.update(localLights, parent.worldLights);
refreshFlags &= ~RF_LIGHTLIST;
}
Expand All @@ -599,7 +599,7 @@ protected void updateMatParamOverrides() {
if (parent == null) {
worldOverrides.addAll(localOverrides);
} else {
assert (parent.refreshFlags & RF_MATPARAM_OVERRIDE) == 0;
assert (parent.refreshFlags & RF_MATPARAM_OVERRIDE) == 0 : "Illegal mat param update. Problem spatial name: " + getName();
worldOverrides.addAll(parent.worldOverrides);
worldOverrides.addAll(localOverrides);
}
Expand Down Expand Up @@ -653,7 +653,7 @@ protected void updateWorldTransforms() {
refreshFlags &= ~RF_TRANSFORM;
} else {
// check if transform for parent is updated
assert ((parent.refreshFlags & RF_TRANSFORM) == 0);
assert ((parent.refreshFlags & RF_TRANSFORM) == 0) : "Illegal rf transform update. Problem spatial name: " + getName();
worldTransform.set(localTransform);
worldTransform.combineWithParent(parent.worldTransform);
refreshFlags &= ~RF_TRANSFORM;
Expand Down Expand Up @@ -811,7 +811,7 @@ public void addControlAt(int index, Control control) {

if (index < numControls) { // re-arrange the list directly
boolean success = controls.remove(control);
assert success;
assert success : "Surprising control remove failure. " + control.getClass().getSimpleName() + " from spatial " + getName();
controls.add(index, control);
}
}
Expand Down Expand Up @@ -952,7 +952,7 @@ public void updateGeometricState() {
if ((refreshFlags & RF_MATPARAM_OVERRIDE) != 0) {
updateMatParamOverrides();
}
assert refreshFlags == 0;
assert refreshFlags == 0 : "Illegal refresh flags state: " + refreshFlags + " for spatial " + getName();
}

/**
Expand Down

0 comments on commit 4b402b0

Please sign in to comment.