Tech/LxEngine/Sandbox/Class List
From Athile
It may contain inaccurate, incorrect information. Use at your own risk.
This is a sandbox page containing a rough sketch of the primary namespaces, classes, functions, concepts, design patterns, and general functionality exposed in LxEngine. This is mostly being used as a placeholder until the concepts are fleshed out more fully in the appropriate places in the documentation.
Contents |
Concepts
- copy on write
- named functions
- caches
Core
- lx::core::cast<>()
- lx::core::slot<>
lx::core::cast
Provides a safe, explicit casts between unrelated types. A safe alternative to reinterpret_cast<>.
This is useful for conversion between equivalent data type from different software libraries (e.g. simple vector primitives).
Standard C++'s static_cast<> only works on classes related through an inheritance hierarchy. On the other hand, reinterpret_cast<> works without any checking on the safety of the operation. Lastly, conversion operators have the disadvantage of being implicit; which can lead to subtle injection of added code.
lx::core::slot
lx::core::lxvar
Math / Geometry
Provide strictly typed, single-precision wrappers on the Ogre::Vector3.
Explicit safe type casts
These types can safely cast between one another using lx::core::cast<>(), e.g.
-
vector3 v; point3 p = cast<point3&>(v); -
Ogre::Vector3 ogreVec = cast<Ogre::Vector3&>(v);.
Strict typing
- E.g.
mid_point()is a valid operation between twopoint3objects, but not valid between twovector3objects.
GLSL
http://www.khronos.org/files/opengl-quick-reference-card.pdf
GLM
Core
Types
- vec2,3,4 [b|d|i|u]
- mat2,3,4 [f|d]
- quat [f|d]
mat sizes: 2x3,2x4,3x2,3x4,4x2,4x3
precisions: highp_int, highp_float, lowp_int, lowp_float, mediump_int, mediump_float
Trig
- acos(type) -> type
- acosh(type) -> type
- asin()
- asinh()
- atan(y,x), atan(y_over_x)
- atanh()
- cos()
- cosh()
- sin()
- sinh()
- tan()
- tanh()
Bit-ops
- bitCount()
- bitfieldExtract()
- bitfieldInsert()
- bitfieldReverse()
- findLSB()
- findMSB()
Conditionals
- any() -> bool
- all() -> bool
- equal(vecType, vecType) -> vecType
- lessThan()
- lessThanEqual()
- not_()
- notEqual()
General
- abs(type) -> type
- ceil()
- clamp(x, min, max)
- cross()
- degrees()
- determinant(mat)
- distance()
- dot()
- exp()
- exp2()
- faceforward()
- floatBitsToInt()
- floor()
- fma()
- fract()
- frexp()
- greaterThan()
- greaterThanEqual()
- imulExtended()
- intBitsToFloat()
- inverse()
- inversesqrt()
- isinf()
- isnan()
- ldexp()
- length()
- log()
- log2()
- matrixCompMult()
- max()
- min()
- mix()
- mod()
- modf()
- normalize()
- outerProduct()
- pow()
- radians()
- reflect()
- refract()
- round()
- roundEven()
- sign()
- smoothstep()
- sqrt()
- step()
- transpose()
- trunc()
- uaddCarry()
- umulExtended()
- usubBorrow()
diffs from LxEngine: radians strongly typed, vec called tuple, point & vector strongly typed, fixed point precision types
GLGeom
Core
Types
- radians/degrees - strongly typed angle units
- point2,3,4 - specialization for locations and positions
- vector2,3,4 - specialization for directions and directed distances
- color3,4 -
- radians,degrees - specialization for angles
- plane -
- ray -
- sphere -
- cone -
- intersection2,3 - container for intersection information
GLM should be used for generalized tuples, matrices, and quaternions
Functions
- intersect -
Extension
- bbox - axis-aligned bounding box
- obbox - oriented bounding box
Deprecated
- tuple2,3,4 - general multi-component scalar, i.e. a generic tuple
Javascript Libraries
Math
- abs(f) - returns absolute value
- cos(a) - returns cosine
- sin(a) - returns sine
- tan(a) - return tangent of a
- acos(a) -
- asin(a) -
- atan(a) -
- atan2(y,x) -
- sign(f) - returns -1, 0, 1 depending on sign of the input
- random() - returns a random number between 0 and 1
- random(n,m) - returns a random number between n and m
- ceil()
- floor()
- round()
- exp()
- log()
- max(...)
- min(...)
- sqrt()
- pow()
- E
- PI
- LN2
- LN10
- LOG2E
- LOG10E
- SQRT2
- SQRT1_2