#include <TModel.h>
Definition at line 34 of file TModel.h.
◆ t_CustomRenderCB
◆ t_PreRenderCB
◆ TModelInstance()
TModelInstance::TModelInstance |
( |
TModel * | a_pModel | ) |
|
Definition at line 253 of file TModel.cpp.
254{
255 m_pModel = a_pModel;
256 m_pSkeletonInstance =
TNULL;
257 m_fnPreRenderCb = 0;
258 m_fnCustomRenderCb =
TNULL;
259 m_pCustomRenderCbUserData =
TNULL;
260 m_iCurrentLOD = 0;
261}
◆ ~TModelInstance()
TModelInstance::~TModelInstance |
( |
| ) |
|
◆ Delete()
void TModelInstance::Delete |
( |
| ) |
|
Definition at line 319 of file TModel.cpp.
320{
321 if ( m_pSkeletonInstance )
322 {
323 m_pSkeletonInstance->Delete();
324 m_pSkeletonInstance =
TNULL;
325 }
326
327 m_pModel->m_iNumInstances--;
329 delete this;
330}
◆ GetLOD()
TINT32 TModelInstance::GetLOD |
( |
| ) |
|
Definition at line 313 of file TModel.cpp.
314{
315 return m_iCurrentLOD;
316}
◆ GetModel()
TModel * TModelInstance::GetModel |
( |
| ) |
const |
Definition at line 332 of file TModel.cpp.
333{
334 return m_pModel;
335}
◆ GetSkeletonInstance()
Definition at line 337 of file TModel.cpp.
338{
339 return m_pSkeletonInstance;
340}
◆ Render()
void TModelInstance::Render |
( |
| ) |
|
Definition at line 273 of file TModel.cpp.
274{
275 if ( m_fnPreRenderCb )
276 {
277 m_fnPreRenderCb( this );
278 }
279
280 if ( !m_fnCustomRenderCb )
281 {
282 m_pSkeletonInstance->UpdateState(
TTRUE );
284
285 for (
TINT i = 0; i < m_pModel->m_LODs[ m_iCurrentLOD ].iNumMeshes; i++ )
286 {
287 auto pMesh = m_pModel->m_LODs[ m_iCurrentLOD ].ppMeshes[ i ];
288 pMesh->Render();
289 }
290 }
291 else
292 {
293 m_fnCustomRenderCb( this, m_pCustomRenderCbUserData );
294 }
295}
void SetSkeletonInstance(TSkeletonInstance *a_pSkeletonInstance)
TRenderContext * GetCurrentContext() const
static TFORCEINLINE TRenderInterface * GetSingleton()
◆ SetCustomRenderMethod()
void TModelInstance::SetCustomRenderMethod |
( |
t_CustomRenderCB | a_fnCallback, |
|
|
void * | a_pUserData ) |
Definition at line 302 of file TModel.cpp.
303{
304 m_fnCustomRenderCb = a_fnCallback;
305 m_pCustomRenderCbUserData = a_pUserData;
306}
◆ SetLOD()
void TModelInstance::SetLOD |
( |
TINT32 | a_iLOD | ) |
|
Definition at line 308 of file TModel.cpp.
309{
310 m_iCurrentLOD = a_iLOD;
311}
◆ SetPreRenderCallback()
void TModelInstance::SetPreRenderCallback |
( |
t_PreRenderCB | a_fnCallback | ) |
|
Definition at line 297 of file TModel.cpp.
298{
299 m_fnPreRenderCb = a_fnCallback;
300}
◆ Update()
void TModelInstance::Update |
( |
TFLOAT | a_fDeltaTime | ) |
|
Definition at line 267 of file TModel.cpp.
268{
269 m_pSkeletonInstance->UpdateTime( a_fDeltaTime );
270}
◆ TModel
The documentation for this class was generated from the following files:
- D:/_dev/OpenBarnyard/Source/Toshi/Source/Render/TModel.h
- D:/_dev/OpenBarnyard/Source/Toshi/Source/Render/TModel.cpp