OpenBarnyard
 
Loading...
Searching...
No Matches
ATreeManager::Model Class Reference

#include <ATreeManager.h>

Public Member Functions

 Model ()
 
 ~Model ()
 
void Load (const TCHAR *a_szModelName)
 

Public Attributes

friend ATreeManager
 

Detailed Description

Definition at line 31 of file ATreeManager.h.

Constructor & Destructor Documentation

◆ Model()

ATreeManager::Model::Model ( )

Definition at line 344 of file ATreeManager.cpp.

345{
346 m_pManagedModel = TNULL;
347 m_pSceneObject = TNULL;
348 m_uiID = 0;
349 m_iNumFOBs = 0;
350 m_pFOBMatrices = TNULL;
351}
#define TNULL
Definition Typedefs.h:23

◆ ~Model()

ATreeManager::Model::~Model ( )

Definition at line 354 of file ATreeManager.cpp.

355{
356 if ( m_pSceneObject )
357 m_pSceneObject->Delete();
358
359 if ( m_pManagedModel )
360 delete m_pManagedModel;
361
362 TVALIDPTR( m_pFOBMatrices );
363 delete[] m_pFOBMatrices;
364}
#define TVALIDPTR(PTR)
Definition Defines.h:139

Member Function Documentation

◆ Load()

void ATreeManager::Model::Load ( const TCHAR * a_szModelName)

Definition at line 366 of file ATreeManager.cpp.

367{
368 m_pManagedModel = new TManagedModel();
369 m_pManagedModel->Create( a_szModelName, AAssetLoader::GetAssetTRB( AAssetType_Startup ) );
370
371 // Create scene object
372 m_pSceneObject = m_pManagedModel->CreateSceneObject();
373 m_pSceneObject->GetTransform().SetMatrix( TMatrix44::IDENTITY );
374 m_pSceneObject->GetTransform().SetEuler( TVector3( TMath::PI / 2, 0.0f, 0.0f ) );
375 m_pSceneObject->GetTransform().SetTranslate( TVector3::VEC_ZERO );
376
377 // ?????????
378 TMatrix44 matTransform;
379 m_pSceneObject->GetTransform().GetLocalMatrixImp( matTransform );
380 m_pSceneObject->GetTransform().SetMatrix( matTransform );
381 m_pSceneObject->DisableSkeletonUpdate();
382
383 TModel* pModel = m_pManagedModel->GetModel();
384 for ( TINT i = 0; i < pModel->GetNumLODs(); i++ )
385 {
386 TModelLOD* pLOD = &pModel->GetLOD( i );
387
388 for ( TINT k = 0; k < pLOD->iNumMeshes; k++ )
389 {
390 TMesh* pMesh = pLOD->ppMeshes[ k ];
391
392 // Use HD lighting on skinned materials
393 if ( ASkinMaterialHAL* pSkinMat = TDYNAMICCAST( ASkinMaterialHAL, pMesh->GetMaterial() ) )
394 pSkinMat->SetHDLighting( TTRUE );
395 }
396 }
397}
#define TDYNAMICCAST(T, OBJECT)
Definition TObject.h:227
int TINT
Definition Typedefs.h:7
#define TTRUE
Definition Typedefs.h:25
@ AAssetType_Startup
Definition AAssetLoader.h:8
constexpr TFLOAT PI
Definition TMathInline.h:35
static constinit TMatrix44 IDENTITY
Definition TMatrix44.h:357
static constinit const TVector3 VEC_ZERO
Definition TVector3.h:150
TMaterial * GetMaterial() const
Definition TMesh.cpp:75
TINT iNumMeshes
Definition TModel.h:27
TMesh ** ppMeshes
Definition TModel.h:28
TINT GetNumLODs() const
Definition TModel.h:111
TModelLOD & GetLOD(TUINT32 a_uiLOD)
Definition TModel.h:115
static Toshi::TTRB * GetAssetTRB(AAssetType a_eAssetType)

Member Data Documentation

◆ ATreeManager

friend ATreeManager::Model::ATreeManager

Definition at line 34 of file ATreeManager.h.


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