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
This commit is contained in:
parent
2ddc537ddc
commit
b3e488ff76
@ -34,6 +34,7 @@ package com.jme3.scene.debug;
|
|||||||
import com.jme3.math.Quaternion;
|
import com.jme3.math.Quaternion;
|
||||||
import com.jme3.math.Vector3f;
|
import com.jme3.math.Vector3f;
|
||||||
import com.jme3.scene.Mesh;
|
import com.jme3.scene.Mesh;
|
||||||
|
import com.jme3.scene.VertexBuffer;
|
||||||
import com.jme3.scene.VertexBuffer.Type;
|
import com.jme3.scene.VertexBuffer.Type;
|
||||||
import java.nio.FloatBuffer;
|
import java.nio.FloatBuffer;
|
||||||
|
|
||||||
@ -118,7 +119,8 @@ public class Arrow extends Mesh {
|
|||||||
tempQuat.lookAt(extent, Vector3f.UNIT_Y);
|
tempQuat.lookAt(extent, Vector3f.UNIT_Y);
|
||||||
tempQuat.normalizeLocal();
|
tempQuat.normalizeLocal();
|
||||||
|
|
||||||
FloatBuffer buffer = getFloatBuffer(Type.Position);
|
VertexBuffer pvb = getBuffer(Type.Position);
|
||||||
|
FloatBuffer buffer = (FloatBuffer)pvb.getData();
|
||||||
buffer.rewind();
|
buffer.rewind();
|
||||||
for (int i = 0; i < positions.length; i += 3) {
|
for (int i = 0; i < positions.length; i += 3) {
|
||||||
Vector3f vec = tempVec.set(positions[i],
|
Vector3f vec = tempVec.set(positions[i],
|
||||||
@ -132,6 +134,8 @@ public class Arrow extends Mesh {
|
|||||||
buffer.put(vec.z);
|
buffer.put(vec.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pvb.updateData(buffer);
|
||||||
|
|
||||||
updateBound();
|
updateBound();
|
||||||
updateCounts();
|
updateCounts();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user