Package jme3utilities.math
Class DistinctVectorValues
java.lang.Object
jme3utilities.math.DistinctVectorValues
Analyze a FloatBuffer to identify all of its distinct Vector3f values.
Immutable.
-
Constructor Summary
ConstructorsConstructorDescriptionDistinctVectorValues(FloatBuffer buffer, int startPosition, int endPosition) Analyze the specified FloatBuffer range using exact vector comparisons (without distinguishing 0 from -0) and instantiate the results. -
Method Summary
Modifier and TypeMethodDescriptionintCount the number of distinct vectors in the original buffer range.intfindVvid(int vectorIndex) Find the ID of the indexed vector in the original buffer range.
-
Constructor Details
-
DistinctVectorValues
Analyze the specified FloatBuffer range using exact vector comparisons (without distinguishing 0 from -0) and instantiate the results.- Parameters:
buffer- the buffer to analyze (not null, unaffected)startPosition- the buffer position at which the vectors start (≥0, ≤endPosition, typically 0)endPosition- the buffer position at which the vectors end (≥startPosition, ≤capacity)
-
-
Method Details
-
countDistinct
public int countDistinct()Count the number of distinct vectors in the original buffer range.- Returns:
- the count (≥0)
-
findVvid
public int findVvid(int vectorIndex) Find the ID of the indexed vector in the original buffer range.- Parameters:
vectorIndex- the index of the vector in the original buffer (≥0) which is typically a vertex ID- Returns:
- an ID (≥0) or -1 if not found
-