Home Reference Source
public class | source

Geometry

Extends:

GLBoostObject → Geometry

Constructor Summary

Public Constructor
public

constructor(glBoostContext: *)

Member Summary

Public Members
public get

AABB: *

public get
public set
public get
public get

rawAABB: *

Private Members
private

_AABB: *

private
private
private
private
private
private

_materials: *[]

private
private
private

_vboObj: {}

private
private
private

Method Summary

Public Methods
public

draw(data: *)

public
public

getExtraDataForShader(name: *): *

public
public

getTriangleCount(mesh: *): *

public
public

isIndexed(): *

public

isTransparent(mesh: *): *

public

merge(geometrys: *)

public

mergeHarder(geometrys: *)

public

mergeHarderInner(geometry: *, typedArrayDic: *, isFirst: *)

take no thought geometry's materials

public

mergeInner(geometry: *, typedArrayDic: *, isFirst: *)

public

prepareGLSLProgram(expression: *, material: *, existCamera_f: *, lights: *, shaderClass: *, argShaderInstance: *): *

public

prepareToRender(expression: *, existCamera_f: *, lights: *, meshMaterial: *, mesh: *, shaderClass: *, argMaterials: *): *

public

rayCast(origVec3: *, dirVec3: *, isFrontFacePickable: *, isBackFacePickable: *): undefined[]

public

setExtraDataForShader(name: *, value: *)

public

setUpDisableAllVertexAttribArrays(gl: *, glslProgram: *)

public

setUpDisableVertexAttribArrays(gl: *, glslProgram: *, allVertexAttribs: *)

public

setUpEnableVertexAttribArrays(gl: *, glslProgram: *, allVertexAttribs: *)

public

setUpVertexAttribs(gl: *, glslProgram: *, allVertexAttribs: *)

public

setVerticesData(vertices: *, indicesArray: *, primitiveType: *, performanceHint: *)

public

updateVerticesData(vertices: *, skipUpdateAABB: *): boolean

Private Methods
private

_allVertexAttribs(vertices: *): *

return all vertex attribute name list

private

_calcArenbergInverseMatrices(primitiveType: *)

private

_calcArenbergMatrixFor3Vertices(vertexIndices: *, i: *, pos0IndexBase: *, pos1IndexBase: *, pos2IndexBase: *, incrementNum: *): number

private

_calcBaryCentricCoord(vertexNum: *, positionElementNumPerVertex: *)

private

_calcTangent(vertexNum: *, positionElementNumPerVertex: *, texcoordElementNumPerVertex: *, primitiveType: *)

private

_calcTangentFor3Vertices(vertexIndices: *, i: *, pos0IndexBase: *, pos1IndexBase: *, pos2IndexBase: *, uv0IndexBase: *, uv1IndexBase: *, uv2IndexBase: *, incrementNum: *)

private

_calcTangentPerVertex(pos0Vec3: *, pos1Vec3: *, pos2Vec3: *, uv0Vec2: *, uv1Vec2: *, uv2Vec2: *): *

private

_checkAndSetVertexComponentNumber(allVertexAttribs: *)

private

_createShaderInstance(glBoostContext: *, shaderClass: *): *

private
private
private

_getVAO(): *

private

_rayCastInner(origVec3: *, dirVec3: *, i: *, pos0IndexBase: *, pos1IndexBase: *, pos2IndexBase: *, isFrontFacePickable: *, isBackFacePickable: *): undefined[]

private

_setUpVertexAttibsWrapper(glslProgram: *)

private

_setVertexNtoSingleMaterial(material: *, index: *)

Inherited Summary

From class GLBoostObject
public static
private static
private static
public get
public get
public get

Return the simple class-specific number.

public get
public get
public get
public get
public get
public get
public set
private
private
private
private
private
private
private
private
private
private
public
public
public
public

Return instance name.

public
private

_copy(instance: *)

private

Public Constructors

public constructor(glBoostContext: *) source

Override:

GLBoostObject#constructor

Params:

NameTypeAttributeDescription
glBoostContext *

Public Members

public get AABB: * source

public get centerPosition: * source

public set materials: * source

public get materials: * source

public get rawAABB: * source

Private Members

private _AABB: * source

private _defaultMaterial: * source

private _drawKicker: * source

private _extraDataForShader: {} source

private _indexStartOffsetArray: *[] source

private _indicesArray: * source

private _materials: *[] source

private _performanceHint: * source

private _primitiveType: * source

private _vboObj: {} source

private _vertexData: *[] source

private _vertexN: number source

private _vertices: * source

Public Methods

public draw(data: *) source

Params:

NameTypeAttributeDescription
data *

public drawIntermediate() source

public getExtraDataForShader(name: *): * source

Params:

NameTypeAttributeDescription
name *

Return:

*

public getIndexStartOffsetArrayAtMaterial(i: *): * source

Params:

NameTypeAttributeDescription
i *

Return:

*

public getTriangleCount(mesh: *): * source

Params:

NameTypeAttributeDescription
mesh *

Return:

*

public getVertexCount(): * source

Return:

*

public isIndexed(): * source

Return:

*

public isTransparent(mesh: *): * source

Params:

NameTypeAttributeDescription
mesh *

Return:

*

public merge(geometrys: *) source

Params:

NameTypeAttributeDescription
geometrys *

public mergeHarder(geometrys: *) source

Params:

NameTypeAttributeDescription
geometrys *

public mergeHarderInner(geometry: *, typedArrayDic: *, isFirst: *) source

take no thought geometry's materials

Params:

NameTypeAttributeDescription
geometry *
typedArrayDic *
isFirst *
  • optional
  • default: undefined

public mergeInner(geometry: *, typedArrayDic: *, isFirst: *) source

Params:

NameTypeAttributeDescription
geometry *
typedArrayDic *
isFirst *
  • optional
  • default: undefined

public prepareGLSLProgram(expression: *, material: *, existCamera_f: *, lights: *, shaderClass: *, argShaderInstance: *): * source

Params:

NameTypeAttributeDescription
expression *
material *
existCamera_f *
lights *
shaderClass *
  • optional
  • default: undefined
argShaderInstance *
  • optional
  • default: undefined

Return:

*

public prepareToRender(expression: *, existCamera_f: *, lights: *, meshMaterial: *, mesh: *, shaderClass: *, argMaterials: *): * source

Params:

NameTypeAttributeDescription
expression *
existCamera_f *
lights *
meshMaterial *
mesh *
shaderClass *
  • optional
  • default: undefined
argMaterials *
  • optional
  • default: undefined

Return:

*

public rayCast(origVec3: *, dirVec3: *, isFrontFacePickable: *, isBackFacePickable: *): undefined[] source

Params:

NameTypeAttributeDescription
origVec3 *
dirVec3 *
isFrontFacePickable *
isBackFacePickable *

Return:

undefined[]

public setExtraDataForShader(name: *, value: *) source

Params:

NameTypeAttributeDescription
name *
value *

public setUpDisableAllVertexAttribArrays(gl: *, glslProgram: *) source

Params:

NameTypeAttributeDescription
gl *
glslProgram *

public setUpDisableVertexAttribArrays(gl: *, glslProgram: *, allVertexAttribs: *) source

Params:

NameTypeAttributeDescription
gl *
glslProgram *
allVertexAttribs *

public setUpEnableVertexAttribArrays(gl: *, glslProgram: *, allVertexAttribs: *) source

Params:

NameTypeAttributeDescription
gl *
glslProgram *
allVertexAttribs *

public setUpVertexAttribs(gl: *, glslProgram: *, allVertexAttribs: *) source

Params:

NameTypeAttributeDescription
gl *
glslProgram *
allVertexAttribs *

public setVerticesData(vertices: *, indicesArray: *, primitiveType: *, performanceHint: *) source

Params:

NameTypeAttributeDescription
vertices *
indicesArray *
primitiveType *
  • optional
  • default: undefined
performanceHint *
  • optional
  • default: undefined

public updateVerticesData(vertices: *, skipUpdateAABB: *): boolean source

Params:

NameTypeAttributeDescription
vertices *
skipUpdateAABB *
  • optional
  • default: undefined

Return:

boolean

Private Methods

private _allVertexAttribs(vertices: *): * source

return all vertex attribute name list

Params:

NameTypeAttributeDescription
vertices *

Return:

*

private _calcArenbergInverseMatrices(primitiveType: *) source

Params:

NameTypeAttributeDescription
primitiveType *

private _calcArenbergMatrixFor3Vertices(vertexIndices: *, i: *, pos0IndexBase: *, pos1IndexBase: *, pos2IndexBase: *, incrementNum: *): number source

Params:

NameTypeAttributeDescription
vertexIndices *
i *
pos0IndexBase *
pos1IndexBase *
pos2IndexBase *
incrementNum *

Return:

number

private _calcBaryCentricCoord(vertexNum: *, positionElementNumPerVertex: *) source

Params:

NameTypeAttributeDescription
vertexNum *
positionElementNumPerVertex *

private _calcTangent(vertexNum: *, positionElementNumPerVertex: *, texcoordElementNumPerVertex: *, primitiveType: *) source

Params:

NameTypeAttributeDescription
vertexNum *
positionElementNumPerVertex *
texcoordElementNumPerVertex *
primitiveType *

private _calcTangentFor3Vertices(vertexIndices: *, i: *, pos0IndexBase: *, pos1IndexBase: *, pos2IndexBase: *, uv0IndexBase: *, uv1IndexBase: *, uv2IndexBase: *, incrementNum: *) source

Params:

NameTypeAttributeDescription
vertexIndices *
i *
pos0IndexBase *
pos1IndexBase *
pos2IndexBase *
uv0IndexBase *
uv1IndexBase *
uv2IndexBase *
incrementNum *

private _calcTangentPerVertex(pos0Vec3: *, pos1Vec3: *, pos2Vec3: *, uv0Vec2: *, uv1Vec2: *, uv2Vec2: *): * source

Params:

NameTypeAttributeDescription
pos0Vec3 *
pos1Vec3 *
pos2Vec3 *
uv0Vec2 *
uv1Vec2 *
uv2Vec2 *

Return:

*

private _checkAndSetVertexComponentNumber(allVertexAttribs: *) source

Params:

NameTypeAttributeDescription
allVertexAttribs *

private _createShaderInstance(glBoostContext: *, shaderClass: *): * source

Params:

NameTypeAttributeDescription
glBoostContext *
shaderClass *

Return:

*

private _getAllVertexAttribs(): * source

Return:

*

private _getAppropriateMaterials(mesh: *): * source

Params:

NameTypeAttributeDescription
mesh *

Return:

*

private _getVAO(): * source

Return:

*

private _rayCastInner(origVec3: *, dirVec3: *, i: *, pos0IndexBase: *, pos1IndexBase: *, pos2IndexBase: *, isFrontFacePickable: *, isBackFacePickable: *): undefined[] source

Params:

NameTypeAttributeDescription
origVec3 *
dirVec3 *
i *
pos0IndexBase *
pos1IndexBase *
pos2IndexBase *
isFrontFacePickable *
isBackFacePickable *

Return:

undefined[]

private _setUpVertexAttibsWrapper(glslProgram: *) source

Params:

NameTypeAttributeDescription
glslProgram *

private _setVertexNtoSingleMaterial(material: *, index: *) source

Params:

NameTypeAttributeDescription
material *
index *