Class MochaMath
java.lang.Object
team.unnamed.mocha.runtime.standard.MochaMath
- All Implemented Interfaces:
ObjectValue,Value
@Binding("math")
@BindExternalFunction(at=java.lang.Math.class,name="abs",args=double.class,pure=true) @BindExternalFunction(at=java.lang.Math.class,name="log",args=double.class,as="ln",pure=true) @BindExternalFunction(at=java.lang.Math.class,name="max",args={double.class,double.class},pure=true) @BindExternalFunction(at=java.lang.Math.class,name="min",args={double.class,double.class},pure=true) @BindExternalFunction(at=java.lang.Math.class,name="round",args=double.class,pure=true) @BindExternalFunction(at=java.lang.Math.class,name="sqrt",args=double.class,pure=true) @BindExternalFunction(at=java.lang.Math.class,name="pow",args={double.class,double.class},pure=true) @BindExternalFunction(at=java.lang.Math.class,name="exp",args=double.class,pure=true) @BindExternalFunction(at=java.lang.Math.class,name="floor",args=double.class,pure=true) @BindExternalFunction(at=java.lang.Math.class,name="ceil",args=double.class,pure=true)
public final class MochaMath
extends Object
implements ObjectValue
Math function bindings inside an object
binding, commonly named 'math'
-
Nested Class Summary
Nested classes/interfaces inherited from interface team.unnamed.mocha.runtime.value.ObjectValue
ObjectValue.DoubleFunction1, ObjectValue.DoubleFunction2, ObjectValue.DoubleFunction3 -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleacos(double value) static doubleasin(double value) static doubleatan(double value) static doubleatan2(double y, double x) static doubleclamp(double value, double min, double max) static doublecos(double value) static doubledieRoll(double amount, double low, double high) static doubledieRollInteger(double amount, double low, double high) @Nullable ObjectPropertygetProperty(@NotNull String name) Returns the property for the given name ignoring its case.static doublehermiteBlend(double t) static doublelerp(double start, double end, double lerp) static doublelerpRotate(double start, double end, double lerp) static doubleminAngle(double angle) static doublemod(double a, double b) static doublerandom(double min, double max) static intrandomInteger(double min, double max) static doublesin(double value) static doubletrunc(double value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface team.unnamed.mocha.runtime.value.ObjectValue
entries, get, set, setFunction, setFunction, setFunctionMethods inherited from interface team.unnamed.mocha.runtime.value.Value
getAsBoolean, getAsNumber, getAsString, isString
-
Field Details
-
PI
- See Also:
-
-
Constructor Details
-
MochaMath
public MochaMath()
-
-
Method Details
-
acos
-
asin
-
atan
-
atan2
-
clamp
-
cos
-
dieRoll
-
dieRollInteger
@Binding("die_roll_integer") public static double dieRollInteger(double amount, double low, double high) -
hermiteBlend
-
lerp
-
lerpRotate
-
minAngle
-
mod
-
random
-
randomInteger
-
sin
-
trunc
-
getProperty
Description copied from interface:ObjectValueReturns the property for the given name ignoring its case. This method is CASE-INSENSITIVE.- Specified by:
getPropertyin interfaceObjectValue- Parameters:
name- The name of the property- Returns:
- The property for the given name
-