Class CombineFunction

java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.CombineFunction
All Implemented Interfaces:
ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>

public class CombineFunction extends JoltPhysicsObject
Combine the restitution or friction of 2 bodies. (native type: ContactConstraintManager::CombineFunction)
  • Method Details

    • average

      public static CombineFunction average(boolean friction)
      Create a function that calculates (f1 + f2)/2.
      Parameters:
      friction - true to combine frictions, false to combine restitutions
      Returns:
      a new object
    • geometricMean

      public static CombineFunction geometricMean(boolean friction)
      Create a function that calculates sqrt(f1 * f2).
      Parameters:
      friction - true to combine frictions, false to combine restitutions
      Returns:
      a new object
    • harmonicMean

      public static CombineFunction harmonicMean(boolean friction)
      Create a function that calculates 2 * f1 * f2/(f1 + f2).
      Parameters:
      friction - true to combine frictions, false to combine restitutions
      Returns:
      a new object
    • max

      public static CombineFunction max(boolean friction)
      Create a function that calculates max(f1, f2).
      Parameters:
      friction - true to combine frictions, false to combine restitutions
      Returns:
      a new object
    • min

      public static CombineFunction min(boolean friction)
      Create a function that calculates min(f1, f2).
      Parameters:
      friction - true to combine frictions, false to combine restitutions
      Returns:
      a new object
    • product

      public static CombineFunction product(boolean friction)
      Create a function that calculates f1 * f2.
      Parameters:
      friction - true to combine frictions, false to combine restitutions
      Returns:
      a new object
    • rootMeanSquare

      public static CombineFunction rootMeanSquare(boolean friction)
      Create a function that calculates sqrt((f1*f1 + f2*f2)/2).
      Parameters:
      friction - true to combine frictions, false to combine restitutions
      Returns:
      a new object
    • sum

      public static CombineFunction sum(boolean friction)
      Create a function that calculates f1 + f2.
      Parameters:
      friction - true to combine frictions, false to combine restitutions
      Returns:
      a new object