29 #ifndef __GAME_ENTITY_H__
30 #define __GAME_ENTITY_H__
40 static const int DELAY_DORMANT_TIME = 3000;
94 #define MAX_SIGNAL_THREADS 16 // probably overkill, but idList uses a granularity of 16
161 void DetermineTimeGroup(
bool slowmo );
163 void SetGrabbedState(
bool grabbed );
180 const char *
GetName(
void )
const;
188 virtual void Think(
void );
201 virtual void SetModel(
const char *modelname );
212 virtual void Hide(
void );
213 virtual void Show(
void );
299 virtual bool IsAtRest(
void )
const;
475 void Event_SetGui(
int guiNum,
const char *guiName);
476 void Event_PrecacheGui(
const char *guiName );
477 void Event_GetGuiParm(
int guiNum,
const char *key);
478 void Event_GetGuiParmFloat(
int guiNum,
const char *key);
479 void Event_GuiNamedEvent(
int guiNum,
const char *event);
511 virtual void Think(
void );
516 virtual void SetModel(
const char *modelname );
556 SetTimeState(
int timeGroup );
559 void PushState(
int timeGroup );
562 ID_INLINE SetTimeState::SetTimeState() {
566 ID_INLINE SetTimeState::SetTimeState(
int timeGroup ) {
568 PushState( timeGroup );
571 ID_INLINE
void SetTimeState::PushState(
int timeGroup ) {
580 previousFast =
false;
604 ID_INLINE SetTimeState::~SetTimeState() {
607 if ( previousFast ) {
virtual void DormantBegin(void)
void Event_SetSkin(const char *skinname)
void FreeSoundEmitter(bool immediate)
bool TouchTriggers(void) const
renderEntity_t renderEntity
void Save(idSaveGame *savefile) const
void Event_StartSound(const char *soundName, int channel, int netSync)
void Event_Touches(idEntity *ent)
GLsizei const GLfloat * value
void Event_DistanceTo(idEntity *ent)
void WriteBindToSnapshot(idBitMsgDelta &msg) const
void Event_DistanceToPoint(const idVec3 &point)
void Event_GetFloatKey(const char *key)
idVec3 GetLocalCoordinates(const idVec3 &vec) const
void ClearSignalThread(signalNum_t signalnum, idThread *thread)
bool GetMasterPosition(idVec3 &masterOrigin, idMat3 &masterAxis) const
const idEventDef EV_CacheSoundShader
virtual idAnimator * GetAnimator(void)
virtual void DeconstructScriptObject(void)
bool GetFloorPos(float max_dist, idVec3 &floorpos) const
ABSTRACT_PROTOTYPE(idEntity)
bool UpdateRenderEntity(renderEntity_s *renderEntity, const renderView_t *renderView)
struct idEntity::entityFlags_s fl
void BindToJoint(idEntity *master, const char *jointname, bool orientated)
void Bind(idEntity *master, bool orientated)
virtual int GetModelDefHandle(void)
const idEventDef EV_GetShaderParm
void Event_SetName(const char *name)
void Event_GetVectorKey(const char *key)
void SetShaderParm(int parmnum, float value)
void Event_GetLinearVelocity(void)
void SignalEvent(idThread *thread, signalNum_t signalnum)
virtual void Teleport(const idVec3 &origin, const idAngles &angles, idEntity *destination)
void Event_FadeSound(int channel, float to, float over)
idEntity * GetBindMaster(void) const
void Event_SetGuiParm(const char *key, const char *val)
void Event_SetAngles(const idAngles &ang)
void SetAxis(const idMat3 &axis)
idScriptObject scriptObject
struct damageEffect_s damageEffect_t
const idEventDef EV_StartSoundShader
void Event_CacheSoundShader(const char *soundName)
void SetAngles(const idAngles &ang)
idList< idEntityPtr< idEntity > > targets
void InitDefaultPhysics(const idVec3 &origin, const idMat3 &axis)
void Event_SetOrigin(const idVec3 &org)
virtual void DamageFeedback(idEntity *victim, idEntity *inflictor, int &damage)
virtual void RemoveContactEntity(idEntity *ent)
void UpdatePVSAreas(void)
void Event_RestorePosition(void)
void ClearSignal(idThread *thread, signalNum_t signalnum)
bool IsBoundTo(idEntity *master) const
void JoinTeam(idEntity *teammember)
virtual void FreeModelDef(void)
const idEventDef EV_SetLinearVelocity
void Event_SetKey(const char *key, const char *value)
void Event_SetJointPos(jointHandle_t jointnum, jointModTransform_t transform_type, const idVec3 &pos)
idSoundEmitter * GetSoundEmitter(void) const
void Save(idSaveGame *savefile) const
void SetSoundVolume(float volume)
virtual void ApplyImpulse(idEntity *ent, int id, const idVec3 &point, const idVec3 &impulse)
const idEventDef EV_ActivateTargets
const idEventDef EV_GetAngles
const idEventDef EV_Activate
const idEventDef EV_SetOwner
virtual void ClientPredictionThink(void)
virtual bool HandleSingleGuiCommand(idEntity *entityGui, idLexer *src)
virtual void SetModel(const char *modelname)
static const int MAX_PVS_AREAS
void Event_Wait(float time)
virtual void FreeLightDef(void)
void SetName(const char *name)
virtual bool IsAtRest(void) const
void Restore(idRestoreGame *savefile)
void Event_SetSize(const idVec3 &mins, const idVec3 &maxs)
const idDeclParticle * type
idVec3 GetLocalVector(const idVec3 &vec) const
virtual void Killed(idEntity *inflictor, idEntity *attacker, int damage, const idVec3 &dir, int location)
void Event_SetGuiFloat(const char *key, float f)
virtual bool ClientReceiveEvent(int event, int time, const idBitMsg &msg)
virtual renderView_t * GetRenderView()
bool IsHidden(void) const
idCurve_Spline< idVec3 > * GetSpline(void) const
virtual void GetColor(idVec3 &out) const
int PVSAreas[MAX_PVS_AREAS]
bool HasSignal(signalNum_t signalnum) const
GLsizei GLsizei GLcharARB * source
int GetBindBody(void) const
bool StartSoundShader(const idSoundShader *shader, const s_channelType channel, int soundShaderFlags, bool broadcast, int *length)
virtual bool GetPhysicsToSoundTransform(idVec3 &origin, idMat3 &axis)
const idEventDef EV_FindTargets
virtual void AddDamageEffect(const trace_t &collision, const idVec3 &velocity, const char *damageDefName)
void WriteColorToSnapshot(idBitMsgDelta &msg) const
const idEventDef EV_SetSkin
void Event_GetColor(void)
void Event_GetKey(const char *key)
idPhysics * GetPhysics(void) const
void SetSkin(const idDeclSkin *skin)
virtual bool Collide(const trace_t &collision, const idVec3 &velocity)
void Event_RemoveBinds(void)
void Event_SetOwner(idEntity *owner)
bool StartSound(const char *soundName, const s_channelType channel, int soundShaderFlags, bool broadcast, int *length)
void UpdateFromPhysics(bool moveBack)
virtual renderEntity_t * GetRenderEntity(void)
void SetPhysics(idPhysics *phys)
virtual void GetImpactInfo(idEntity *ent, int id, const idVec3 &point, impactInfo_t *info)
const idEventDef EV_SetShaderParm
bool HandleGuiCommands(idEntity *entityGui, const char *cmds)
virtual void UpdateChangeableSpawnArgs(const idDict *source)
void Event_BindPosition(idEntity *master)
void Event_SetJointAngle(jointHandle_t jointnum, jointModTransform_t transform_type, const idAngles &angles)
idEntity * GetNextTeamEntity(void) const
void ServerSendEvent(int eventId, const idBitMsg *msg, bool saveEvent, int excludeClient) const
void Event_WaitFrame(void)
void Event_GetWorldOrigin(void)
void Event_StopSound(int channel, int netSync)
void Event_GetIntKey(const char *key)
damageEffect_t * damageEffects
virtual void WriteToSnapshot(idBitMsgDelta &msg) const
const idEventDef EV_Touch
void Event_GetJointPos(jointHandle_t jointnum)
void Event_SetColor(float red, float green, float blue)
void ReadGUIFromSnapshot(const idBitMsgDelta &msg)
void Event_GetJointHandle(const char *jointname)
virtual idAnimator * GetAnimator(void)
CLASS_PROTOTYPE(idAnimatedEntity)
void Event_SpawnBind(void)
bool PhysicsTeamInPVS(pvsHandle_t pvsHandle)
idLinkList< idEntity > spawnNode
virtual void ClientPredictionThink(void)
idLinkList< idEntity > snapshotNode
virtual void ShowEditingDialog(void)
virtual void Damage(idEntity *inflictor, idEntity *attacker, const idVec3 &dir, const char *damageDefName, const float damageScale, const int location)
void Event_UpdateCameraTarget(void)
void ClientSendEvent(int eventId, const idBitMsg *msg) const
void Event_GetNextKey(const char *prefix, const char *lastMatch)
void BindToBody(idEntity *master, int bodyId, bool orientated)
virtual void AddContactEntity(idEntity *ent)
void Event_SetNeverDormant(int enable)
const idDeclSkin * GetSkin(void) const
virtual void Present(void)
void Event_CallFunction(const char *name)
void FixupLocalizedStrings()
void Event_SetAngularVelocity(const idVec3 &velocity)
void RemoveNullTargets(void)
virtual bool Pain(idEntity *inflictor, idEntity *attacker, int damage, const idVec3 &dir, int location)
virtual bool ClientReceiveEvent(int event, int time, const idBitMsg &msg)
void SetSignal(signalNum_t signalnum, idThread *thread, const function_t *function)
void Event_IsHidden(void)
idVec3 GetWorldCoordinates(const idVec3 &vec) const
void Event_HasFunction(const char *name)
idEntity * GetTeamMaster(void) const
void Event_SetWorldOrigin(idVec3 const &org)
void Event_Bind(idEntity *master)
void AddLocalDamageEffect(jointHandle_t jointNum, const idVec3 &localPoint, const idVec3 &localNormal, const idVec3 &localDir, const idDeclEntityDef *def, const idMaterial *collisionMaterial)
renderView_t * renderView
void Event_SetShaderParm(int parmnum, float value)
const idEventDef EV_SetAngularVelocity
virtual void PostBind(void)
bool InitBind(idEntity *master)
void Event_StartSoundShader(const char *soundName, int channel)
void Event_FindTargets(void)
virtual void PreUnbind(void)
int GetListenerId(void) const
void Event_GetAngularVelocity(void)
virtual bool CanPlayChatterSounds(void) const
virtual void AddForce(idEntity *ent, int id, const idVec3 &point, const idVec3 &force)
void Event_GetEntityKey(const char *key)
virtual void SetColor(float red, float green, float blue)
virtual int GetDefaultSurfaceType(void) const
static bool ModelCallback(renderEntity_s *renderEntity, const renderView_t *renderView)
void Signal(signalNum_t signalnum)
void Event_NumTargets(void)
bool GetJointWorldTransform(jointHandle_t jointHandle, int currentTime, idVec3 &offset, idMat3 &axis)
idVec3 GetWorldVector(const idVec3 &vec) const
void ConvertLocalToWorldTransform(idVec3 &offset, idMat3 &axis)
GLsizei const GLcharARB const GLint * length
const char * GetName(void) const
const idEventDef EV_SetAngles
void UpdateAnimation(void)
void Event_GetTarget(float index)
void GetWorldVelocities(idVec3 &linearVelocity, idVec3 &angularVelocity) const
void UpdateModelTransform(void)
virtual int GetRestStartTime(void) const
void RestorePhysics(idPhysics *phys)
void Event_ClearJoint(jointHandle_t jointnum)
void BecomeActive(int flags)
virtual void PreBind(void)
idPhysics_Static defaultPhysicsObj
bool IsActive(void) const
const int * GetPVSAreas(void)
void ReadColorFromSnapshot(const idBitMsgDelta &msg)
bool GetJointTransformForAnim(jointHandle_t jointHandle, int animNum, int currentTime, idVec3 &offset, idMat3 &axis) const
void Event_GetOrigin(void)
virtual bool CanDamage(const idVec3 &origin, idVec3 &damagePoint) const
void Event_BindToJoint(idEntity *master, const char *jointname, float orientated)
jointHandle_t GetBindJoint(void) const
void Event_SetShaderParms(float parm0, float parm1, float parm2, float parm3)
const idEventDef EV_StopSound
void Event_GetJointAngle(jointHandle_t jointnum)
const char * GetEntityDefName(void) const
virtual idThread * ConstructScriptObject(void)
void WriteGUIToSnapshot(idBitMsgDelta &msg) const
virtual bool UpdateAnimationControllers(void)
struct damageEffect_s * next
void Event_GetAngles(void)
void ReadBindFromSnapshot(const idBitMsgDelta &msg)
virtual void AddDamageEffect(const trace_t &collision, const idVec3 &velocity, const char *damageDefName)
virtual bool GetPhysicsToVisualTransform(idVec3 &origin, idMat3 &axis)
virtual bool ShouldConstructScriptObjectAtSpawn(void) const
idList< signal_t > signal[NUM_SIGNALS]
void SetOrigin(const idVec3 &org)
virtual void SetModel(const char *modelname)
const idEventDef EV_PostSpawn
void Restore(idRestoreGame *savefile)
bool DoDormantTests(void)
virtual bool ServerReceiveEvent(int event, int time, const idBitMsg &msg)
virtual void ProjectOverlay(const idVec3 &origin, const idVec3 &dir, float size, const char *material)
void Event_ClearAllJoints(void)
void UpdateDamageEffects(void)
virtual void PostUnbind(void)
void BecomeInactive(int flags)
void Event_StartFx(const char *fx)
idLinkList< idEntity > activeNode
virtual void ReadFromSnapshot(const idBitMsgDelta &msg)
void Event_GetShaderParm(int parmnum)
void Event_ActivateTargets(idEntity *activator)
void ActivateTargets(idEntity *activator) const
void StopSound(const s_channelType channel, bool broadcast)
void Event_SetLinearVelocity(const idVec3 &velocity)
void Event_RandomTarget(const char *ignore)
virtual void ActivatePhysics(idEntity *ent)
virtual void DormantEnd(void)
void Event_SetModel(const char *modelname)