java.lang.Object
com.github.stephengold.joltjni.operator.Op

public final class Op extends Object
Java equivalents for the overloaded operators of Jolt Physics.
  • Method Details

    • add

      public static RVec3 add(RVec3Arg left, Vec3Arg right)
      Return the component-wise sum of the specified vectors. (native operator: binary +)
      Parameters:
      left - the base vector (not null, unaffected)
      right - the offset to add (not null, unaffected)
      Returns:
      a new vector
    • add

      public static Vec3 add(Vec3Arg v1, Vec3Arg v2)
      Return the component-wise sum of the specified vectors. (native operator: binary +)
      Parameters:
      v1 - the first vector (not null, unaffected)
      v2 - the 2nd vector (not null, unaffected)
      Returns:
      a new vector
    • divide

      public static Vec3 divide(Vec3Arg v, float scale)
      Return a scaled version of the specified vector. (native operator: binary /)
      Parameters:
      v - the input vector (not null, unaffected)
      scale - the inverse scale to apply
      Returns:
      a new vector
    • divideEquals

      public static void divideEquals(RVec3 left, double right)
      Divide the left argument by the right argument. (native operator: binary /=)
      Parameters:
      left - the accumulating vector (not null, modified)
      right - the denominator (not null, unaffected)
    • equals

      public static boolean equals(ConstBodyId id1, ConstBodyId id2)
      Test whether the specified IDs are equal. (native operator: ==)
      Parameters:
      id1 - the first ID to test (not null, unaffected)
      id2 - the 2nd ID to test (not null, unaffected)
      Returns:
      true if equal, false if unequal
    • equals

      public static boolean equals(ConstColor c1, ConstColor c2)
      Test whether the specified colors are equal. (native operator: ==)
      Parameters:
      c1 - the first color to test (not null, unaffected)
      c2 - the 2nd color to test (not null, unaffected)
      Returns:
      true if equal, false if unequal
    • equals

      public static boolean equals(Mat44Arg m1, Mat44Arg m2)
      Test whether the specified matrices are equal. (native operator: ==)
      Parameters:
      m1 - the first matrix (not null, unaffected)
      m2 - the 2nd matrix (not null, unaffected)
      Returns:
      true if equal, otherwise false
    • minusEquals

      public static void minusEquals(Vec3 left, Vec3Arg right)
      Subtract the 2nd argument from the first argument. (native operator: binary -=)
      Parameters:
      left - the accumulating vector (not null, modified)
      right - the vector to subtract (not null, unaffected)
    • multiply

      public static Quat multiply(float scale, QuatArg v)
      Return a scaled version of the specified quaternion. (native operator: binary *)
      Parameters:
      scale - the scale to apply
      v - the input quaternion (not null, unaffected)
      Returns:
      a new quaternion
    • multiply

      public static Vec3 multiply(float scale, Vec3Arg v)
      Return a scaled version of the specified vector. (native operator: binary *)
      Parameters:
      scale - the scale to apply
      v - the input vector (not null, unaffected)
      Returns:
      a new vector
    • multiply

      public static Quat multiply(QuatArg lhs, QuatArg rhs)
      Return the product of the specified quaternions. (native operator: binary *)
      Parameters:
      lhs - the left factor (not null, unaffected)
      rhs - the right factor (not null, unaffected)
      Returns:
      a new quaternion
    • multiply

      public static Vec3 multiply(Vec3Arg v, float scale)
      Return a scaled version of the specified vector. (native operator: binary *)
      Parameters:
      v - the input vector (not null, unaffected)
      scale - the scale to apply
      Returns:
      a new vector
    • multiply

      public static Vec3 multiply(Vec3Arg v1, Vec3Arg v2)
      Return the component-wise product of the specified vectors. (native operator: binary *)
      Parameters:
      v1 - the first vector (not null, unaffected)
      v2 - the 2nd vector (not null, unaffected)
      Returns:
      a new vector
    • negate

      public static Vec3 negate(Vec3Arg v)
      Return the negative of the specified vector. (native operator: unary -)
      Parameters:
      v - the input vector (not null, unaffected)
      Returns:
      a new vector
    • notEqual

      public static boolean notEqual(ConstColor c1, ConstColor c2)
      Test whether the specified colors are unequal. (native operator: !=)
      Parameters:
      c1 - the first color to test (not null, unaffected)
      c2 - the 2nd color to test (not null, unaffected)
      Returns:
      false if equal, true if unequal
    • plusEquals

      public static void plusEquals(RVec3 left, RVec3Arg right)
      Add the right argument to the left argument. (native operator: binary +=)
      Parameters:
      left - the accumulating vector (not null, modified)
      right - the vector to add (not null, unaffected)
    • plusEquals

      public static void plusEquals(RVec3 left, Vec3Arg right)
      Add the right argument to the left argument. (native operator: binary +=)
      Parameters:
      left - the accumulating vector (not null, modified)
      right - the vector to add (not null, unaffected)
    • plusEquals

      public static void plusEquals(Vec3 left, Vec3Arg right)
      Add the 2nd argument to the first argument. (native operator: binary +=)
      Parameters:
      left - the accumulating vector (not null, modified)
      right - the vector to add (not null, unaffected)
    • rotate

      public static Vec3 rotate(QuatArg lhs, Vec3Arg rhs)
      Rotate the specified vector by the specified unit quaternion. (native operator: binary *)
      Parameters:
      lhs - the rotation to apply (not null, normalized, unaffected)
      rhs - the vector to apply it to (not null, unaffected)
      Returns:
      a new vector
    • subtract

      public static RVec3 subtract(RVec3Arg left, RVec3Arg right)
      Return the component-wise difference of the specified vectors. (native operator: binary -)
      Parameters:
      left - the base vector (not null, unaffected)
      right - the offset to subtract (not null, unaffected)
      Returns:
      a new vector
    • subtract

      public static RVec3 subtract(RVec3Arg left, Vec3Arg right)
      Return the component-wise difference of the specified vectors. (native operator: binary -)
      Parameters:
      left - the base vector (not null, unaffected)
      right - the offset to subtract (not null, unaffected)
      Returns:
      a new vector
    • subtract

      public static Vec3 subtract(Vec3Arg v1, Vec3Arg v2)
      Return the component-wise difference of the specified vectors. (native operator: binary -)
      Parameters:
      v1 - the first vector (not null, unaffected)
      v2 - the vector to subtract (not null, unaffected)
      Returns:
      a new vector