Class: BaseShape

og/shape/BaseShape~BaseShape

Base geometry shape class.

new BaseShape(options)

Name Type Description
options Object Shape parameters:
Name Type Description
position og.Vec3 optional Shape position.
orientation og.Quat optional Shape orientation(rotation).
scale og.Vec3 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.Mat4

Model matrix.

protected_mxScaleog.Mat4

Scale matrix.

protected_mxTranslationog.Mat4

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.Quat

Shape orientation(rotation)

positionog.Vec3

Shape position.

scaleog.Vec3

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.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 og.Vec3 Picking RGB color.

setPosition3v(position)

Sets shape position.
Name Type Description
position og.Vec3 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.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 og.Vec3 Translation vector.