Vector class, which performs basic 3D vector math operations.
Vector3 is one of the core classes of the engine, and includes several built-in helper functions to perform basic vecor math operations.
Sum.
Add two vectors.
Difference.
Substract two vectors.
Quotient.
Divide two vectors (component wise).
Product.
Multiply two vectors (components wise).
Axis Index.
Value.
Set an individual axis (0 is X, 1 is Y and 2 is Z). the enum constants Vector.AXIS_X, Vector.AXIS_Y, and Vector.AXIS_Z, are also valid. This is specially useful for for-loops.
Axis Index.
Value.
Set an individual axis (0 is X, 1 is Y and 2 is Z). the enum constants Vector.AXIS_X, Vector.AXIS_Y, and Vector.AXIS_Z, are also valid. This is specially useful for for-loops.
Length: sqrt(x^2+y^2+z^2)
Return the length of the vector.
Squared Length: x^2+y^2+z^2.
Return the length of the vector, without the square root step.
Normalize the vector to unit length. This is the same as v = v / v.length()
Return a copy of the normalized vector to unit length. This is the same as v / v.length()
Inverse: 1/v
Returns the inverse of the vector. this is the same as Vector3( 1.0 / v.x, 1.0 / v.y, 1.0 / v.z )
Set x,y and z to 0.
Snap the vector in each axis the the lowest nearest multiple. ie: 4,5,7 snapped to 2 equals 4,4,6.
Snapped copy.
Return a copy of the vector, snapped to the lowest neared multiple.
Linearly interpolates the vector to a given one (b), by the given amount (i)
Perform a cubic interpolation between vectors a,b,c,d (b is current), by the given amount (i).
Cross product.
Return the cross product with b.
Return the dot product with b.
Return the distance to b.
Return the squared distance (distance minus the last square root) to b.
Axis-Aligned-Bounding-Box.
AABB stands for "Axis Aligned Bounding Box". It consits of a position and a size, which for an box that is always aligned to the x, y and z axis, which goes from "pos" to "pos+size".
Returns true if the AABB volume is empty (even if it has a surface). Holds true if size.x,y or z is 0.
Return true if size is 0,0,0.
Compute the volume of the AABB.
Returns true if this AABB shares a portion of space with b.
Returns true if this AABB completely encloses b.
Expand this AABB to also enclose the area of b.
Return the shared portion of space with b (empty if they don't intersect).
result (if they intersect)
normal (if they intersect)
Returns true if this AABB intersects segment "a" towards "b". Also, return the point and normal of intersection.
Returns true if this AABB intersects the plane b.
Return true if this AABB contains point "p".
Axis direction
Get the normal of the longest axis in this AABB.
Get the index of the longest axis in this AABB.
Get the length of the longest axis in this AABB.
Get one of the edges (0 to 11) of this AABB in "ra" and "rb".
Grow this AABB, by expanding its margin, by "s".
Expand this AABB to contain point "p".
Position of the AABB.
Suze of the AABB (should always be positive).
Plane in hessian form.
Plane represents a normalized plane equation. Basically, "normal" is the normal of the plane (a,b,c normalized), and "d" is the distance from the origin to the plane (in the direction of "normal"). "Over" or "Above" the plane is considered the side of the plane towards where the normal is pointing.
Normalize the plane (although it will be often normalized already).
Returns a copy of the plane, normalized.
Returns true if "p" is located above the plane.
Returns the orthogonal distance from "p" to the plane. If positive, "p" is above, if negative, "p" is below.
Returns true if "p" is inside the plane (by a very minimum treshold).
Returns true if this plane intersects with planes "a" and "b". The resulting intersectin is placed in "r".
Returns true if ray consiting of position "p" and direction normal "d" intersects this plane. If true, the result is placed in "r".
Returns true if segment from position "sa" to position "sb" intersects this plane. If true, the result is placed in "r".
Returns the orthogonal projection of point "p" into a point in the plane.
Returns true if plane "b" is very similar to this one.
Plane normal vector (a,c and d in the plane equation normalized).
Plane distance (d in the plane equation).
Quaternion.
Quaternion is a 4 dimensional vector that is used to represet a rotation. It mainly exists to perform SLERP (spherical-linear interpolation) between to rotations obtained by a Matrix3 cheaply. Adding quaternions also cheaply adds the rotations, however quaternions need to be often normalized, or else they suffer from precision issues.
Returns the length of the quaternion.
Returns the length of the quaternion, minus the square root.
Normalize the quaternion to unit length.
Returns a copy of the quaternion, normalized to unit length.
Returns the inverse of the quaternion (applies to the inverse rotatio too).
Returns the dot product between two quaternions.
Create a quaternion from euler rotation "e", as yaw, pitch, roll.
Perform a spherical-linear interpolation with another quaternion.
Peform multiplication between two quaternions.
x-axis
y-axis
z-axis
w-axis
3x3 Matrix.
Matrix represent a 3x3 (3 rows by 3 columns) transformation matrix. it is used mainly to represent and accumulate transformations such as rotation or scale when used as an OCS (oriented coordinate system).
Invert the matrix (transformations are reversed).
Transpose the matrix (transformations are reversed only for orthogonal matrices).
Returns the inverse of the matrix.
Returns the transposition of the matrix.
Rotates the matrix in normalized "axis" by amount "phi" in radians. (This is equivalent to glRotate from OpenGL).
Scale each axis of the rotated matrix by 's".
Get the scale of the matrix.
Create an orthogonal matrix from euler angles "e", as yaw, pitch, roll.
Computes and returns the euler engles for an orthogonal matrix, as yaw, pitch, roll.
Computes and returns a dot product with transposed axis x.
Computes and returns a dot product with transposed axis y.
Computes and returns a dot product with transposed axis z.
Transforms vector "v" by this matrix (as M x V) and returns the result.
Inverse-transforms vector "v" by this matrix (as V x M) and returns the result.
Get an axis of the OCS. (0 is X, 1 is Y and 2 is Z). The enum constants Vector.AXIS_X, Vector.AXIS_Y, and Vector.AXIS_Z, are also valid. This is equivalent to get_column().
Set an axis of the OCS. (0 is X, 1 is Y and 2 is Z). The enum constants Vector.AXIS_X, Vector.AXIS_Y, and Vector.AXIS_Z, are also valid. This is equivalent to set_column()
Get a matrix row.
Set a matrix row.
Get a matrix column. This is equivalent to get_axis()
Set a matrix column. This is equivalent to set_axis
Perform a matrix multiplication (M x N) and return the result.
Perform a transposed-matrix multiplication (Mt x N) and return the result.
Transformation.
Transform is used to store transformations, including translations. It consists of a Matrix3 "basis" and Vector3 "origin". Transform is used to represent transformations of any object in space. It is similar to a 4x3 matrix.
Invert the transform.
Returns the inverse of the transform.
Rotates the transform in normalized "axis" by amount "phi" in radians. (This is equivalent to glRotate from OpenGL).
Scales the whole transform by "s" (including the origin)
Get the basis.
Translate the transform by "v".
"Eye" Position.
"Target" Position.
"Up" Normal Vector.
Creates a transform positioned at "eye", looking towards "target". "up" represents the direction where "up" is. This function is useful for setting up cameras.
Transforms vector "v" by this transform.
Inverse-transforms vector "v" by this transform.
Transforms AABB "a" by this transform. The resulting aabb will often be larger, so succesive transforms are not recommended.
Inverse-transforms AABB "a" by this transform. The resulting aabb will often be larger, so succesive transforms are not recommended.
Transform plane "p" by this transform.
Inverse-transforms plane "p" by this transform.
Transform "basis" or OCS.
Transform origin.
Vector used for 2D Math.
Vector class, which performs basic 2D vector math operations.
Add two vectors.
Substract two vectors.
Divide two vectors.
Multiply two vectors.
Returns the length of the vector.
Returns the squared length of the vector.
Normalizes the vector to unit length.
Returns a normalized vector to unit length.
Sets x and y to 0.
Returns the result of the linear interpolation between this vector and "b", by amount "i".
Returns the dot product with vector "b".
Returns the distance to vector "b".
Remove the fractional part of x and y.
Positioned rectangle in 2D.
Rect2 represets a positioned rectangle of position "pos" and "size".
Returns "true" if the rectangle has no area.
Returns true if v is contained within the rectangle.
Extend the rectangle to enclose "b".
Return the interection with rectangle "b"
Extend the rectangle margin by "m".
Position of the rectangle.
Size of the rectangle.
Color in RGBA format.
A color is represented as red, green and blue (r,g,b) components. Additionally, "a" represents the alpha component, often used for transparency.
Convert the color to a 32 its integer (each byte represets a RGBA).
Convert the color to gray.
Compute the "hue" of the color.
Compute the "saturation" of the color.
Compute the "value" of the color.
Set the color from the HSV format.
Invert the color.
Contrast the color.
(0 to 1)
Linearly blend with color "c", by amount "i".
Red.
Green.
Blue.
Alpha.
Two Dimensional Image.
Image represents a two-dimensional representation of an image, composed by a color per pixel.
Returns the width of the image (in pixels).
Returns the height of the image (in pixels).
Get the color of the pixel at position (x,y).
Sets the color of the pixel at position (x,y).
Convert the image to a new format (valid values in the FORMAT_* enumeration).
Get the image format (valid values in the FORMAT_* enumeration).
Resize the image to a new pixel resolution given by width,height.
Crop the image to a new pixel resolution given by width,height.
Flip the X axis of the image.
Flip the Y axis of the image.
Create a mipmap from "source" image.
Create a normalmap from "height_scale" image.
Create a new image of size width, height and format.
Import an image from raw data, given a specific format.
Returns true if the image is empty.
Load an image from a file in "path".
Resource ID.
RID references a resource, typically created in a server.
Returns true if the resource is valid.
A struct containing information fron an input device.
A struct containing information fron an input event, such as mouse, keyboard, joystick, etc. Valid event types are:
InputEvent.NONE
InputEvent.KEY
InputEvent.MOUSE_BUTTON
InputEvent.MOUSE_MOTION
InputEvent.JOYSTICK_MOTION
InputEvent.JOYSTICK_BUTTON
Event ID. Every event as a unique ID.
Event type (check description).
Device that originated the event.
Mouse x position (for mouse events).
Mouse y position (for mouse events).
State of the mouse buttons as a bitmask (for key and mouse events)
Global mouse x position (used in GUI Controls).
Global mouse y position (used in GUI Controls).
if MOUSE_BUTTON was a press, this value is true.
if MOUSE_BUTTON was a doubleclick, this value is true.
Index of the clicked button (mouse button event).
Relative x motion of the mouse (mouse motion event).
Relative y motion of the mouse (mouse motion event).
If ALT modifier is pressed, this is true (mouse and key events).
If SHIFT modifier is pressed, this is true (mouse and key events).
If CONTROL modifier is pressed, this is true (mouse and key events).
If META modifier (win/apple/etc keys) is pressed, this is true (mouse and key events).
if a KEY event originated from a keypress, this is true.
if a KEY event originated from an echo key, this is true.
Unicode value of a key pressed (key event).
Scancode of a key pressed (check the KEY_* enumeration) (key event).
Joystick button index (joy button event).
If joystick button was pressed, this is true (joy button event).
Index of the pressed/released joystick button.
Axis of a joystick (joy axis event).
Axis value a joystick, from -1 to 1 (joy axis event).
Empty input event.
Key pressed/released event.
Mouse button pressed/released event.
Joystick axis motion event.
Joystick button press/release event.
File Access Interface.
FileAccess provides access to files in the host platform (remote access to files in webserver in the web plugin, as web plugin does not access the local filesystem).
Path to a file
Open mode: FileAccess.READ, FileAccess.WRITE or FileAccess.READ_WRITE
Error value (check the ERR_ macro for the meaning of the values)
Open a file in a given path. Error is returned if the file can't be opened, is nt found, etc.
Closes a currently open file.
Returns true if a file is currently open.
Seek to a given position (in bytes) in the file.
Seek to a given position (in bytes) in the file, from the end of the file.
Get the current position in the file.
Get the open file size (in bytes).
Returns true if EOF was reached (read past end of file).
Read a byte from the file.
Read a 16-bits unsigned integer from the file, in little/big endian format.
Read a 32-bits unsigned integer from the file, in little/big endian format.
Change the endian mode for reading sizes larger than a byte (read big endian files).
Return the status of the endian swap.
Store a byte in the file.
Store a 16-bits integer in the file.
Store a 32 bits integer in the file.
Returns true if a given file (in path) exist.
Directory Tree Access Interface.
Dir provides access to directories in the host platform (remote access to files in webserver in the web plugin, as web plugin does not access the local filesystem).
true if an error ocurred.
Begin a directory listing. This is done iteratively due to the positility of directories with a large amount of entries.
Get the next item. If the return value is empty (""), then the end of the directory has been reached.
Returns true if the current item is a directory (not a file).
End the directory listing.
Get the amount of drives (windows only, returns 0 on other platforms).
Get the string (or character) representing the drive (such as "C","D",etc).
Change the current directory of the dir access. "dir" can be either absolute or relative.
Get the full path of the current dir.
Get the string or character most commonly used as drive separator in the host OS.
true on error.
Create a new directory. "name" can be either absolute or relative.
Returns true if a file exist. "path" can be either absolute or relative.
Return the space left on the device, in kilobytes.
Video Mode structure.
Describes a video mode.
"true" if the video mode is full scren.
"true" if the video mode can be resized to another video mode.
Date structure.
Describes a date.
year (integer)
day of the year
day of the week (0 to 6)
month of the year (0 to 11)
"true" if daylight savings is enabled.
Current Time.
Describes the current time.
(0 to 11)
(0 to 59)
(0 to 59)
Operating System common functions.
OS provides access to common host OS functions. "OS" Must not be instanced. All members are static (called like OS.get_name() ).
Produce an alert. On OSs such as windows or mac, this may result in a popup dialog.
Determine the hardware cursor visibility (if available).
Capture the hardware cursor (if available).
Returns true if the application is capturing the hardware cursor.
Get the name of the host OS or Platform.
Change the current videomode (if available).
Get the current videomode.
Get the current date.
Get the current time.
Get the amount of milliseconds since the app started.
Suspend the calling thread for "usec" milliseconds
Common math functions.
Math provides implementations of commonly used math functions."Math" shouldt not be instanced since all members are static (called like Math.cos() ).
Degrees to Radians conversion.
Round to nearest (lowest) value in given step.
Returns the amount of decimals used by "s".
Returns a random number fro 0 to 1
Returns a random number between "min" and "max"
Shell Execution interface.
Shell allows the application to open a given URL in the host OS. It can be anything the host OS understands, from a web page to a media file.
Open any URL the host OS understands.
Resource Loader.
ResourceLoader loads resources from disk and returns a resource object.
null on failure.
Open a resource in the given path.
Scene Loader
SceneLoader loads scenes from disk and returns a scene node.
A scene node, null on error.
Load a scene from disk at given "path" and return a node object.
Base class for the Object Model.
Object is the building block of most of the high level engine interfaces. The "Object" interface contains a reference to an actual internal Object.
Usually, Object memory should not be managed by the API, as resources will be fred automatically when not in use and nodes are deleted by their parent nodes.
Free the Object reference. This should not be used with nodes inside a scene tree, as they are removed by their parent node. This function can also be used to unreference resources.
Get a string with the type name of the object.
Returns true if the Object datatype contains a reference to an actual object instance.
Return the instance ID of the object. Every Object has a unique instance ID.
Return true if the type of the object class (or any base clases) match "type.
Set a property "property", with any value "value. This function can be inherited with "_set" (but base class "_set" will still be called).
Return a property "property". This function can be inherited with "_get" (but base class "_get" will still be called).
Perform a notification. Notifications are quick ways to tell an Object that something happened or changed regarding it's state and surroundings. This function can be inherited with "_notification" (but base class "_notification" will still be called).
Set the script of the object. Any object can contain a script. Scripts behave as if they inherited the object they are set to
Return the script of the object. Any object can contain a script. Scripts behave as if they inherited the object they are set to
Set a meta property. Meta properties are just containers for setting and retrieving any custom data to an object. Metaproperties are also saved with the object.
Return a meta property. Meta properties are just containers for setting and retrieving any custom data to an object. Metaproperties are also saved with the object.
Return wether an object has a meta property. Meta properties are just containers for setting and retrieving any custom data to an object. Metaproperties are also saved with the object.
Return the list of meta properties in the object. Meta properties are just containers for setting and retrieving any custom data to an object. Metaproperties are also saved with the object.
Call any method in the object (syntax: call("method", .. arguments..).
This notification is called right after the object is done initializing
This notification is called right before the object will e deleted.
All Symbolic Key Names
Key is an enumaration containing the constants for all the symbolic key names. They are used directly (not with Key. prefix). This value is used in the "scancode" field of the "KEY" InputEvent.
Special Key Mask
Property Hints.
PropertyHint hints editors on how to edit a property. In many cases, hint_string (in the PropertyInfo) will contain extra data. These constants are used globally ("PropertyHint" class doesn't exist").
Hint_string defined as "min,max,step
"
Values such as 0,1,2 are represented in hint_string as "A,B,C"
hint_string is the length of an array type.
Flags names are in hint_string from MSB to LSB as "flag8,fla7,flag6,,,,flag1"
Property is a path.
Property is a path to a file.
Property is a path to a dir.
hint_string contains the valid resource types the property accept (separated by ",").
Usage for an object property.
PropertyUsage defines a list of (inclusive) usages that can be ORed together to specify how the property will be treated in different scenarios. These constants are used globally ("PropertyUsage" class doesn't exist").
Property is Saved/Loaded from disk.
Property is visible in editor (for editing).
Property can be syncronized on network.
Default usage.
Valid Data Types.
Type consists of a list of valid types. It is usually used for property type hinting. These constants are used globally ("Type" class doesn't exist").
List of generic errors.
Error is a list of generic errors
Generic fail error
What is requested is unsupported/unavailable
The object being used hasnt been properly set up yet
Missing credentials for requested resource
Parameter given out of range
Out of memory
Can't open a resource/socket/file
resource is locked
Data passed is invalid
Parameter passed is invalid
When adding"> item already exists
When retrieving/erasing"> it item does not exist
database is full
database is full
user requested help!!
a bug in the software certainly happeneddue to a double check failing or unexpected behavior.
an impossible to trigger check due to paranoid programmer was triggered