Isle
Loading...
Searching...
No Matches
LegoMesh Class Reference

[AI] Represents the rendering attributes and state of a LEGO mesh, including color, transparency, shading mode, texture, and material. More...

#include <legomesh.h>

Collaboration diagram for LegoMesh:

Public Types

enum  { e_flat , e_gouraud , e_wireframe }
 [AI] Shading mode enumeration for mesh rendering. More...
 

Public Member Functions

 LegoMesh ()
 
virtual ~LegoMesh ()
 
LegoColor GetColor ()
 [AI] Returns the mesh's primary color. More...
 
void SetColor (LegoColor p_color)
 [AI] Sets the mesh's primary color. More...
 
LegoFloat GetAlpha ()
 [AI] Gets the mesh's transparency alpha value. More...
 
LegoU8 GetShading ()
 [AI] Gets the shading mode of the mesh. More...
 
void SetShading (LegoU8 p_shading)
 [AI] Sets the shading mode. More...
 
LegoU8 GetUnknown0x0d ()
 [AI] Returns the value of an unknown flag or property at offset 0x0d. More...
 
const LegoCharGetTextureName ()
 [AI] Returns the texture resource name associated with the mesh. More...
 
const LegoCharGetMaterialName ()
 [AI] Returns the material resource name for the mesh. More...
 
LegoBool GetUnknown0x21 ()
 [AI] Returns the value of an unknown boolean at offset 0x21. More...
 
LegoResult Read (LegoStorage *p_storage)
 [AI] Reads mesh properties (color, alpha, shading, flags, names) from the given storage stream. More...
 

Protected Attributes

LegoColor m_color
 [AI] The main (diffuse) color of the mesh. More...
 
LegoFloat m_alpha
 [AI] Mesh transparency (0=transparent, 1=opaque). More...
 
LegoU8 m_shading
 [AI] Shading mode (see enum above). More...
 
LegoU8 m_unk0x0d
 [AI] Unknown property/flag at offset 0x0d. More...
 
LegoMeshUnkComponentm_unk0x10
 [AI] Unknown pointer; owned; deleted in destructor. [AI] More...
 
undefined4 m_unk0x14
 [AI] Unknown 4-byte field; unused. [AI] More...
 
LegoCharm_textureName
 [AI] Name of texture resource, null if none; string is lowercase. More...
 
LegoCharm_materialName
 [AI] Name of material resource, null if none; string is lowercase. More...
 
undefined m_unk0x20
 [AI] Single unused/padding byte. More...
 
LegoBool m_unk0x21
 [AI] Unknown boolean property; function unknown. More...
 

Detailed Description

[AI] Represents the rendering attributes and state of a LEGO mesh, including color, transparency, shading mode, texture, and material.

[AI] This class encapsulates information about a mesh's appearance — its color, alpha (transparency), shading mode (flat/gouraud/wireframe), and optionally a texture and material name. It supports serialization/deserialization via the Read() method (reading all mesh color and material properties from a LegoStorage).

Definition at line 51 of file legomesh.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

[AI] Shading mode enumeration for mesh rendering.

[AI] Used to select the shading method: flat, Gouraud interpolated, or wireframe rendering for the mesh.

Enumerator
e_flat 

[AI] Use flat shading (per-polygon color).

e_gouraud 

[AI] Use gouraud shading (interpolated vertex colors).

e_wireframe 

[AI] Use wireframe rendering.

Definition at line 57 of file legomesh.h.

Constructor & Destructor Documentation

◆ LegoMesh()

LegoMesh::LegoMesh ( )

Definition at line 9 of file legomesh.cpp.

◆ ~LegoMesh()

LegoMesh::~LegoMesh ( )
virtual

Definition at line 23 of file legomesh.cpp.

Member Function Documentation

◆ GetAlpha()

LegoFloat LegoMesh::GetAlpha ( )
inline

[AI] Gets the mesh's transparency alpha value.

[AI] 0.0 = fully transparent, 1.0 = fully opaque.

Definition at line 81 of file legomesh.h.

◆ GetColor()

LegoColor LegoMesh::GetColor ( )
inline

[AI] Returns the mesh's primary color.

Definition at line 69 of file legomesh.h.

◆ GetMaterialName()

const LegoChar * LegoMesh::GetMaterialName ( )
inline

[AI] Returns the material resource name for the mesh.

[AI] Material name is a null-terminated lowercase string, or nullptr if no material. [AI]

Definition at line 111 of file legomesh.h.

◆ GetShading()

LegoU8 LegoMesh::GetShading ( )
inline

[AI] Gets the shading mode of the mesh.

[AI] Value corresponds to the shading enum (e_flat, e_gouraud, e_wireframe).

Definition at line 87 of file legomesh.h.

◆ GetTextureName()

const LegoChar * LegoMesh::GetTextureName ( )
inline

[AI] Returns the texture resource name associated with the mesh.

[AI] Texture name is a null-terminated lowercase string, or nullptr if no texture. [AI]

Definition at line 105 of file legomesh.h.

◆ GetUnknown0x0d()

LegoU8 LegoMesh::GetUnknown0x0d ( )
inline

[AI] Returns the value of an unknown flag or property at offset 0x0d.

[AI] Purpose of this property is currently unidentified. [AI]

Definition at line 99 of file legomesh.h.

◆ GetUnknown0x21()

LegoBool LegoMesh::GetUnknown0x21 ( )
inline

[AI] Returns the value of an unknown boolean at offset 0x21.

[AI] This boolean is initialized to FALSE but its function is unknown. [AI]

Definition at line 117 of file legomesh.h.

◆ Read()

LegoResult LegoMesh::Read ( LegoStorage p_storage)

[AI] Reads mesh properties (color, alpha, shading, flags, names) from the given storage stream.

[AI] This method deserializes the mesh data, loading color, alpha, shading, unknown properties, texture and material names, from a LegoStorage. [AI]

Parameters
p_storageStorage source to read from. [AI]

Definition at line 39 of file legomesh.cpp.

◆ SetColor()

void LegoMesh::SetColor ( LegoColor  p_color)
inline

[AI] Sets the mesh's primary color.

Parameters
p_colorNew color value. [AI]

Definition at line 75 of file legomesh.h.

◆ SetShading()

void LegoMesh::SetShading ( LegoU8  p_shading)
inline

[AI] Sets the shading mode.

Parameters
p_shadingNew shading mode (should be one of the enum values). [AI]

Definition at line 93 of file legomesh.h.

Member Data Documentation

◆ m_alpha

LegoFloat LegoMesh::m_alpha
protected

[AI] Mesh transparency (0=transparent, 1=opaque).

Definition at line 131 of file legomesh.h.

◆ m_color

LegoColor LegoMesh::m_color
protected

[AI] The main (diffuse) color of the mesh.

Definition at line 130 of file legomesh.h.

◆ m_materialName

LegoChar* LegoMesh::m_materialName
protected

[AI] Name of material resource, null if none; string is lowercase.

Definition at line 137 of file legomesh.h.

◆ m_shading

LegoU8 LegoMesh::m_shading
protected

[AI] Shading mode (see enum above).

Definition at line 132 of file legomesh.h.

◆ m_textureName

LegoChar* LegoMesh::m_textureName
protected

[AI] Name of texture resource, null if none; string is lowercase.

Definition at line 136 of file legomesh.h.

◆ m_unk0x0d

LegoU8 LegoMesh::m_unk0x0d
protected

[AI] Unknown property/flag at offset 0x0d.

Definition at line 133 of file legomesh.h.

◆ m_unk0x10

LegoMeshUnkComponent* LegoMesh::m_unk0x10
protected

[AI] Unknown pointer; owned; deleted in destructor. [AI]

Definition at line 134 of file legomesh.h.

◆ m_unk0x14

undefined4 LegoMesh::m_unk0x14
protected

[AI] Unknown 4-byte field; unused. [AI]

Definition at line 135 of file legomesh.h.

◆ m_unk0x20

undefined LegoMesh::m_unk0x20
protected

[AI] Single unused/padding byte.

Definition at line 138 of file legomesh.h.

◆ m_unk0x21

LegoBool LegoMesh::m_unk0x21
protected

[AI] Unknown boolean property; function unknown.

Definition at line 139 of file legomesh.h.


The documentation for this class was generated from the following files: