java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.CombineFunction
- All Implemented Interfaces:
ConstJoltPhysicsObject,AutoCloseable,Comparable<JoltPhysicsObject>
Combine the restitution or friction of 2 bodies. (native type:
ContactConstraintManager::CombineFunction)-
Method Summary
Modifier and TypeMethodDescriptionstatic CombineFunctionaverage(boolean friction) Create a function that calculates(f1 + f2)/2.static CombineFunctiongeometricMean(boolean friction) Create a function that calculatessqrt(f1 * f2).static CombineFunctionharmonicMean(boolean friction) Create a function that calculates2 * f1 * f2/(f1 + f2).static CombineFunctionmax(boolean friction) Create a function that calculatesmax(f1, f2).static CombineFunctionmin(boolean friction) Create a function that calculatesmin(f1, f2).static CombineFunctionproduct(boolean friction) Create a function that calculatesf1 * f2.static CombineFunctionrootMeanSquare(boolean friction) Create a function that calculatessqrt((f1*f1 + f2*f2)/2).static CombineFunctionsum(boolean friction) Create a function that calculatesf1 + f2.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Method Details
-
average
Create a function that calculates(f1 + f2)/2.- Parameters:
friction-trueto combine frictions,falseto combine restitutions- Returns:
- a new object
-
geometricMean
Create a function that calculatessqrt(f1 * f2).- Parameters:
friction-trueto combine frictions,falseto combine restitutions- Returns:
- a new object
-
harmonicMean
Create a function that calculates2 * f1 * f2/(f1 + f2).- Parameters:
friction-trueto combine frictions,falseto combine restitutions- Returns:
- a new object
-
max
Create a function that calculatesmax(f1, f2).- Parameters:
friction-trueto combine frictions,falseto combine restitutions- Returns:
- a new object
-
min
Create a function that calculatesmin(f1, f2).- Parameters:
friction-trueto combine frictions,falseto combine restitutions- Returns:
- a new object
-
product
Create a function that calculatesf1 * f2.- Parameters:
friction-trueto combine frictions,falseto combine restitutions- Returns:
- a new object
-
rootMeanSquare
Create a function that calculatessqrt((f1*f1 + f2*f2)/2).- Parameters:
friction-trueto combine frictions,falseto combine restitutions- Returns:
- a new object
-
sum
Create a function that calculatesf1 + f2.- Parameters:
friction-trueto combine frictions,falseto combine restitutions- Returns:
- a new object
-