Repository

Sphere

Extends:

Mesh → Sphere

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public
public
public
public
public
public

radius: *

public
public
public
public
public
Private Members
private

_mesh: *

Inherited Summary

From class Mesh
public static

generateStrokeMesh(mesh: Mesh, inflateValue: Number): Mesh

Static Utils to generate the stroke Mesh from a given shape

public static

generateStrokeShape(mesh: Mesh, inflateValue: Number): *

Static Utils to generate the stroke for the given vertices with the given stroke width

public static

geometryIsCW(geometry: Geometry): Boolean

Static Utils to check the direction of a geometry (ccw o cw)

public

events: *

public
public
public
public
public
public

indices: *[]

public
public
public

name: *

public
public
public
public

type: *

public
public
private

_mesh: *

public

Attach the material to this mesh.

public

clone(): *

deep clone this Mesh return {Mesh} a new clone (copy) of this Mesh in a new Mesh object

public

compute Face and Vertex Normals for the current geometry

public

Call this method to construct a custom mesh

public

erase(recursive: Boolean)

Erase this mesh's geometry and material from memory

public

generateFillMesh(vertices: *)

Generate the mesh for the given vertices and generates flat uvs for it.

public

Generate the flat uvs for this mesh.

public

genereate a mesh from already made geometry and material

public

Compute and returns the bounding box of the current geometry or Node, which is an object made of 2 Vector3.

public

Compute and returns the bounding sphere of the current geometry or Node, which is an object with a radius :

public

Returns the center of the geometry (vertices) based on boundingbox

public

Shortcut for getSize().y

public

Shortcut for getSize().z

public
public
public

Returns the size of the geometry (vertices) based on boundingbox

public

getUVs(index: integer): Array

Get the UV of this mesh geometry

public

Get the vertexColors of this mesh geometry's vertices

public

Get the vertices of this mesh geometry

public

Get the visibility of this mesh

public

Shortcut for getSize().x

public

Generate Float32Array and BufferAttribute for this geometry

public

Adds a Normal to the current geometry

public

pushQuad(v1: Vector3, v2: Vector3, v3: Vector3, v4: Vector3)

Adds a Quad to the current geometry

public

Adds a triangle to the current geometry

public

pushUV(uv1: Vector2, uv2: Vector2, uv3: Vector2)

Adds a UV to the current geometry

public

Adds a vertex to the current geometry

public

convinient method to reverse this Mesh geometry's normals

public

setCastShadow

public

Defines the position of the geometry's center (NOT the transform!).

public

setEventEmitterTrigger(scope: *, eventType: *)

public

Sets this Mesh material.

public
public

setReceiveShadow

public
public

setRotationX(value: float)

Set the rotation around x axis of the vertices (not the transform!)

public

setRotationY(value: float)

Set the rotation around y axis of the vertices (not the transform!)

public

setRotationZ(value: float)

Set the rotation around z axis of the vertices (not the transform!)

public

setScale(number|Vector3|Vector2: float | Vector3 | Vector2, Number: float, Number: float)

Set the scale of the geometry (vertices) - this is not like scaling the transform.

public

setTranslation(value: float, value: float, value: float)

Set the translation along all axis of the vertices (not the transform!)

public

setUVs(index: integer, uvs: Array)

Set the UV of this mesh geometry

public

setVertex(index: *, vertex: *)

public

Set the vertexColors of this mesh geometry's vertices

public

setVertices(vertices: Object)

Set the vertices of this mesh geometry

public

Set the visibility of this mesh

private

Updates this mesh material

Public Constructors

public constructor(params: Object) source

Construct an empty and unfinished Mesh for which a geometry must be constructed. Once filled with vertices, constructMesh method must be called, or a method generating a complete Mesh must be used (i.e generateFillMesh)

Override:

Mesh#constructor

Params:

NameTypeAttributeDescription
paramsObject

Parameters object, given by the constructor.

params.radiusNumber
  • optional
  • default: 1

the sphere radius in world unit

params.segmentsNumber
  • optional
  • default: 8

tesselation size for all axis

params.widthSegmentsNumber
  • optional
  • default: 8

horizontal tesselation size

params.heightSegmentsNumber
  • optional
  • default: 8

vertical tesselation size

params.phiStartNumber
  • optional
  • default: 0

horizontal angle start of the sphere

params.phiLengthNumber
  • optional
  • default: Math.PI*2

horizontal length of the sphere

params.thetaStartNumber
  • optional
  • default: 0

vertical angle start of the sphere

params.thetaLengthNumber
  • optional
  • default: Math.PI

vertical length of the sphere

Public Members

public geometry: * source

Override:

Mesh#geometry

public geometryNormalAttributes: * source

Override:

Mesh#geometryNormalAttributes

public geometryUVAttributes: * source

Override:

Mesh#geometryUVAttributes

public geometryVerticesAttributes: * source

Override:

Mesh#geometryVerticesAttributes

public heightSegments: * source

public phiLength: * source

public phiStart: * source

public radius: * source

public segments: * source

public thetaLength: * source

public thetaStart: * source

public transform: * source

Override:

Mesh#transform

public widthSegments: * source

Private Members

private _mesh: * source

Override:

Mesh#_mesh