Package com.jme3.bullet.animation
Class VectorSet
java.lang.Object
com.jme3.bullet.animation.VectorSet
A simplified collection of Vector3f values without duplicates, implemented
using a Collection.
This class is shared between JBullet and Native Bullet.
-
Constructor Summary
ConstructorDescriptionVectorSet
(int numVectors) Instantiate an empty set with the specified initial capacity and default load factor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add the value of the specified Vector3f to this set.boolean
Test whether this set contains the value of the specified Vector3f.Calculate the sample mean for each axis over the Vector3f values in this set.int
Calculate the number of Vector3f values in this set.toBuffer()
Access the buffer containing all the Vector3f values in this set.
-
Constructor Details
-
VectorSet
public VectorSet(int numVectors) Instantiate an empty set with the specified initial capacity and default load factor.- Parameters:
numVectors
- the initial capacity of the hash table (>0)
-
-
Method Details
-
add
Add the value of the specified Vector3f to this set.- Parameters:
vector
- the value to add (not null, unaffected)
-
contains
Test whether this set contains the value of the specified Vector3f.- Parameters:
vector
- the value to find (not null, unaffected)- Returns:
- true if found, otherwise false
-
mean
Calculate the sample mean for each axis over the Vector3f values in this set.- Parameters:
storeResult
- (modified if not null)- Returns:
- the sample mean for each axis (either storeResult or a new Vector3f)
-
numVectors
public int numVectors()Calculate the number of Vector3f values in this set.- Returns:
- the count (≥0)
-
toBuffer
Access the buffer containing all the Vector3f values in this set. No further add() is allowed.- Returns:
- a new buffer, flipped
-