Class: BaseShape

og/shape/BaseShape~BaseShape

Base geometry shape class.

new BaseShape(options)

Name Type Description
options Object Shape parameters:
Name Type Description
position Vec3 optional Shape position.
orientation Quat optional Shape orientation(rotation).
scale Vec3 optional Scale vector.
color Array.<number> optional Shape RGBA color. (exactly 4 entries)
src string optional Texture image url source.
visibility boolean optional Shape visibility.

Members

protected_entityEntity

Entity instance that holds this shape.

protected_handlerShapeHandler

Handler that stores and renders this shape object.

protected_handlerIndexnumber

Shape handler array index.

protected_indexBuffer

Vertices indexes gl buffer.

protected_indexDataArray.<number>

Vertex indeces.

protected_mxModelMat4

Model matrix.

protected_mxScaleMat4

Scale matrix.

protected_mxTranslationMat4

Translation matrix.

protected_normalBuffer

Vertices normal gl buffer.

protected_normalDataArray.<number>

Vertex normals.

protected_pickingColorArray.<number>

Assigned picking color.

protected_positionBuffer

Vertices position gl buffer.

protected_positionDataArray.<number>

Vertex positions.

protected_renderNodeRenderNode

Assigned render node.

protected_srcstring

Image url source.

protected_textureCoordBuffer

Vertex texture coordinates gl buffer.

protected_textureCoordDataArray.<number>

Vertex texture coordinates.

colorArray.<number>

Shape RGBA color.

readonlyidnumber

Unic identifier.

orientationQuat

Shape orientation(rotation)

positionVec3

Shape position.

scaleVec3

Scale.

protectedtexture

Gl texture pointer.

visibilityboolean

Shape visibility.

Methods

protected_createBuffers()

Creates buffers.

protected_deleteBuffers()

Delete gl buffers.
Clear shape parameters.
Shape rendering.

getVisibility(){boolean}

Gets visibilty flag.
Returns:
Type Description
boolean -
Update model matrix.
Removes shape from shape handler.

setColor(color)

Sets shape color.
Name Type Description
color Array.<number> RGBA color values array. (exactly 4 entries)

setColor4v(color)

Sets shape color.
Name Type Description
color Vec4 RGBA color vector.

setOpacity(opacity)

Sets shape opacity value.
Name Type Description
opacity number Opacity value.

protectedsetPickingColor3v(color)

Assign picking color.
Name Type Description
color Vec3 Picking RGB color.

setPosition3v(position)

Sets shape position.
Name Type Description
position Vec3 Shape position.

setRenderNode(renderNode)

Assign render node.
Name Type Description
renderNode RenderNode Render node to assign.

setScale3v(scale)

Sets shape scale.
Name Type Description
scale Vec3 Scale vector.

setVisibility(visibility)

Sets shape visibility.
Name Type Description
visibility boolean Visibility.

translate3v(vec)

Translate shape position to vector.
Name Type Description
vec Vec3 Translation vector.