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 CombineFunction
average
(boolean friction) Create a function that calculates(f1 + f2)/2
.static CombineFunction
geometricMean
(boolean friction) Create a function that calculatessqrt(f1 * f2)
.static CombineFunction
harmonicMean
(boolean friction) Create a function that calculates2 * f1 * f2/(f1 + f2)
.static CombineFunction
max
(boolean friction) Create a function that calculatesmax(f1, f2)
.static CombineFunction
min
(boolean friction) Create a function that calculatesmin(f1, f2)
.static CombineFunction
product
(boolean friction) Create a function that calculatesf1 * f2
.static CombineFunction
rootMeanSquare
(boolean friction) Create a function that calculatessqrt((f1*f1 + f2*f2)/2)
.static CombineFunction
sum
(boolean friction) Create a function that calculatesf1 + f2
.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Method Details
-
average
Create a function that calculates(f1 + f2)/2
.- Parameters:
friction
-true
to combine frictions,false
to combine restitutions- Returns:
- a new object
-
geometricMean
Create a function that calculatessqrt(f1 * f2)
.- Parameters:
friction
-true
to combine frictions,false
to combine restitutions- Returns:
- a new object
-
harmonicMean
Create a function that calculates2 * f1 * f2/(f1 + f2)
.- Parameters:
friction
-true
to combine frictions,false
to combine restitutions- Returns:
- a new object
-
max
Create a function that calculatesmax(f1, f2)
.- Parameters:
friction
-true
to combine frictions,false
to combine restitutions- Returns:
- a new object
-
min
Create a function that calculatesmin(f1, f2)
.- Parameters:
friction
-true
to combine frictions,false
to combine restitutions- Returns:
- a new object
-
product
Create a function that calculatesf1 * f2
.- Parameters:
friction
-true
to combine frictions,false
to combine restitutions- Returns:
- a new object
-
rootMeanSquare
Create a function that calculatessqrt((f1*f1 + f2*f2)/2)
.- Parameters:
friction
-true
to combine frictions,false
to combine restitutions- Returns:
- a new object
-
sum
Create a function that calculatesf1 + f2
.- Parameters:
friction
-true
to combine frictions,false
to combine restitutions- Returns:
- a new object
-