Class Line3

The base class for 3D lines. This class extends Node3 so it can be added directly to the GopherGfx 3D scene graph. The class can draw line segments, line strips, and line loops. The vertices are interpreted differently depending upon the LineMode3 that is set. WebGL only supports lines that are exactly 1 pixel thick. These can look a bit strange in 3D scenes because the thickness of the line does not vary with the depth from the camera. So, the lines that this class can draw are most useful as quick debugging aids. To draw a more substantial "line" that actually behaves like it has some thickness in your 3D scene, you need to construct your line using triangles.

Hierarchy

Constructors

Properties

_localBoundingBox: BoundingBox3

Bounding box in this transform's local coordinate space

_localBoundingSphere: BoundingSphere

Bounding circle in this transform's local coordinate space

_position: Vector3

The position of this node as a Vector3.

_rotation: Quaternion

The rotation of this transform represented as a quaternion.

_scale: Vector3

The scale of this node as a Vector3.

_worldBoundingBox: BoundingBox3

Bounding box in the world coordinate space

_worldBoundingSphere: BoundingSphere

Bounding box in the world coordinate space

boundingBox: BoundingBox3

The bounding box in vertex coordinate space

boundingSphere: BoundingSphere

The bounding sphere in vertex coordinate space

children: Node3[]
color: Color
colorAttribute: number
colorBuffer: null | WebGLBuffer
colorUniform: null | WebGLUniformLocation
gl: WebGL2RenderingContext
hasVertexColors: boolean

Flag that determines whether to use vertex colors.

lineMode: number
localBoundsDirty: boolean
localMatrixDirty: boolean
localMatrixNegScale: boolean
localMatrixUpdated: boolean
localToParentMatrix: Matrix4

The local transformation matrix of this node.

localToWorldMatrix: Matrix4

The world transformation matrix of this node.

modelViewUniform: null | WebGLUniformLocation
parent: null | Node3

The parent transform of this transform. Null if this transform has no parent.

positionAttribute: number
positionBuffer: null | WebGLBuffer
projectionUniform: null | WebGLUniformLocation
texCoordAttribute: number
textureUniform: null | WebGLUniformLocation
useTextureUniform: null | WebGLUniformLocation
vertexCount: number
visible: boolean

Whether this transform is currently visible in the scene.

worldBoundsDirty: boolean
worldMatrixDirty: boolean

Accessors

Methods

  • Checks for intersection between this Node3 and another

    Returns

    Whether or not the two objects intersect

    Parameters

    • other: Node3

      The other Node3 object

    • mode: IntersectionMode3 = IntersectionMode3.BOUNDING_SPHERE

      The IntersectionMode3 to use for the comparison (default: BOUNDING_SPHERE)

    • space: CoordinateSpace3 = CoordinateSpace3.LOCAL_SPACE

      The CoordinateSpace3 to use for the comparison (default: LOCAL_SPACE)

    Returns boolean

  • Rotates this Node3 object to look at the given target with the given up vector

    Parameters

    • target: Vector3

      The Vector3 representing the target in world space

    • up: Vector3 = Vector3.UP

      The Vector3 representing the up direction (defaults to Vector3.UP)

    • coordinateSpace: CoordinateSpace3 = CoordinateSpace3.LOCAL_SPACE

    Returns void

  • Removes the current Node3 from its parent Node3

    Returns

    true if the Node3 was successfully removed, false otherwise

    Returns boolean

  • Traverses the scene graph starting from this Node3 object and updates the world matrices of all Node3 objects in the graph.

    Parameters

    • parentMatrixDirty: boolean = false

    Returns void

  • Updates the world matrix of this Node3 by computing the multiplication of its local matrix with its parent's world matrix (if it has a parent).

    Returns

    void

    Returns void

Generated using TypeDoc