Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
SortReverseAndStore.h File Reference

Go to the source code of this file.

Functions

JPH_NAMESPACE_BEGIN JPH_INLINE int SortReverseAndStore (Vec4Arg inValues, float inMaxValue, UVec4 &ioIdentifiers, float *outValues)
 
JPH_INLINE int CountAndSortTrues (UVec4Arg inValue, UVec4 &ioIdentifiers)
 

Function Documentation

◆ CountAndSortTrues()

JPH_INLINE int CountAndSortTrues ( UVec4Arg  inValue,
UVec4 ioIdentifiers 
)

Shift the elements so that the identifiers that correspond with the trues in inValue come first

Parameters
inValueValues to test for true or false
ioIdentifiersthe identifiers that are shifted, on return they are shifted
Returns
The number of trues

◆ SortReverseAndStore()

JPH_NAMESPACE_BEGIN JPH_INLINE int SortReverseAndStore ( Vec4Arg  inValues,
float  inMaxValue,
UVec4 ioIdentifiers,
float *  outValues 
)

This function will sort values from high to low and only keep the ones that are less than inMaxValue

Parameters
inValuesValues to be sorted
inMaxValueValues need to be less than this to keep them
ioIdentifiers4 identifiers that will be sorted in the same way as the values
outValuesThe values are stored here from high to low
Returns
The number of values that were kept