Interface AbstractMesh<G, M>

interface AbstractMesh<G, M> {
    color: Color;
    geometry: G;
    material: M;
    name: string;
    opacity: number;
    pointSize: number;
    R: Geometric3;
    transparent: boolean;
    visible: boolean;
    X: Geometric3;
    addRef?(): number;
    bind(): AbstractDrawable<G, M>;
    contextFree?(): void;
    contextGain?(): void;
    contextLost?(): void;
    draw(): AbstractDrawable<G, M>;
    release?(): number;
    render(ambients: Facet[]): AbstractDrawable<G, M>;
    setAmbients(ambients: Facet[]): AbstractDrawable<G, M>;
    setUniforms(): AbstractDrawable<G, M>;
    unbind(): AbstractDrawable<G, M>;
    use(): AbstractDrawable<G, M>;
}

Type Parameters

Hierarchy (view full)

Implemented by

Properties

color: Color
geometry: G

The Geometry that provides the buffered vertex attributes for this AbstractDrawable.

Geometry is a shareable WebGL resource and so is reference counted. Consequently, accessing the geometry property increments the Geometry instance reference count. Be sure to call release() on shareable WebGL resources in order to prevent memory leaks.

material: M

The Material that provides the WebGLProgram for this AbstractDrawable.

Material is a shareable WebGL resource and so is reference counted. Consequently, accessing the material property increments the Material instance reference count. Be sure to call release() on shareable WebGL resources in order to prevent memory leaks.

name: string
opacity: number
pointSize: number
transparent: boolean

Determines when this object will be drawn. Transparent objects should be rendered after non-transparent objects.

visible: boolean

Determines whether this object will be drawn.

Methods

  • Increments the reference count of an Shareable instance.

    Returns number

    The new reference count. This value is intended to be used only for testing purposes.

  • Called to request the consumer to free any WebGL resources acquired and owned. The consumer may assume that its cached context is still valid in order to properly dispose of any cached resources. In the case of shared objects, this method may be called multiple times for what is logically the same context. In such cases the consumer must be idempotent and respond only to the first request.

    Returns void

  • Called to inform the dependent of a loss of WebGL rendering context. The dependent must assume that any cached context is invalid. The dependent must not try to use and cached context to free resources. The dependent should reset its state to that for which there is no context.

    Returns void