====== Fluxions TypeScript Library ====== ===== Geometry and Math ===== * Vector{234} * Matrix{234 2x3 3x2 2x4 4x2} * MatrixStack{234 2x3 3x2 2x4 4x2} * Quaternion ==== Vector{234} ==== === Members === * ''public x : number'' * ''public y : number'' * ''public z : number'' * ''public w : number'' === Methods === * ''constructor(public x : number, public y : number, public z : number, public w : number)'' * ''public isZero() : boolean'' * ''public scale(x : number) : Vector'' * ''public times(a : Vector) : Vector'' * ''public plus(a : Vector) : Vector'' * ''public length() : number'' * ''public lengthSquared() : number'' * ''public norm() : Vector'' * ''public dot(v : Vector) : Vector'' === Static Methods === * ''static add(a : Vector, b : Vector) : Vector'' * ''static dot(a : Vector, b : Vector) : Vector'' * ''static sub(a : Vector, b : Vector) : Vector'' ==== Matrix{234 2x3 3x2 4x2 2x4} ==== === Members === * ''m11 : number'' * ''m12 : number'' * ''m13 : number'' * ''m14 : number'' * ''m21 : number'' * ''m22 : number'' * ''m23 : number'' * ''m24 : number'' * ''m31 : number'' * ''m32 : number'' * ''m33 : number'' * ''m34 : number'' * ''m41 : number'' * ''m42 : number'' * ''m43 : number'' * ''m44 : number'' === Methods === * ''constructor(m11, m12, m13, m14, ...)'' * ''public toColMajorArray() : Array'' * ''public toRowMajorArray() : Array'' * ''public det() : number'' * ''public adj() : number'' * ''public inverse() : Matrix4'' * ''public invert() : Matrix4'' * ''public times(m : Matrix4) : Matrix4'' * ''public add(m : Matrix4) : Matrix4'' * ''public neg() : Matrix4'' * ''public scale(x : number) : Matrix4'' === Static Methods === * ''static makeIdentity() : Matrix4'' * ''static makeFromColMajorArray(v : Array) : Matrix4'' * ''static makeFromRowMajorArray(v : Array) : Matrix4'' * ''static makeRotation(angleInRadians : number, v : Vector3) : Matrix4'' * ''static makeTranslation(v : Vector3) : Matrix4'' * ''static makeScale(v : Vector3) : Matrix4'' * ''static makeEulerXYZ(xAngleInRadians : number, yAngleInRadians : number, zAngleInRadians : number) : Matrix4'' * ''static makeLookAt(eye : Vector3, origin : Vector3, up : Vector3) : Matrix4'' * ''static makePerspective(fovyInDegrees : number, aspectRatio : number, znear : number, zfar : number) : Matrix4'' * ''static makeOrtho(left : number, right : number, top : number, bottom : number, znear : number, zfar : number) : Matrix4'' * ''static makeOrtho2D(left : number, right : number, top : number, bottom : number) : Matrix4'' ==== Quaternion ==== === Members === * ''public a : number'' * ''public b : number'' * ''public c : number'' * ''public d : number'' === Methods === * ''constructor(public a : number, public b : number, public c : number, public d : number)'' * ''public conj() : Quaternion'' === Static Methods === * ''static makeFromMatrix4(m : Matrix4) : Quaternion'' ==== MatrixStack{234} ==== === Members === * stack : Array === Methods === * ''constructor()'' * ''public loadIdentity() : void'' * ''public push() : void'' * ''public pop() : void'' * ''public top() : void'' * ''public multMatrix(m : Matrix4) : void'' * ''public translate(x : number, y : number, z : number): void'' * ''public rotate(angleInDegrees : number, x : number, y : number, z : number): void'' * ''public scale(x : number, y : number, z : number): void'' * ''public lookat(eye : Vector4): void'' ===== Scene Graph ===== * ''Thing'' * ''Properties'' * ''IndexedMesh extends Thing'' * ''Camera extends Thing'' * ''Light extends Thing'' * ''PointLight extends Light'' * ''SunLight extends Light'' * ''Environment extends Thing'' * ''Sphere extends Thing'' * ''Node'' * ''GroupNode extends Node'' * ''LeafNode extends Node'' * ''Scenegraph'' * ''Scene extends Node'' ==== Thing ==== The ''class Thing'' has properties and a matrix stack. It represents something that exists in space. Child classes define specifically what that is, whether it is a Camera or a Light or an IndexedMesh. The properties it has are usually passed on as uniform variables in a Shader in the rendering pipeline. === Members === * ''private worldMatrix : Matrix4'' * ''private worldPosition : Vector4'' * ''private worldMatrixPropertyName : string = "WorldMatrix"'' * ''private worldPositionPropertyName : string = "WorldPosition"'' * ''private matrixStack : MatrixStack'' * ''private properties : Properties'' === Methods === * ''public getWorldPosition() : Vector4'' * ''public getWorldMatrix() : Matrix4'' * ''public setWorldPosition(v : Vector4)'' * ''public setWorldMatrix(m : Matrix4)'' * ''public setProperty{V2 V3 V4 M2 M3 M4 S}()'' ==== Scenegraph ==== * ''public Meshes : Array'' * ''public Nodes : GroupNode''