ModelComponent

@MainThread
class ModelComponent : Component

A Component that renders 3D models.

ModelComponent is part of the Entity-Component-System (ECS) architecture and defines an entity's visual appearance using a mesh and materials.

Notes:

  • A Mesh is a collection of vertices, edges, and faces that define the shape of a 3D object.

  • Materials define the appearance of the surface of a mesh. They include properties like color and textures.

Constructors

Link copied to clipboard
constructor(mesh: MeshResource, material: Material)

Creates a ModelComponent with the specified mesh and material.

constructor(mesh: MeshResource, materials: Array<Material>)

Creates a ModelComponent with the specified mesh and an array of materials.

Types

Link copied to clipboard
class MaterialArray : Iterable<Material>

A dynamic array of Material instances for a ModelComponent.

Properties

Link copied to clipboard
var isVisible: Boolean

Controls whether this model component is rendered.

Link copied to clipboard

The Material instance of the model.

Link copied to clipboard

The MeshResource instance of the model.

Link copied to clipboard

The MeshInstancesResource instance of the model. The default value is null.

Functions

Link copied to clipboard
open override fun clone(): Component

Creates and returns a copy of this Component instance.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String