Math
Updated for version 3.38
Math
math class
This class uses periods not colons. So you'd call it like math.func
Functions
Function | Return Type | Description |
---|---|---|
rot_to_quat(Rotation rot) | Table | Converts a diesel rotation to a diesel quaternion. Returns a table of the 4 values of the quaternion. x,y,z,w |
quat_to_rot(Number x, Number y, Number z, Number w) | Rotation | Converts a quaternion to a rotation |
Color class
Functions
Function | Return Type | Description |
---|---|---|
color() | Color | Returns itself (used when you're not sure if the color is a Vector3 or a color) |
vector() | Vector3 | Returns vector3 version of the color |
from_hex(String hex) | Color | Although Color() does support hex, it doesn't support ARGB. This function makes a color out of RGB or ARGB so you can have a hex color with transparency value. Additionally, the function doesn't mind if the hex string starts with # |
to_hex() | String | Returns the hex value of the color (in ARGB if the alpha is less than 1) |
contrast(Color white, Color black) | Color | Returns a color(white or black but can modified by passing them in the argument) that fits the color the best, this is used in BeardLib to make an automatic text color that fits the background |
Vector3 class
Functions
Function | Return Type | Description |
---|---|---|
vector() | Vector3 | Returns itself (used when you're not sure if the color is a Vector3 or a color) |
color() | Color | Returns Color() version of the Vector3 |
mrotation class
This class uses periods not colons. So you'd call it like mrotation.func
Functions
Function | Description |
---|---|
copy(Rotation rot) | Same as mvector3.copy, copies the given rotation and returns it |
set_yaw(Rotation rot, Number yaw) | Sets the yaw value of the rotation |
set_pitch(Rotation rot, Number pitch) | Sets the pitch value of the rotation |
set_roll(Rotation rot, Number roll) | Sets the roll value of the rotation |
Anonymous functions
Functions that aren't contained in a class.
Functions
Function | Description |
---|---|
anim_dt(Boolean dont_pause) | Returns the current delta time. Works in pause too (unless |
anim_wait(Number seconds, Boolean dont_pause) | A wait function for animations. |
play_anim(GUIObject o, Table params) | Plays an animation. |
play_color(GUIObject o, Color color, Table params) | Animates a GUI object. |
play_value(GUIObject o, String value_name, Any value, Table params) | Like |
playing_anim(GUIObject o) | Returns true if the GUIObject is currently playing an animation (only BeardLib animations) |
stop_anim(GUIObject o) | Stops the animation. Recommended to use if you are planning on checking |
Animation examples
play_anim
play_color
play_value
Last updated