Home Reference Source
import {CGState} from './core/cg/cg_state.js'
public class | source

CGState

Extends:

cables-shared-client~Events → CGState

Direct Subclass:

Context, WebGpuContext

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public
public
public
public
public
public
public

aborted: boolean

public get

canvas: *

public get
public

canvasScale: number

public get
public
public
public

mMatrix: mat4

Current model matrix

public

pMatrix: mat4

Current projection matrix

public

patch: *

public set
public get
public

vMatrix: mat4

Current view matrix

Private Members
private

_ident: *

private
private
private
private
private

Method Summary

Public Methods
public
public
public
public
public

modelMatrix(): mat4

get model matrix

public

popModelMatrix(): mat4

pop model matrix stack

public

popPMatrix(): mat4

pop projection matrix stack

public

popViewMatrix(): mat4

pop view matrix stack

public

push a matrix to the model matrix stack

public

push a matrix to the projection matrix stack

public

push a matrix to the view matrix stack

public

setAutoResize(parent: *)

public

setCanvas(canvEle: *)

public

setSize(w: *, h: *, ignorestyle: *)

public
Private Methods
private
private
private
private

_startMatrixStacks(identTranslate: *, identTranslateView: *)

Public Constructors

public constructor() source

Public Members

public DEPTH_COMPARE_FUNC_ALWAYS: number source

public DEPTH_COMPARE_FUNC_EQUAL: number source

public DEPTH_COMPARE_FUNC_GREATER: number source

public DEPTH_COMPARE_FUNC_GREATEREQUAL: number source

public DEPTH_COMPARE_FUNC_LESS: number source

public DEPTH_COMPARE_FUNC_LESSEQUAL: number source

public DEPTH_COMPARE_FUNC_NEVER: number source

public DEPTH_COMPARE_FUNC_NOTEQUAL: number source

public aborted: boolean source

public get canvas: * source

public get canvasHeight: * source

public canvasScale: number source

public get canvasWidth: * source

public cgCanvas: * source

public fpsCounter: * source

public mMatrix: mat4 source

Current model matrix

public pMatrix: mat4 source

Current projection matrix

public patch: * source

public set pixelDensity source

public get pixelDensity: * source

public vMatrix: mat4 source

Current view matrix

Private Members

private _ident: * source

private _identView: * source

private _mMatrixStack: * source

private _pMatrixStack: * source

private _textureslots: *[] source

private _vMatrixStack: * source

Public Methods

public dispose() source

public getGApiName(): * source

Return:

*

public getProjectionMatrixStateCount(): * source

Return:

*

public getViewMatrixStateCount(): * source

Return:

*

public modelMatrix(): mat4 source

get model matrix

Return:

mat4

current modelmatrix

public popModelMatrix(): mat4 source

pop model matrix stack

Return:

mat4

current modelmatrix

public popPMatrix(): mat4 source

pop projection matrix stack

Return:

mat4

current projectionmatrix

public popViewMatrix(): mat4 source

pop view matrix stack

Return:

mat4

current viewmatrix

public pushModelMatrix() source

push a matrix to the model matrix stack

Example:

// see source code of translate op:
cgl.pushModelMatrix();
mat4.translate(cgl.mMatrix,cgl.mMatrix, vec);
trigger.trigger();
cgl.popModelMatrix();

public pushPMatrix() source

push a matrix to the projection matrix stack

public pushViewMatrix() source

push a matrix to the view matrix stack

public setAutoResize(parent: *) source

Params:

NameTypeAttributeDescription
parent *

public setCanvas(canvEle: *) source

Params:

NameTypeAttributeDescription
canvEle *

public setSize(w: *, h: *, ignorestyle: *) source

Params:

NameTypeAttributeDescription
w *
h *
ignorestyle *

public updateSize() source

Private Methods

private _endMatrixStacks() source

private _resizeToParentSize() source

private _resizeToWindowSize() source

private _startMatrixStacks(identTranslate: *, identTranslateView: *) source

Params:

NameTypeAttributeDescription
identTranslate *
identTranslateView *