Home Reference Source

Function

Static Public Summary
public

Anim(cfg: *)

Keyframed interpolated animation.

public
public

Framebuffer(_cgl: Context, _w: Number, _h: Number, options: Object)

a framebuffer

public

Framebuffer2(cgl: *, w: *, h: *, options: *): *

public

Geometry(name: String): *

a geometry contains all information about a mesh, vertices, texturecoordinates etc.

public

Key(obj: *)

public

Link(scene: Object)

public

LoadingStatus(patch: *)

LoadingStatus class, manages asynchronous loading jobs

public

Marker(_cgl: *)

public
public

Mesh(_cgl: Context, __geom: Geometry, _options: Number): *

webgl renderable 3d object

public

Op(): *

public

Port(___op: *, name: *, type: *, uiAttribs: *): *

data is coming into and out of ops through input and output ports

public

TextureEffect(cgl: *, options: *)

public

Timer()

Measuring time

public

todo: old...

public

WireCube(cgl: *)

public

WirePoint(cgl: *)

public

ajax(url: *, cb: *, method: *, post: *, contenttype: *, jsonP: *, headers: *, options: *)

make an ajax request

public

ajaxSync(url: *, cb: *, method: *, post: *, contenttype: *)

public

basename(url: String): String

return the filename part of a url without extension

public

cacheBust(url: String): String

append a unique/random parameter to a url, so the browser is forced to reload the file, even if its cached

public

clamp(value: Number, min: Number, max: Number): *

clamp number / make sure its between min/max

public

cleanJson(obj: *): *

public

copyArray(src: Array, dst: Array): Array

copy the content of an array

public

easeCubicIn(t: *): *

public

easeCubicInOut(t: *): *

public

easeCubicOut(t: *): *

public

easeExpoIn(t: *): *

public

easeExpoInOut(t: *): *

public

easeExpoOut(t: *): *

public

escapeHTML(string: *): *

public
public

filename(url: String): String

return the filename part of a url

public
public
public
public
public

getShortOpName(fullname: string): *

get op shortname: only last part of fullname and without version

public
public

keyCodeToName(keyCode: *): *

public

logErrorConsole(initiator: *)

public

output a stacktrace to the console

public

map(x: Number, _oldMin: Number, _oldMax: Number, _newMin: Number, _newMax: Number, _easing: Number): Number

map a value in a range to a value in another range

public

now(): *

current time in milliseconds

public

preproc(str: *, vars: *): *

public

request(options: *)

public

shuffleArray(array: Array | Float32Array): Array | Float32Array

randomize order of an array

public

simpleId(): *

public

smoothStep(perc: Number): Number

smoothStep a value

public

smootherStep(perc: Number): Number

smootherstep a value

Static Public

public Anim(cfg: *) source

import {Anim} from './core/anim.js'

Keyframed interpolated animation.

Available Easings: CONSTANTS.ANIM.EASING_LINEAR CONSTANTS.ANIM.EASING_ABSOLUTE CONSTANTS.ANIM.EASING_SMOOTHSTEP CONSTANTS.ANIM.EASING_SMOOTHERSTEP CONSTANTS.ANIM.EASING_CUBICSPLINE

CONSTANTS.ANIM.EASING_CUBIC_IN CONSTANTS.ANIM.EASING_CUBIC_OUT CONSTANTS.ANIM.EASING_CUBIC_INOUT

CONSTANTS.ANIM.EASING_EXPO_IN CONSTANTS.ANIM.EASING_EXPO_OUT CONSTANTS.ANIM.EASING_EXPO_INOUT

CONSTANTS.ANIM.EASING_SIN_IN CONSTANTS.ANIM.EASING_SIN_OUT CONSTANTS.ANIM.EASING_SIN_INOUT

CONSTANTS.ANIM.EASING_BACK_IN CONSTANTS.ANIM.EASING_BACK_OUT CONSTANTS.ANIM.EASING_BACK_INOUT

CONSTANTS.ANIM.EASING_ELASTIC_IN CONSTANTS.ANIM.EASING_ELASTIC_OUT

CONSTANTS.ANIM.EASING_BOUNCE_IN CONSTANTS.ANIM.EASING_BOUNCE_OUT

CONSTANTS.ANIM.EASING_QUART_IN CONSTANTS.ANIM.EASING_QUART_OUT CONSTANTS.ANIM.EASING_QUART_INOUT

CONSTANTS.ANIM.EASING_QUINT_IN CONSTANTS.ANIM.EASING_QUINT_OUT CONSTANTS.ANIM.EASING_QUINT_INOUT

Params:

NameTypeAttributeDescription
cfg *

Example:

var anim=new CABLES.Anim();
anim.setValue(0,0);  // set value 0 at 0 seconds
anim.setValue(10,1); // set value 1 at 10 seconds
anim.getValue(5);    // get value at 5 seconds - this returns 0.5

public EventTarget() source

import {EventTarget} from './core/eventtarget.js'

public Framebuffer(_cgl: Context, _w: Number, _h: Number, options: Object) source

import {Framebuffer} from './core/cgl/cgl_framebuffer.js'

a framebuffer

Params:

NameTypeAttributeDescription
_cgl Context

cgl

_w Number

width

_h Number

height

options Object

public Framebuffer2(cgl: *, w: *, h: *, options: *): * source

import {Framebuffer2} from './core/cgl/cgl_framebuffer2.js'

Params:

NameTypeAttributeDescription
cgl *
w *
h *
options *

Return:

*

public Geometry(name: String): * source

import {Geometry} from './core/cg/cg_geom.js'

a geometry contains all information about a mesh, vertices, texturecoordinates etc. etc.

Params:

NameTypeAttributeDescription
name String

Return:

*

Example:

// create a triangle with all attributes
const geom=new Geometry("triangle"),

geom.vertices = [
     0.0,           sizeH.get(),  0.0,
    -sizeW.get(),  -sizeH.get(),  0.0,
     sizeW.get(),  -sizeH.get(),  0.0 ];

geom.vertexNormals = [
     0.0,  0.0,  1.0,
     0.0,  0.0,  1.0,
     0.0,  0.0,  1.0 ];

geom.tangents = [
    1,0,0,
    1,0,0,
    1,0,0 ];

geom.biTangents = [
    0,1,0,
    0,1,0,
    0,1,0 ];

geom.texCoords = [
     0.5,  0.0,
     1.0,  1.0,
     0.0,  1.0, ];

geom.verticesIndices = [
    0, 1, 2 ];

public Key(obj: *) source

import {Key} from './core/anim_key.js'

Params:

NameTypeAttributeDescription
obj *
import {Link} from './core/core_link.js'

Params:

NameTypeAttributeDescription
scene Object

The patch object

public LoadingStatus(patch: *) source

import {LoadingStatus} from './core/loadingstatus.js'

LoadingStatus class, manages asynchronous loading jobs

Params:

NameTypeAttributeDescription
patch *

public Marker(_cgl: *) source

import {Marker} from './core/cgl/cgl_marker.js'

Params:

NameTypeAttributeDescription
_cgl *

public MatrixStack() source

import {MatrixStack} from './core/cg/cg_matrixstack.js'

public Mesh(_cgl: Context, __geom: Geometry, _options: Number): * source

import {Mesh} from './core/cgl/cgl_mesh.js'

webgl renderable 3d object

Params:

NameTypeAttributeDescription
_cgl Context

cgl

__geom Geometry

geometry

_options Number

glPrimitive

Return:

*

Example:

const cgl=this._cgl
const mesh=new CGL.Mesh(cgl, geometry);

function render()
{
  mesh.render(cgl.getShader());
}

public Op(): * source

import {Op} from './core/core_op.js'

Return:

*

public Port(___op: *, name: *, type: *, uiAttribs: *): * source

import {Port} from './core/core_port.js'

data is coming into and out of ops through input and output ports

Params:

NameTypeAttributeDescription
___op *
name *
type *
uiAttribs *

Return:

*

Example:

const myPort=op.inString("String Port");

public TextureEffect(cgl: *, options: *) source

import {TextureEffect} from './core/cgl/cgl_textureeffect.js'

Params:

NameTypeAttributeDescription
cgl *
options *

public Timer() source

import {Timer} from './core/timer.js'

Measuring time

public Variable() source

import {Variable} from './core/sessionvar.js'

todo: old... remove this from ops...

public WireCube(cgl: *) source

import {WireCube} from './core/cgl/cgl_marker.js'

Params:

NameTypeAttributeDescription
cgl *

public WirePoint(cgl: *) source

import {WirePoint} from './core/cgl/cgl_marker.js'

Params:

NameTypeAttributeDescription
cgl *

public ajax(url: *, cb: *, method: *, post: *, contenttype: *, jsonP: *, headers: *, options: *) source

import {ajax} from './core/utils.js'

make an ajax request

Params:

NameTypeAttributeDescription
url *
cb *
method *
post *
contenttype *
jsonP *
headers *
options *

public ajaxSync(url: *, cb: *, method: *, post: *, contenttype: *) source

import {ajaxSync} from './core/utils.js'

Params:

NameTypeAttributeDescription
url *
cb *
method *
post *
contenttype *

public basename(url: String): String source

import {basename} from './core/utils.js'

return the filename part of a url without extension

Params:

NameTypeAttributeDescription
url String

Return:

String

just the filename

public cacheBust(url: String): String source

import {cacheBust} from './core/utils.js'

append a unique/random parameter to a url, so the browser is forced to reload the file, even if its cached

Params:

NameTypeAttributeDescription
url String

The url to append the cachebuster parameter to.

Return:

String

url with cachebuster parameter

public clamp(value: Number, min: Number, max: Number): * source

import {clamp} from './core/utils.js'

clamp number / make sure its between min/max

Params:

NameTypeAttributeDescription
value Number

value to be mapped

min Number

minimum value

max Number

maximum value

Return:

*

public cleanJson(obj: *): * source

import {cleanJson} from './core/utils.js'

Params:

NameTypeAttributeDescription
obj *

Return:

*

public copyArray(src: Array, dst: Array): Array source

import {copyArray} from './core/utils.js'

copy the content of an array

Params:

NameTypeAttributeDescription
src Array

sourceArray

dst Array

optional

Return:

Array

dst

public easeCubicIn(t: *): * source

import {easeCubicIn} from './core/anim_key.js'

Params:

NameTypeAttributeDescription
t *

Return:

*

public easeCubicInOut(t: *): * source

import {easeCubicInOut} from './core/anim_key.js'

Params:

NameTypeAttributeDescription
t *

Return:

*

public easeCubicOut(t: *): * source

import {easeCubicOut} from './core/anim_key.js'

Params:

NameTypeAttributeDescription
t *

Return:

*

public easeExpoIn(t: *): * source

import {easeExpoIn} from './core/anim_key.js'

Params:

NameTypeAttributeDescription
t *

Return:

*

public easeExpoInOut(t: *): * source

import {easeExpoInOut} from './core/anim_key.js'

Params:

NameTypeAttributeDescription
t *

Return:

*

public easeExpoOut(t: *): * source

import {easeExpoOut} from './core/anim_key.js'

Params:

NameTypeAttributeDescription
t *

Return:

*

public escapeHTML(string: *): * source

import {escapeHTML} from './core/cgl/cgl_utils.js'

Params:

NameTypeAttributeDescription
string *

Return:

*

public extendMeshWithFeedback(Mesh: *) source

import {extendMeshWithFeedback} from './libs/cgl/deprecatedMeshFeedback/index.js'

Params:

NameTypeAttributeDescription
Mesh *

public filename(url: String): String source

import {filename} from './core/utils.js'

return the filename part of a url

Params:

NameTypeAttributeDescription
url String

Return:

String

just the filename

public getBlurPassFragmentShader(): string source

import {getBlurPassFragmentShader} from './libs/cgl/light/createshaders.js'

Return:

string

public getBlurPassVertexShader(): string source

import {getBlurPassVertexShader} from './libs/cgl/light/createshaders.js'

Return:

string

public getShadowPassFragmentShader(): string source

import {getShadowPassFragmentShader} from './libs/cgl/light/createshaders.js'

Return:

string

public getShadowPassVertexShader(): string source

import {getShadowPassVertexShader} from './libs/cgl/light/createshaders.js'

Return:

string

public getShortOpName(fullname: string): * source

import {getShortOpName} from './core/utils.js'

get op shortname: only last part of fullname and without version

Params:

NameTypeAttributeDescription
fullname string

full op name

Return:

*

public internalNow(): * source

import {internalNow} from './core/timer.js'

Return:

*

public keyCodeToName(keyCode: *): * source

import {keyCodeToName} from './core/utils.js'

Params:

NameTypeAttributeDescription
keyCode *

Return:

*

public logErrorConsole(initiator: *) source

import {logErrorConsole} from './core/utils.js'

Params:

NameTypeAttributeDescription
initiator *

public logStack() source

import {logStack} from './core/utils.js'

output a stacktrace to the console

public map(x: Number, _oldMin: Number, _oldMax: Number, _newMin: Number, _newMax: Number, _easing: Number): Number source

import {map} from './core/utils.js'

map a value in a range to a value in another range

Params:

NameTypeAttributeDescription
x Number

value to be mapped

_oldMin Number

old range minimum value

_oldMax Number

old range maximum value

_newMin Number

new range minimum value

_newMax Number

new range maximum value

_easing Number

Return:

Number

mapped value

public now(): * source

import {now} from './core/timer.js'

current time in milliseconds

Return:

*

public preproc(str: *, vars: *): * source

import {preproc} from './core/cg/preproc.js'

Params:

NameTypeAttributeDescription
str *
vars *

Return:

*

public request(options: *) source

import {request} from './core/utils.js'

Params:

NameTypeAttributeDescription
options *

public shuffleArray(array: Array | Float32Array): Array | Float32Array source

import {shuffleArray} from './core/utils.js'

randomize order of an array

Params:

NameTypeAttributeDescription
array Array | Float32Array

{Array} original

Return:

Array | Float32Array

shuffled array

public simpleId(): * source

import {simpleId} from './core/utils.js'

Return:

*

public smoothStep(perc: Number): Number source

import {smoothStep} from './core/utils.js'

smoothStep a value

Params:

NameTypeAttributeDescription
perc Number

value value to be smoothed [0-1]

Return:

Number

smoothed value

public smootherStep(perc: Number): Number source

import {smootherStep} from './core/utils.js'

smootherstep a value

Params:

NameTypeAttributeDescription
perc Number

value to be smoothed [0-1]

Return:

Number

smoothed value