Class DistinctVectorValues

java.lang.Object
jme3utilities.math.DistinctVectorValues

public class DistinctVectorValues extends Object
Analyze a FloatBuffer to identify all of its distinct Vector3f values. Immutable.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DistinctVectorValues(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 Type
    Method
    Description
    int
    Count the number of distinct vectors in the original buffer range.
    int
    findVvid(int vectorIndex)
    Find the ID of the indexed vector in the original buffer range.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DistinctVectorValues

      public DistinctVectorValues(FloatBuffer buffer, int startPosition, int endPosition)
      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