00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef GPLAYER_H
00016 #define GPLAYER_H
00017
00018 #include "Genesis.h"
00019
00020 #include "GenVSI.h"
00021
00022 #define MAX_CLASS_NAME_SIZE 32
00023 #define MAX_PLAYER_ITEMS 32
00024
00025 #define CONTROL_INDEX_NONE 0xffff
00026 #define TRIGGER_INDEX_NONE 0xffff
00027 #define VIEW_INDEX_NONE 0xffff
00028 #define MOTION_INDEX_NONE 0xff
00029
00030 #define DAMMAGE_TYPE_NONE (0<<0)
00031 #define DAMMAGE_TYPE_NORMAL (1<<0)
00032 #define DAMMAGE_TYPE_RADIUS (1<<1)
00033
00034
00035 typedef enum
00036 {
00037 MODE_Authoritive,
00038 MODE_Proxy,
00039 MODE_Dumb
00040 } GPlayer_Mode;
00041
00042
00043 typedef enum
00044 {
00045
00046 PSTATE_Normal = 0,
00047 PSTATE_InAir,
00048 PSTATE_InLava,
00049 PSTATE_InWater,
00050 PSTATE_Running,
00051 PSTATE_Dead,
00052 PSTATE_DeadOnGround,
00053
00054
00055 PSTATE_Closed,
00056 PSTATE_Opened,
00057
00058
00059 PSTATE_LookLeft,
00060 PSTATE_LookRight,
00061 PSTATE_LookUp,
00062 PSTATE_LookDown,
00063
00064 } GPlayer_PState;
00065
00066 #define NULL_BONE_INDEX 255
00067 #define GPLAYER_MAX_XFORM_DATA 5
00068
00069 typedef struct
00070 {
00071 geXForm3d XForm;
00072 uint8 BoneIndex;
00073 } GPlayer_XFormData;
00074
00075 #define GPLAYER_MAX_MOTION_DATA 5
00076
00077 typedef struct
00078 {
00079 float MotionTime;
00080 uint8 MotionIndex;
00081 } GPlayer_MotionData;
00082
00083
00084
00085 typedef struct GPlayer GPlayer;
00086
00087 typedef geBoolean GPlayer_Control(GenVSI *VSI, void *PlayerData, float TimeElapsed);
00088 typedef geBoolean GPlayer_Trigger(GenVSI *VSI, void *PlayerData, GPlayer *Target, void* data);
00089 typedef geBoolean GPlayer_Blocked(GenVSI *VSI, void *PlayerData, GPlayer *Target);
00090
00091
00092
00093 typedef struct GPlayer
00094 {
00095 geBoolean Active;
00096 geBoolean JustSpawned;
00097
00098 GPlayer_Mode Mode;
00099 GPlayer_Mode RemoteMode;
00100
00101
00102 char ClassName[MAX_CLASS_NAME_SIZE];
00103
00104 float Time;
00105 float UpdateTime;
00106
00107
00108 GPlayer_Control *Control;
00109 GPlayer_Trigger *Trigger;
00110 GPlayer_Trigger *StandOn;
00111 GPlayer_Blocked *Blocked;
00112
00113 struct GPlayer *Owner;
00114
00115 float PingTime;
00116
00117 int32 Score;
00118 int32 Health;
00119
00120
00121 uint16 OldViewIndex2;
00122 uint16 OldViewFlags2;
00123 float OldScale2;
00124
00125
00126
00127
00128 float OldSpawnTime;
00129 uint16 OldViewFlags;
00130 uint16 OldViewIndex;
00131 uint8 OldMotionIndex;
00132 uint16 OldFxFlags;
00133 uint16 OldDammageFlags;
00134 geVec3d OldPos;
00135 geVec3d OldAngles;
00136 float OldFrameTime;
00137 float OldScale;
00138 geVec3d OldVelocity;
00139 GPlayer_PState OldState;
00140 uint16 OldControlIndex;
00141 uint16 OldTriggerIndex;
00142
00143 geVec3d OldMins;
00144 geVec3d OldMaxs;
00145
00146 geVec3d Pos;
00147 geVec3d Angles;
00148
00149
00150 float SpawnTime;
00151 uint16 ViewFlags;
00152 uint16 ViewIndex;
00153 uint8 MotionIndex;
00154 uint16 FxFlags;
00155 uint16 DammageFlags;
00156
00157 geXForm3d XForm;
00158
00159 float FrameTime;
00160 float Scale;
00161 geVec3d Velocity;
00162 GPlayer_PState State;
00163 uint16 ControlIndex;
00164 uint16 TriggerIndex;
00165
00166 geVec3d Mins;
00167 geVec3d Maxs;
00168
00169
00170
00171 geVec3d LastGoodPos;
00172
00173 float NextThinkTime;
00174 float Roll;
00175
00176 uint32 Mask;
00177
00178
00179 uint8 InventoryHas[MAX_PLAYER_ITEMS];
00180 int32 Inventory[MAX_PLAYER_ITEMS];
00181
00182
00183 int16 CurrentWeapon;
00184 float NextWeaponTime;
00185
00186
00187
00188 geVec3d GunOffset;
00189
00190
00191 geVec3d VPos;
00192
00193 struct GPlayer *Weapon;
00194
00195 GenVSI_CHandle ClientHandle;
00196
00197 void *ClassData;
00198 void *userData;
00199
00200
00201
00202
00203 geMesh *Mesh;
00204 geActor *Actor;
00205 geActor_Def *ActorDef;
00206 geLight *Light;
00207 geWorld_Model *Model;
00208 gePoly *Poly;
00209
00210 GenVSI_DestroyFunc *DFunc;
00211
00212
00213 int32 NumXFormData;
00214 GPlayer_XFormData XFormData[GPLAYER_MAX_XFORM_DATA];
00215
00216 int32 NumMotionData;
00217 GPlayer_MotionData MotionData[GPLAYER_MAX_MOTION_DATA];
00218
00219 } GPlayer;
00220
00221 #endif