Package jme3utilities.math
Interface VectorSet
- All Known Implementing Classes:
VectorSetUsingBuffer
public interface VectorSet
A collection of Vector3f values without duplicates.
When determining duplicates, -0 is distinguished from 0.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(float x, float y, float z) Add the specified value to this set, if it's not already present.void
Add the value of the specified Vector3f to this set, if it's not already present.void
Add the specified values to this set, to the extent that they're not already present.void
clear()
Reset this set to its initial (empty) state without altering its capacity.boolean
contains
(float x, float y, float z) Test whether this set contains the specified value.boolean
Test whether this set contains the value of the specified Vector3f.covariance
(Matrix3f storeResult) Determine the sample covariance of the values in this set.Find the maximum absolute coordinate for each axis among the Vector3f values in this set.float
Find the magnitude of the longest vector in this set.void
Find the maximum and minimum coordinates for each axis among the values in this set.Determine the sample mean for each axis among the values in this set.int
Determine the number of values in this set.toBuffer()
Access a Buffer containing all values in this set.float[]
Create an array of floats containing all values in this set.Vector3f[]
Create an array of vectors containing all values in this set.
-
Method Details
-
add
void add(float x, float y, float z) Add the specified value to this set, if it's not already present.- Parameters:
x
- the X component of the new valuey
- the Y component of the new valuez
- the Z component of the new value
-
add
Add the value of the specified Vector3f to this set, if it's not already present.- Parameters:
vector
- the value to add (not null, unaffected)
-
addAll
Add the specified values to this set, to the extent that they're not already present.- Parameters:
vectors
- the values to add (not null, unaffected)
-
clear
void clear()Reset this set to its initial (empty) state without altering its capacity. -
contains
boolean contains(float x, float y, float z) Test whether this set contains the specified value.- Parameters:
x
- the X component of the value to findy
- the Y component of the value to findz
- the Z component of the value to find- Returns:
- true if found, otherwise false
-
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
-
covariance
Determine the sample covariance of the values in this set.- Parameters:
storeResult
- storage for the result (modified if not null)- Returns:
- the unbiased sample covariance (either storeResult or a new matrix, not null)
-
maxAbs
Find the maximum absolute coordinate for each axis among the Vector3f values in this set.- Parameters:
storeResult
- storage for the result (modified if not null)- Returns:
- the half extent for each axis (either storeResult or a new instance)
-
maxLength
float maxLength()Find the magnitude of the longest vector in this set.- Returns:
- the magnitude (≥0)
-
maxMin
Find the maximum and minimum coordinates for each axis among the values in this set.- Parameters:
storeMaxima
- storage for the maxima (not null, modified)storeMinima
- storage for the minima (not null, modified)
-
mean
Determine the sample mean for each axis among the values in this set.- Parameters:
storeResult
- storage for the result (modified if not null)- Returns:
- the sample mean for each axis (either storeResult or a new Vector3f)
-
numVectors
int numVectors()Determine the number of values in this set.- Returns:
- the count (≥0)
-
toBuffer
FloatBuffer toBuffer()Access a Buffer containing all values in this set. No further add() is allowed.- Returns:
- a Buffer, flipped but possibly not rewound
-
toFloatArray
float[] toFloatArray()Create an array of floats containing all values in this set.- Returns:
- a new array
-
toVectorArray
Vector3f[] toVectorArray()Create an array of vectors containing all values in this set.- Returns:
- a new array of new vectors
-