gameparaent.h
来自「<B>DirectX9.0 3D游戏编程</B>」· C头文件 代码 · 共 72 行
H
72 行
/*******************************************************************
* Advanced 3D Game Programming using DirectX 8.0
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Title: GameParaEnt.h
* Desc: Parametric object. This object isn't used in the game,
* but is left
* copyright (c) 2001 by Peter A Walsh and Adrian Perez
* See license.txt for modification and distribution information
******************************************************************/
#ifndef _GAMEPARAENT_H
#define _GAMEPARAENT_H
#include "GameEnt.h"
enum eParaEntType
{
petRocket, // rockets, sent by the server
petSpark // sparks, totally client-side.
};
objID GetNextTempParaID();
objID GetNextParaEntID();
class cGameParaEnt : public cGameEnt
{
eParaEntType m_type;
point3 m_x0, m_v0, m_a;
float m_t;
cGameParaEnt();
int m_nBounces; // for sparks.
public:
virtual void Tick( float tickLength );
virtual bool RespondToCollision( cGameEnt* pOther );
/**
* We extend the base set of message handling abilities
*/
virtual uint ProcMsg( const sMsg& msg );
virtual bool HitsObjects()
{
switch( m_type )
{
case petRocket:
return true;
case petSpark:
return false;
}
return true;
}
/**
* Create a spawn entity
*/
static cGameParaEnt* CreateParaEnt(
eParaEntType type,
objID id,
const point3& x0,
float tInitial,
const point3& v0,
const point3& a );
};
#endif // _GAMEPARAENT_H
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?