Class VectorSet

java.lang.Object
com.jme3.bullet.animation.VectorSet

public class VectorSet extends Object
A simplified collection of Vector3f values without duplicates, implemented using a Collection.

This class is shared between JBullet and Native Bullet.

  • Constructor Summary

    Constructors
    Constructor
    Description
    VectorSet(int numVectors)
    Instantiate an empty set with the specified initial capacity and default load factor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(Vector3f vector)
    Add the value of the specified Vector3f to this set.
    boolean
    Test whether this set contains the value of the specified Vector3f.
    mean(Vector3f storeResult)
    Calculate the sample mean for each axis over the Vector3f values in this set.
    int
    Calculate the number of Vector3f values in this set.
    Access the buffer containing all the Vector3f values in this set.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public void add(Vector3f vector)
      Add the value of the specified Vector3f to this set.
      Parameters:
      vector - the value to add (not null, unaffected)
    • contains

      public boolean contains(Vector3f vector)
      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

      public Vector3f mean(Vector3f storeResult)
      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

      public FloatBuffer toBuffer()
      Access the buffer containing all the Vector3f values in this set. No further add() is allowed.
      Returns:
      a new buffer, flipped