Lumiverse
2.5
A framework for creating lighting control applications
|
Functions to make life with Lumiverse generic types easier. More...
Functions | |
LumiverseType * | copy (LumiverseType *data) |
Copies a LumiverseType and returns an abstracted pointer to the new value. More... | |
void | copyByVal (LumiverseType *source, LumiverseType *target) |
Copies the data from source into target. More... | |
bool | equals (LumiverseType *lhs, LumiverseType *rhs) |
Compares two generic LumiverseType pointers for equality. More... | |
int | cmp (LumiverseType *lhs, LumiverseType *rhs) |
Compares two LumiverseType objects. More... | |
shared_ptr< LumiverseType > | lerp (LumiverseType *lhs, LumiverseType *rhs, float t) |
Lerps the values of a LumiverseType and returns the value. More... | |
bool | areSameType (LumiverseType *lhs, LumiverseType *rhs) |
Checks the types of two LumiverseType objects. More... | |
Eigen::Matrix3f | getRotationMatrix (Eigen::Vector3f lookat, Eigen::Vector3f up, LumiverseOrientation pan, LumiverseOrientation tilt) |
Returns a rotation matrix given the up vector, look at vector, the pan, and tilt. | |
Eigen::Matrix3f | getRotationMatrix (Eigen::Vector3f lookat, Eigen::Vector3f axis) |
Rotates the unit vector axis to the lookat vector. | |
bool | lessThan (LumiverseType *lhs, LumiverseType *rhs) |
Compares two LumiverseTypes with <. More... | |
void | scaleParam (LumiverseType *val, float scale) |
Multiplies a parameter by a constant value (typically from 0 to 1, but no limits are enforced in this function). More... | |
LumiverseType * | loadFromJSON (JSONNode node) |
Loads a LumiverseType from a JSON node. | |
LumiverseOrientation & | typeToOrientationRef (LumiverseType *data) |
LumiverseColor & | typeToColorRef (LumiverseType *data) |
LumiverseFloat & | typeToFloatRef (LumiverseType *data) |
Functions to make life with Lumiverse generic types easier.
This namespace contains utility functions for manipulating and comparing LumiverseType objects. As new types are added, these functions will be updated as needed to handle the new types.
bool Lumiverse::LumiverseTypeUtils::areSameType | ( | LumiverseType * | lhs, |
LumiverseType * | rhs | ||
) |
Checks the types of two LumiverseType objects.
int Lumiverse::LumiverseTypeUtils::cmp | ( | LumiverseType * | lhs, |
LumiverseType * | rhs | ||
) |
Compares two LumiverseType objects.
LumiverseType * Lumiverse::LumiverseTypeUtils::copy | ( | LumiverseType * | data | ) |
Copies a LumiverseType and returns an abstracted pointer to the new value.
void Lumiverse::LumiverseTypeUtils::copyByVal | ( | LumiverseType * | source, |
LumiverseType * | target | ||
) |
Copies the data from source into target.
source | Pointer to the data source |
target | Pointer to the copy location |
bool Lumiverse::LumiverseTypeUtils::equals | ( | LumiverseType * | lhs, |
LumiverseType * | rhs | ||
) |
Compares two generic LumiverseType pointers for equality.
Identifies the type of the objects and then invokes the proper comparison.
lhs | Object on the left hand side |
rhs | Object on the right hand side |
shared_ptr< LumiverseType > Lumiverse::LumiverseTypeUtils::lerp | ( | LumiverseType * | lhs, |
LumiverseType * | rhs, | ||
float | t | ||
) |
Lerps the values of a LumiverseType and returns the value.
lhs * (1 - t) + rhs * t
. bool Lumiverse::LumiverseTypeUtils::lessThan | ( | LumiverseType * | lhs, |
LumiverseType * | rhs | ||
) |
Compares two LumiverseTypes with <.
Uses cmp to determin this inequality.
void Lumiverse::LumiverseTypeUtils::scaleParam | ( | LumiverseType * | val, |
float | scale | ||
) |
Multiplies a parameter by a constant value (typically from 0 to 1, but no limits are enforced in this function).
val | LumiverseType to scale. |
scale | The scaling factor. |