Mesh
Mesh ⟵ Object3D
Class representing triangular polygon mesh based objects.
This class inherits from Object3D and
serves as the base for renderable 3D objects. It combines geometry data
with material properties to create visible meshes in the scene. Since
Mesh inherits from Object3D, it has all
the same transformation and hierarchy capabilities, plus mesh-specific
functionality.
- Rendering 3D geometry with materials
- Managing geometry and material resources
- Supporting morph targets and animations
- Providing raycasting capabilities
- Serving as base class for specialized mesh types
Methods
Mesh()
Default constructor - creates an empty mesh
Mesh(BufferGeometry* geom)
Constructor with geometry
| geom | Pointer to the geometry to use |
Mesh(BufferGeometry* geom, Material* mat)
Constructor with geometry and material
| geom | Pointer to the geometry to use | |
| mat | Pointer to the material to use |
Mesh* clone(bool recursive = true) const override
Creates a copy of this mesh
| recursive | Whether to clone all child objects as well |
void copy(const Object3D& object, bool recursive = true) override
Copies properties from another object
| object | Source object to copy from | |
| recursive | Whether to copy all child objects as well |
void setGeometry(BufferGeometry* geom)
Sets the geometry for this mesh
| geom | Pointer to the geometry to use |
void setMaterial(Material* mat)
Sets the material for this mesh
| mat | Pointer to the material to use |
Vector3 getVertexPosition(u32 index, Vector3& target) const
Gets the local-space position of a vertex
| index | Vertex index | |
| target | Vector to store the result |
virtual void render()
Renders this mesh
Properties
| geometry | BufferGeometry* | Geometry defining the object's structure |
| isMesh | bool | Read-only flag to check if object is Mesh |
| material | Material* | Material defining the object's appearance |
| morphTargetDictionary | map<string, u32> | Dictionary of morph target names to indices |
| morphTargetInfluences | vector |
Array of morph target weights |