Skip to content

Commit a3ae54d

Browse files
authored
MotionPath: Improve performance by reusing meshes.
1 parent 7db6b94 commit a3ae54d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

jme3-core/src/main/java/com/jme3/cinematic/MotionPath.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,11 @@ public void enableDebugShape(AssetManager manager, Node rootNode) {
305305
private void attachDebugNode(Node root) {
306306
if (debugNode == null) {
307307
debugNode = new Node("DebugWayPoints");
308+
Box box = new Box(0.3f, 0.3f, 0.3f);
308309
Material mat = assetManager.loadMaterial("Common/Materials/RedColor.j3m");
309310
int i = 1;
310311
for (Vector3f cp : spline.getControlPoints()) {
311-
Geometry geo = new Geometry("ControlPoint." + i, new Box(0.3f, 0.3f, 0.3f));
312+
Geometry geo = new Geometry("WayPoint." + i, box);
312313
geo.setLocalTranslation(cp);
313314
geo.setMaterial(mat);
314315
debugNode.attachChild(geo);
@@ -453,4 +454,5 @@ public boolean isCycle() {
453454
public Spline getSpline() {
454455
return spline;
455456
}
457+
456458
}

0 commit comments

Comments
 (0)