Fixed to properly update the buffer when the extents

are changed.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8008 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
PSp..om 13 years ago
parent 2ddc537ddc
commit b3e488ff76
  1. 6
      engine/src/core/com/jme3/scene/debug/Arrow.java

@ -34,6 +34,7 @@ package com.jme3.scene.debug;
import com.jme3.math.Quaternion;
import com.jme3.math.Vector3f;
import com.jme3.scene.Mesh;
import com.jme3.scene.VertexBuffer;
import com.jme3.scene.VertexBuffer.Type;
import java.nio.FloatBuffer;
@ -118,7 +119,8 @@ public class Arrow extends Mesh {
tempQuat.lookAt(extent, Vector3f.UNIT_Y);
tempQuat.normalizeLocal();
FloatBuffer buffer = getFloatBuffer(Type.Position);
VertexBuffer pvb = getBuffer(Type.Position);
FloatBuffer buffer = (FloatBuffer)pvb.getData();
buffer.rewind();
for (int i = 0; i < positions.length; i += 3) {
Vector3f vec = tempVec.set(positions[i],
@ -132,6 +134,8 @@ public class Arrow extends Mesh {
buffer.put(vec.z);
}
pvb.updateData(buffer);
updateBound();
updateCounts();
}

Loading…
Cancel
Save