World of Hello
|
a 3D object. More...
#include <mesh.h>
Public Member Functions | |
mesh | addMesh (mesh *m) |
add a child mesh. More... | |
mesh | getParent () |
get the parent mesh. More... | |
string | getType () |
get the type of this mesh. More... | |
mesh | setPosition (float X, float Y, float Z) |
sets the position of the mesh. More... | |
multiReturn< float, float, float > | getPosition () |
gets the position of the mesh. More... | |
mesh | moveForward (float speed=1, float xRotation=0, float yRotation=0, float zRotation=0) |
moves the mesh forward or toward a direction. More... | |
mesh | setX (float X) |
sets the X axis of the mesh. More... | |
mesh | setY (float Y) |
sets the Y axis of the mesh. More... | |
mesh | setZ (float Z) |
sets the Z axis of the mesh. More... | |
float | getX () |
gets the X axis of the mesh. More... | |
float | getY () |
gets the Y axis of the mesh. More... | |
float | getZ () |
gets the Z axis of the mesh. More... | |
mesh | setRotation (float Rx, float Ry, float Rz) |
sets the X, Y, and Z rotation of the mesh. More... | |
multiReturn< float, float, float > | getRotation () |
gets the rotation of the mesh. More... | |
mesh | setRx (float Rx) |
sets the X rotation of the mesh. More... | |
mesh | setRy (float Ry) |
sets the Y rotation of the mesh. More... | |
mesh | setRz (float Rz) |
sets the Z rotation of the mesh. More... | |
float | getRx () |
gets the X rotational axis of the mesh. More... | |
float | getRy () |
gets the Y rotational axis of the mesh. More... | |
float | getRy () |
gets the Y rotational axis of the mesh. More... | |
mesh | hide () |
hide the mesh. More... | |
mesh | show () |
shows the mesh. More... | |
mesh | setVisible (bool visible=true) |
sets the visibility of the mesh. More... | |
bool | isVisible () |
gets the visibility of the mesh. More... | |
mesh | setLighting (bool lit=true) |
sets whether the mesh is fully lit or needs a light source. More... | |
mesh | setZBuffer (bool ZBuffer=true) |
sets whether the mesh has a ZBuffer or not. More... | |
mesh | setScale (float X=-1, float Y=-1, float Z=-1) |
sets the X, Y, and Z scale. More... | |
multiReturn< float, float, float > | getScale () |
gets the X, Y and Z scale. More... | |
mesh | setColor (int r, int g, int b, int a=255) |
sets the color of the mesh. More... | |
mesh | remove () |
removes the mesh. More... | |
mesh | setProperty (string property, string value) |
sets a property of the mesh. More... | |
string | getProperty (string property) |
gets the value of a set property. More... | |
string[] | getProperties () |
gets all properties from the object. More... | |
mesh | removeProperty (string property) |
removes a property from the object. More... | |
mesh | clearProperties () |
removes all properties from the object. See removeProperty() More... | |
mesh | doCommands (string cmd) |
creates the mesh from an object like a server command. More... | |
mesh[] | getChildren () |
gets a list of added children. More... | |
string | getObject (bool includeChildren=true) |
get the mesh as a total object. More... | |
mesh | sendToClients (bool removeOthers=false, string key="", string keyAns="") |
sends the mesh to all connected clients who meet the criteria. More... | |
mesh | removeFromClients () |
removes the mesh from all online clients. More... | |
bool | setID (string ID) |
set the ID of the mesh. More... | |
string | getID () |
get the ID of the mesh. More... | |
a 3D object.
Mesh (such as CreateMesh or Create3DText) derive all of the functions in this class.\n This means that any mesh may use these by using something like "meshName:setX(10)".\n
add a child mesh.
Adds a child mesh. The child mesh will also have a position and rotation relative to this object's position.
The | mesh to add as a child. |
mesh mesh::clearProperties | ( | ) |
removes all properties from the object. See removeProperty()
mesh mesh::doCommands | ( | string | cmd | ) |
creates the mesh from an object like a server command.
Uses the given comma-separated properties and creates the mesh like a command. You may get the object (see mesh:getObject()) and use this function to make the mesh load the same data as the given object.\n WARNING: children may also be created, if given.
The | object command. |
mesh [] mesh::getChildren | ( | ) |
gets a list of added children.
Gets all added children using mesh:addMesh().\n The returned list index starts at 0.
string mesh::getID | ( | ) |
get the ID of the mesh.
string mesh::getObject | ( | bool | includeChildren = true | ) |
get the mesh as a total object.
Gets the mesh and all of it's set properties as a string object. Can be used to save the mesh into a data file.
Whether | or not the children objects should also be returned. |
mesh mesh::getParent | ( | ) |
get the parent mesh.
Gets the mesh who added this mesh (see mesh:addElement()), if any.
multiReturn<float, float, float> mesh::getPosition | ( | ) |
gets the position of the mesh.
Gets the X, Y, and Z axis of the mesh.
string [] mesh::getProperties | ( | ) |
gets all properties from the object.
string mesh::getProperty | ( | string | property | ) |
gets the value of a set property.
The | property to get the value of. |
multiReturn<float, float, float> mesh::getRotation | ( | ) |
gets the rotation of the mesh.
Gets the X, Y, and Z rotational axis of the mesh.
float mesh::getRx | ( | ) |
gets the X rotational axis of the mesh.
float mesh::getRy | ( | ) |
gets the Y rotational axis of the mesh.
float mesh::getRy | ( | ) |
gets the Y rotational axis of the mesh.
multiReturn<float, float, float> mesh::getScale | ( | ) |
gets the X, Y and Z scale.
Gets the scale of the X axis, the Y axis, and the Z axis.
string mesh::getType | ( | ) |
get the type of this mesh.
Gets the type of mesh. For example, if this is a mesh, the type is "CreateMesh".
float mesh::getX | ( | ) |
gets the X axis of the mesh.
float mesh::getY | ( | ) |
gets the Y axis of the mesh.
float mesh::getZ | ( | ) |
gets the Z axis of the mesh.
mesh mesh::hide | ( | ) |
hide the mesh.
Hides the mesh and it's children (see mesh:addMesh()).
bool mesh::isVisible | ( | ) |
gets the visibility of the mesh.
Gets whether the mesh was hidden or shown (see mesh:hide() and mesh:show()).
mesh mesh::moveForward | ( | float | speed = 1 , |
float | xRotation = 0 , |
||
float | yRotation = 0 , |
||
float | zRotation = 0 |
||
) |
moves the mesh forward or toward a direction.
Moves the mesh forward or toward a direction using rotational axis. Does not rotate the mesh.\n WARNING: children (see mesh:addMesh()) maintain a position relative to this mesh.
(optional) | The speed to move the mesh. |
(optional) | The X rotational direction. |
(optional) | The Y rotational direction. |
(optional) | The Z rotational direction. |
mesh mesh::remove | ( | ) |
removes the mesh.
Destroys the mesh, removing it completely.
mesh mesh::removeFromClients | ( | ) |
removes the mesh from all online clients.
Removes the mesh from all online clients.\n WARNING: this does not remove the mesh from the user.\n WARNING: this removes the mesh entirely from the server.
mesh mesh::removeProperty | ( | string | property | ) |
removes a property from the object.
Note that setting the property's value to an empty string will also call removeProperty().
The | property to be removed. |
mesh mesh::sendToClients | ( | bool | removeOthers = false , |
string | key = "" , |
||
string | keyAns = "" |
||
) |
sends the mesh to all connected clients who meet the criteria.
Sends the mesh to all clients who are connected to this world.\n When the mesh is received, it is caught as a command (see mesh:doCommands()).\n The mesh is then stored in the server based on it's ID (see mesh:setID()).
(optional) | Whether or not all of the object's properties are required to be sent. |
(optional) | The send key who all clients must have in order to get the object. |
(optional) | The send key value all clients must also have. |
mesh mesh::setColor | ( | int | r, |
int | g, | ||
int | b, | ||
int | a = 255 |
||
) |
sets the color of the mesh.
The | amount of red (0-255). |
The | amount of green (0-255). |
The | amount of blue (0-255). |
(optional) | The amount of alpha (transparency) (0-255). |
bool mesh::setID | ( | string | ID | ) |
set the ID of the mesh.
Sets the ID of the mesh. By default, the mesh has a unique ID.\n WARNING: If the ID has a minus sign ("-") at the beginning of the new ID to be set, the ID will remain static, even for online objects when being sent. Otherwise if there is no minus sign, a unique ID will be generated for online objects, and the online object (if sent) will be removed by default on disconnect.\n For example, if you want to create an online object only one time total that all clients can see and modify (opposed to one online object per client), you may want to add a minus sign to the beginning of the ID. Used in the case of real-time editing game town elements.
The | new ID to be set. |
Returns | true if succeeded, otherwise false if there was an ID conflict. |
mesh mesh::setLighting | ( | bool | lit = true | ) |
sets whether the mesh is fully lit or needs a light source.
(optional) | Whether or not the mesh is fully lit. |
mesh mesh::setPosition | ( | float | X, |
float | Y, | ||
float | Z | ||
) |
sets the position of the mesh.
Sets the X, Y, and Z axis of the mesh.\n WARNING: the mesh does not warp through colliding mesh.\n WARNING: children (see mesh:addMesh()) maintain a position relative to this mesh.
The | X axis. |
The | Y axis. |
The | Z axis. |
mesh mesh::setProperty | ( | string | property, |
string | value | ||
) |
sets a property of the mesh.
Sets a property of the mesh.\n The property is then sent to clients who meet the given criteria (see mesh:sendToClients()) and can be caught as a command. WARNING: Setting the value to an empty string removes the property.
The | property to be set. |
The | value of the property. |
mesh mesh::setRotation | ( | float | Rx, |
float | Ry, | ||
float | Rz | ||
) |
sets the X, Y, and Z rotation of the mesh.
Sets the X, Y, and Z rotational axis of the mesh. WARNING: children (see mesh:addMesh()) maintain a rotation relative to this mesh.
The | X rotational axis. |
The | Y rotational axis. |
The | Z rotational axis. |
mesh mesh::setRx | ( | float | Rx | ) |
sets the X rotation of the mesh.
Sets the X rotational axis of the mesh. WARNING: children (see mesh:addMesh()) maintain a position relative to this mesh.
The | X rotational axis. |
mesh mesh::setRy | ( | float | Ry | ) |
sets the Y rotation of the mesh.
Sets the Y rotational axis of the mesh. WARNING: children (see mesh:addMesh()) maintain a position relative to this mesh.
The | Y rotational axis. |
mesh mesh::setRz | ( | float | Rz | ) |
sets the Z rotation of the mesh.
Sets the Z rotational axis of the mesh. WARNING: children (see mesh:addMesh()) maintain a position relative to this mesh.
The | Z rotational axis. |
mesh mesh::setScale | ( | float | X = -1 , |
float | Y = -1 , |
||
float | Z = -1 |
||
) |
sets the X, Y, and Z scale.
Sets the scale of the X axis, the Y axis, and the Z axis.\n If X is negative, sets to 1. If Y or Z is negative, sets to X or Y respectively.
(optional) | The X axis scale. |
(optional) | The Y axis scale. |
(optional) | The Z axis scale. |
mesh mesh::setVisible | ( | bool | visible = true | ) |
sets the visibility of the mesh.
Sets the mesh and it's children to visible or invisible (see mesh:hide() and mesh:show()).
The | visibility of the mesh. |
mesh mesh::setX | ( | float | X | ) |
sets the X axis of the mesh.
Sets the X axis of the mesh.\n WARNING: the mesh does not warp through colliding mesh. WARNING: children (see mesh:addMesh()) maintain a position relative to this mesh.
The | new X axis. |
mesh mesh::setY | ( | float | Y | ) |
sets the Y axis of the mesh.
Sets the Y axis of the mesh.\n WARNING: the mesh does not warp through colliding mesh.\n WARNING: children (see mesh:addMesh()) maintain a position relative to this mesh.
The | new Y axis. |
mesh mesh::setZ | ( | float | Z | ) |
sets the Z axis of the mesh.
Sets the Z axis of the mesh.\n WARNING: the mesh does not warp through colliding mesh.\n WARNING: children (see mesh:addMesh()) maintain a position relative to this mesh.
The | new Z axis. |
mesh mesh::setZBuffer | ( | bool | ZBuffer = true | ) |
sets whether the mesh has a ZBuffer or not.
Sets if the mesh should have a ZBuffer. If the ZBuffer is set to false, then the mesh will be drawn on the screen above all mesh that have a ZBuffer.\n For example, a mesh without a ZBuffer can be seen through walls and through other objects.
(optional) | Whether or not the mesh has a ZBuffer. |
mesh mesh::show | ( | ) |
shows the mesh.
Shows the mesh and it's children if it was hidden (see mesh:hide() and mesh:setVisible()).