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

[AI] Represents a Level of Detail (LOD) object for rendering, implemented with a mesh builder and supporting bitwise flag operations. More...

#include <viewlod.h>

Inheritance diagram for ViewLOD:
Collaboration diagram for ViewLOD:

Public Types

enum  { c_bit4 = 0x10 }
 

Public Member Functions

 ViewLOD (Tgl::Renderer *pRenderer)
 [AI] Constructs a ViewLOD using the provided Tgl Renderer. More...
 
 ~ViewLOD () override
 [AI] Destructor, deletes the owned mesh builder if present. More...
 
double AveragePolyArea () const override
 [AI] Approximates the average area of polygons within this LOD. More...
 
int NVerts () const override
 [AI] Returns the estimated number of vertices in this LOD. More...
 
Tgl::MeshBuilderGetMeshBuilder ()
 [AI] Returns a pointer to the mesh builder associated with this LOD. More...
 
const Tgl::MeshBuilderGetMeshBuilder () const
 [AI] Returns a const pointer to the mesh builder for this LOD. More...
 
undefined4 GetUnknown0x08 ()
 [AI] Returns the internal flag value m_unk0x08. More...
 
unsigned char GetUnknown0x08Test4 ()
 [AI] Performs a bitwise AND (mask) with value 0xffffff04 on the internal flag, returning result as an unsigned char. More...
 
unsigned char GetUnknown0x08Test8 ()
 [AI] Performs a bitwise AND (mask) with value 0xffffff08 on the internal flag, returning result as an unsigned char. More...
 
void SetFlag (unsigned char p_flag)
 [AI] Sets a given flag in the internal flags (m_unk0x08) using bitwise OR. More...
 
void ClearFlag (unsigned char p_flag)
 [AI] Clears a given flag in the internal flags (m_unk0x08) using bitwise AND with negated p_flag. More...
 
- Public Member Functions inherited from LODObject
virtual ~LODObject ()
 
virtual double AveragePolyArea () const =0
 [AI] Returns the average polygon area for this LOD. More...
 
virtual int NVerts () const =0
 [AI] Returns the number of vertices for this LOD. More...
 
virtual int NumPolys () const =0
 [AI] Returns the number of polygons for this LOD. More...
 
virtual float VTable0x10 ()=0
 [AI] Unknown method related to the LOD. More...
 

Protected Attributes

Tgl::MeshBuilderm_meshBuilder
 [AI] Points to a mesh builder instance for constructing or managing polygonal mesh data for this LOD. More...
 
undefined4 m_unk0x08
 [AI] Internal bitfield for flag/status storage controlling LOD state and behavior. More...
 

Detailed Description

[AI] Represents a Level of Detail (LOD) object for rendering, implemented with a mesh builder and supporting bitwise flag operations.

[AI] ViewLOD handles a group of polygons (LODObject) at a specific detail level, utilizing a Tgl::MeshBuilder for 3D mesh construction. It provides methods for average polygon area estimation and custom flag manipulation, intended for optimizing rendering performance based on distance or importance. The flags in m_unk0x08 are manipulated to affect the object's LOD state.

Definition at line 20 of file viewlod.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
c_bit4 

[AI] Flag value for bit 4 mask operation.

[AI]

Definition at line 22 of file viewlod.h.

Constructor & Destructor Documentation

◆ ViewLOD()

ViewLOD::ViewLOD ( Tgl::Renderer pRenderer)
inline

[AI] Constructs a ViewLOD using the provided Tgl Renderer.

The mesh builder is initialized to NULL and internal flag to 3.

Parameters
pRendererTgl Renderer associated with the mesh construction. [AI]

Definition at line 30 of file viewlod.h.

◆ ~ViewLOD()

ViewLOD::~ViewLOD ( )
override

[AI] Destructor, deletes the owned mesh builder if present.

Definition at line 4 of file viewlod.cpp.

Member Function Documentation

◆ AveragePolyArea()

double ViewLOD::AveragePolyArea ( ) const
inlineoverridevirtual

[AI] Approximates the average area of polygons within this LOD.

[AI] Returns an average polygon area based on 2π*10 divided by the number of polygons. Used for LOD management heuristics. [AI]

Returns
The average polygon area estimate. [AI]

Implements LODObject.

Definition at line 42 of file viewlod.h.

◆ ClearFlag()

void ViewLOD::ClearFlag ( unsigned char  p_flag)
inline

[AI] Clears a given flag in the internal flags (m_unk0x08) using bitwise AND with negated p_flag.

Parameters
p_flagFlag bits to clear. [AI]

Definition at line 93 of file viewlod.h.

◆ GetMeshBuilder() [1/2]

Tgl::MeshBuilder * ViewLOD::GetMeshBuilder ( )
inline

[AI] Returns a pointer to the mesh builder associated with this LOD.

Returns
Mesh builder object pointer. [AI]

Definition at line 55 of file viewlod.h.

◆ GetMeshBuilder() [2/2]

const Tgl::MeshBuilder * ViewLOD::GetMeshBuilder ( ) const
inline

[AI] Returns a const pointer to the mesh builder for this LOD.

Returns
Const mesh builder pointer. [AI]

Definition at line 61 of file viewlod.h.

◆ GetUnknown0x08()

undefined4 ViewLOD::GetUnknown0x08 ( )
inline

[AI] Returns the internal flag value m_unk0x08.

Returns
Internal flag state. [AI]

Definition at line 67 of file viewlod.h.

◆ GetUnknown0x08Test4()

unsigned char ViewLOD::GetUnknown0x08Test4 ( )
inline

[AI] Performs a bitwise AND (mask) with value 0xffffff04 on the internal flag, returning result as an unsigned char.

[AI] Typically used to test or extract specific flags or bits from m_unk0x08. [AI]

Returns
Result of flag AND operation. [AI]

Definition at line 74 of file viewlod.h.

◆ GetUnknown0x08Test8()

unsigned char ViewLOD::GetUnknown0x08Test8 ( )
inline

[AI] Performs a bitwise AND (mask) with value 0xffffff08 on the internal flag, returning result as an unsigned char.

[AI] Used for testing or extracting certain flag bits. [AI]

Returns
Result of flag AND operation. [AI]

Definition at line 81 of file viewlod.h.

◆ NVerts()

int ViewLOD::NVerts ( ) const
inlineoverridevirtual

[AI] Returns the estimated number of vertices in this LOD.

[AI] Calculates the vertex count as double the number of polygons. [AI]

Returns
Number of vertices. [AI]

Implements LODObject.

Definition at line 49 of file viewlod.h.

◆ SetFlag()

void ViewLOD::SetFlag ( unsigned char  p_flag)
inline

[AI] Sets a given flag in the internal flags (m_unk0x08) using bitwise OR.

Parameters
p_flagFlag bits to set. [AI]

Definition at line 87 of file viewlod.h.

Member Data Documentation

◆ m_meshBuilder

Tgl::MeshBuilder* ViewLOD::m_meshBuilder
protected

[AI] Points to a mesh builder instance for constructing or managing polygonal mesh data for this LOD.

Definition at line 102 of file viewlod.h.

◆ m_unk0x08

undefined4 ViewLOD::m_unk0x08
protected

[AI] Internal bitfield for flag/status storage controlling LOD state and behavior.

Usage is determined by bit masking via accessor methods.

Definition at line 107 of file viewlod.h.


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