Tech/LxEngine/Sandbox/Class List

From Athile

Jump to:navigation, search
This page is a work-in-progress. It is not yet complete.
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


Core

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.

 todo Does C++0x support explicit type conversions? If so, conversion operators must be class members - not free-standing functions - making lx::core::cast<> still useful for registering conversions between unrelated types in two different external packages.

lx::core::slot

 todo Provides functionality similar to Qt's slot/signal mechanism


lx::core::lxvar

 todo Provides a flexible, JSON-like data type

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.

Strict typing


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

Navigation
Toolbox