declare namespace pc { /** * @name pc.Mesh * @class A graphical primitive. The mesh is defined by a {@link pc.VertexBuffer} and an optional * {@link pc.IndexBuffer}. It also contains a primitive definition which controls the type of the * primitive and the portion of the vertex or index buffer to use. * @description Create a new mesh. * @property {pc.VertexBuffer} vertexBuffer The vertex buffer holding the vertex data of the mesh. * @property {pc.IndexBuffer[]} indexBuffer An array of index buffers. For unindexed meshes, this array can * be empty. The first index buffer in the array is used by {@link pc.MeshInstance}s with a renderStyle * property set to pc.RENDERSTYLE_SOLID. The second index buffer in the array is used if renderStyle is * set to pc.RENDERSTYLE_WIREFRAME. * @property {Object[]} primitive Array of primitive objects defining how vertex (and index) data in the * mesh should be interpreted by the graphics device. For details on the primitive object, see * {@link pc.GraphicsDevice#draw}. The primitive is ordered based on render style like the indexBuffer property. * @property {pc.BoundingBox} aabb The axis-aligned bounding box for the object space vertices of this mesh. */ class Mesh { vertexBuffer: pc.VertexBuffer; indexBuffer: pc.IndexBuffer; primitive: {}[]; aabb: pc.BoundingBox; } /** * @name pc.MeshInstance * @class An instance of a {@link pc.Mesh}. A single mesh can be referenced by many * mesh instances that can have different transforms and materials. * @description Create a new mesh instance. * @param {pc.GraphNode} node The graph node defining the transform for this instance. * @param {pc.Mesh} mesh The graphics mesh being instanced. * @param {pc.Material} material The material used to render this instance. * @example * // Create a mesh instance pointing to a 1x1x1 'cube' mesh * var mesh = pc.createBox(graphicsDevice); * var material = new pc.StandardMaterial(); * var node = new pc.GraphNode(); * var meshInstance = new pc.MeshInstance(node, mesh, material); * @property {pc.BoundingBox} aabb The world space axis-aligned bounding box for this * mesh instance. * @property {Boolean} castShadow Controls whether the mesh instance casts shadows. * Defaults to false. * @property {Boolean} visible Enable rendering for this mesh instance. Use visible property to enable/disable rendering without overhead of removing from scene. * But note that the mesh instance is still in the hierarchy and still in the draw call list. * @property {Number} layer The layer used by this mesh instance. Layers define drawing order. Can be: *