Skip to Main Content
3D Game Engine Design, 2nd Edition
book

3D Game Engine Design, 2nd Edition

by David Eberly
November 2006
Intermediate to advanced content levelIntermediate to advanced
1040 pages
26h 31m
English
CRC Press
Content preview from 3D Game Engine Design, 2nd Edition
798 Chapter 18 Object-Oriented Infrastructure
class Rtti
{
public:
Rtti (const char* acName, int iNumBaseClasses,...)
{
m_acName = acName;
if (iNumBaseClasses == 0)
{
m_iNumBaseClasses = 0;
m_apkBaseType = 0;
}
else
{
m_iNumBaseClasses = iNumBaseClasses;
m_apkBaseType = new Rtti*[iNumBaseClasses];
va_list list;
va_start(list,iNumBaseClasses);
for(inti=0;i<iNumBaseClasses; i++)
{
m_apkBaseType[i] = va_arg(list, const Rtti*);
}
va_end(list);
}
}
~Rtti ()
{
delete[] m_apkBaseType;
}
bool IsDerived (const Rtti& rkType) const
{
if (&rkType == this)
{
return true;
}
for(inti=0;i<m_iNumBaseClasses; i++)
{
if (m_apkBaseType[i]->IsDerived(rkType))
{
return true;
}
}
return false;
}
18.3 Run-Time Type Information 799
// ... other public functions ...
private:
const char* m_acName;
unsigned int
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

3D Game Engine Architecture

3D Game Engine Architecture

David Eberly
Blender 3D By Example - Second Edition

Blender 3D By Example - Second Edition

Oscar Baechler, Xury Greer
Computer Graphics

Computer Graphics

Alexey Boreskov, Evgeniy Shikin

Publisher Resources

ISBN: 9781482267303