Class: BaseShape

og.shape.BaseShape

new og.shape.BaseShape(options)

Base geometry shape class.
Name Type Description
options Object Shape parameters:
Name Type Description
position og.math.Vector3 optional Shape position.
orientation og.math.Quaternion optional Shape orientation(rotation).
scale og.math.Vector3 optional Scale vector.
color Array.<number, number, number, number> optional Shape RGBA color.
src string optional Texture image url source.
visibility boolean optional Shape visibility.

Members

protected_entityog.Entity

Entity instance that holds this shape.

protected_handlerog.ShapeHandler

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_mxModelog.math.Matrix4

Model matrix.

protected_mxScaleog.math.Matrix4

Scale matrix.

protected_mxTranslationog.math.Matrix4

Translation matrix.

protected_normalBuffer

Vertices normal gl buffer.

protected_normalDataArray.<number>

Vertex normals.

protected_pickingColorArray.<number, number, number>

Assigned picking color.

protected_positionBuffer

Vertices position gl buffer.

protected_positionDataArray.<number>

Vertex positions.

protected_renderNodeog.scene.RenderNode

Assigned render node.

protected_srcstring

Image url source.

protected_textureCoordBuffer

Vertex texture coordinates gl buffer.

protected_textureCoordDataArray.<number>

Vertex texture coordinates.

colorArray.<number, number, number, number>

Shape RGBA color.

readonlyidnumber

Unic identifier.

orientationog.math.Quaternion

Shape orientation(rotation)

positionog.math.Vector3

Shape position.
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, number, number, number> RGBA color values array.

setColor4v(color)

Sets shape color.
Name Type Description
color og.math.Vector4 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 og.math.Vector3 Picking RGB color.

setPosition3v(position)

Sets shape position.
Name Type Description
position og.math.Vector3 Shape position.

setRenderNode(renderNode)

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

setScale3v(scale)

Sets shape scale.
Name Type Description
scale og.math.Vector3 Scale vector.

setVisibility(visibility)

Sets shape visibility.
Name Type Description
visibility boolean Visibility.

translate3v(vec)

Translate shape position to vector.
Name Type Description
vec og.math.Vector3 Translation vector.