Gets bounding box set using set boundingBox. Note! may be different from Cogs boundingbox if attaching to exising mesh.
Sets the bounding box for the Mesh. Override auto-calc. Highly recommended for performance.
Extents of the mesh positions in Local Coordinates.
Protected
bridgeInternal bridge access
Gets RGBA colors.
colors. Array length is 4*N.
Sets RGBA color values.
color data. Array length must be 4*N.
Gets the COGS resource ID of the Resource
resource ID
Get mesh indices.
indices. Returns type of index data set 32 or 16 bit.
Set mesh indices.
32 or 16 bit indices.
Gets Mesh instancing RGBA colors.
colors. Array length is 4*N.
Sets Mesh instancing RGBA color values.
color data. Array length must be 4*N.
Gets Mesh instancing position data.
Positions. Length is 3*N.
Sets Mesh instancing position data.
Positions. Length must be N*3.
Returns flag marking if resource is released
Gets the optional name
name of the resource
Gets normals data.
Normals. Array length is 3*N.
Sets normal data.
Normals. Array length must be N*3.
Gets position data.
Positions. Length is 3*N.
Sets position data.
Positions. Length must be N*3.
Gets the primitive type used to interpret the vertex data. Note: If attached to existing mesh, primitive type is not read from the mesh.
Selected primitive type.
Sets the primitive type used to interpret the vertex data.
Primitive type enum value.
Protected
runtimeInternal runtime access
Gets tangent data.
tangents. Array length is 3*N.
Sets tangent data.
Tangents. Array length must be N*3.
Gets texture coordinates.
Texture Coordinates. Array length is 2*N.
Sets texture coordinates.
Texture Coordinates. Array length must be N*2.
Compare two Cogs Resource types for equality.
Other resource.
True if same Resource class type & ID and belongs to same Cogs instance.
Protected
equalsCompare two Cogs Resource types for equality.
Other resource.
True if same Resource class type & ID and belongs to same Cogs instance.
Release to free resources after use
Protected
logLog error message
Release to free resources after use. Also release local handle after creating resource and passing to Cogs.
const model = runtime.ModelEntity.create("Model");
const modelResource: runtime.resources.loadModel(modelPath);
model.modelComponent.model = modelResource;
modelResource.release(); // ModelComponent now sole owner
internalRelease for actual release.
Take resource ownership. release() will release the resource. Can be used to release meshes loaded in scenes accessed through Mesh field getter.
Static
createStatic
create
Meshes contain streams of vertex data in addition to index data and options defining geometry used for rendering and picking.
Created by: Cogs.Resources.createMesh() Release using: Mesh.release()