summaryrefslogtreecommitdiffstats
path: root/src/net/java/joglutils/msg/collections/Vec3fCollection.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2007-04-21 17:30:20 +0000
committerKenneth Russel <[email protected]>2007-04-21 17:30:20 +0000
commitc791ac0ce54c774d8e1aa74d683acd4a4350ed53 (patch)
treef73bc2f8953c46d33b61a9002a69907e0911cf74 /src/net/java/joglutils/msg/collections/Vec3fCollection.java
parentda78f003d6c617e533ff4f0425c7d26d8119e9dd (diff)
Bug fixes to addition and removal operations in Vec[234]fCollections
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/joglutils/trunk@67 83d24430-9974-4f80-8418-2cc3294053b9
Diffstat (limited to 'src/net/java/joglutils/msg/collections/Vec3fCollection.java')
-rw-r--r--src/net/java/joglutils/msg/collections/Vec3fCollection.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/net/java/joglutils/msg/collections/Vec3fCollection.java b/src/net/java/joglutils/msg/collections/Vec3fCollection.java
index 698017d..887b4c9 100644
--- a/src/net/java/joglutils/msg/collections/Vec3fCollection.java
+++ b/src/net/java/joglutils/msg/collections/Vec3fCollection.java
@@ -39,8 +39,6 @@ package net.java.joglutils.msg.collections;
import java.nio.*;
-import com.sun.opengl.util.*;
-
import net.java.joglutils.msg.impl.*;
import net.java.joglutils.msg.math.*;
@@ -104,9 +102,10 @@ public class Vec3fCollection {
public void add(Vec3f value) {
FloatBuffer buf = data;
if (buf.limit() == buf.capacity()) {
- FloatBuffer newBuf = BufferUtil.newFloatBuffer(Math.max(buf.capacity() + ELEMENT_SIZE,
- round((int) (buf.capacity() * 1.5f))));
+ FloatBuffer newBuf = BufferFactory.newFloatBuffer(Math.max(buf.capacity() + ELEMENT_SIZE,
+ round((int) (buf.capacity() * 1.5f))));
newBuf.put(buf);
+ newBuf.rewind();
newBuf.limit(buf.limit());
data = newBuf;
buf = newBuf;
@@ -131,11 +130,12 @@ public class Vec3fCollection {
// Simply lower the limit
buf.limit(buf.limit() - ELEMENT_SIZE);
} else {
- buf.position(pos + 1);
+ buf.position(pos + ELEMENT_SIZE);
FloatBuffer rest = buf.slice();
buf.position(pos);
buf.put(rest);
buf.limit(buf.limit() - ELEMENT_SIZE);
+ buf.rewind();
}
return res;
}