Class: PlanePrimitive

PlanePrimitive

PlanePrimitive provides a primitive plane Model.


new PlanePrimitive(definition)

Parameters:
Name Type Description
definition

An object containing the following (optional) parameters:

  • numSegmentsW: The amount of horizontal segments
  • numSegmentsH: The amount of vertical segments
  • width: The width of the plane
  • height: The height of the plane
  • doubleSided: Whether or not the faces should point both ways
  • alignment: The axes along which to orient the plane. One of PlanePrimitive#ALIGN_XZ, PlanePrimitive#ALIGN_XY, PlanePrimitive#ALIGN_YZ
Author:
  • derschmale <http://www.derschmale.com>

Extends

Members


bounds

The object-space bounding volume. Setting this value only changes the type of volume.

Inherited From:

dynamicBounds

The object-space bounding volume. Setting this value only changes the type of volume.

Inherited From:

hasMorphData

Whether or not this Mesh supports morph target animations. This is the case if Mesh#generateMorphData was called.

Inherited From:

numIndices

The amount of face indices contained in the Mesh.

Inherited From:

numStreams

The amount of streams (vertex buffers) used for this Mesh/

Inherited From:

numVertexAttributes

The amount of vertex attributes contained in the Mesh.

Inherited From:

numVertices

The amount of vertices contained in the Mesh.

Inherited From:

Methods


addMorphTarget()

Adds a MorphTarget object for animators to work with.

Inherited From:

addVertexAttribute(name, numComponents, streamIndex, normalized)

Adds a named vertex attribute. All properties are given manually to make it easier to support multiple streams in the future.

Parameters:
Name Type Description
name

The name of the attribute, matching the attribute name used in the vertex shaders.

numComponents

The amount of components used by the attribute value.

streamIndex

[Optional] The stream index indicating which vertex buffer is used, defaults to 0

normalized

[Optional] Whether or not the input of the attribute should be normalized to [-1, 1]

Inherited From:

clone()

Returns a duplicate of this Mesh.

Inherited From:

extractAttributeData()

Extracts the vertex attribute data for the given attribute name as a flat Array.

Inherited From:

generateMorphData()

Generates the required data to support morph target animations.

Inherited From:

getIndexData()

Returns the index data uploaded to the index buffer.

Inherited From:

getMorphTarget(index)

Gets the morph target by name.

Parameters:
Name Type Description
index name

The name of the MorphTarget

Inherited From:
Returns:
Type
MorphTarget

getVertexAttributeByIndex()

Gets the vertex attribute data according to the index.

Inherited From:

getVertexAttributeByName()

Gets the vertex attribute data according to the attribute name.

Inherited From:

getVertexData()

Gets the vertex data for a given stream.

Inherited From:

getVertexStride()

Gets the vertex stride (number of components used per stream per vertex) for a given stream

Inherited From:

hasVertexAttribute()

Returns whether the Mesh has a vertex attribute with the given name.

Inherited From:

hasVertexData()

Returns whether or not vertex data was uploaded to the given stream index.

Inherited From:

removeMorphTarget()

Adds a MorphTarget object for animators to work with.

Inherited From:

setIndexData()

Uploads index data from an Array or a Uint16Array

Inherited From:

setVertexData()

Uploads vertex data from an Array or a Float32Array. This method must be called after the layout for the stream has been finalized using setVertexAttribute calls. The data in the stream should be an interleaved array of floats, with each attribute data in the order specified with the setVertexAttribute calls.

Inherited From: