29 #include "../idlib/precompiled.h"
52 draggedPosition.Zero();
110 #define MAX_DRAG_TRACE_DISTANCE 2048.0f
198 if ( newEnt->
IsType( idAFEntity_Base::Type ) &&
static_cast<idAFEntity_Base *
>(newEnt)->IsActiveAF() ) {
208 }
else if ( !newEnt->
IsType( idWorldspawn::Type ) ) {
210 if ( trace.
c.
id < 0 ) {
244 if ( phys->
IsType( idPhysics_AF::Type ) ||
245 phys->
IsType( idPhysics_RigidBody::Type ) ||
246 phys->
IsType( idPhysics_Monster::Type ) ) {
274 gameRenderWorld->
DrawText(
va(
"%s\n%s\n%s, %s", drag->
GetName(), drag->
GetType()->
classname, dragAnimator->
GetJointName(
joint ),
bodyName.
c_str() ),
cursor->
GetPhysics()->
GetOrigin(), 0.1f,
colorWhite, viewAxis, 1 );
285 if ( renderEntity ) {
338 key.
Strip(
"bindConstraint " );
339 if ( sscanf( key,
"bind%d", &num ) ) {
340 if ( num >= largestNum ) {
341 largestNum = num + 1;
351 if ( bodyName.
Icmp( bindBodyName ) == 0 ) {
360 sprintf( key,
"bindConstraint bind%d", largestNum );
436 end = origin + dir * 4096.0f;
487 for ( i = 0; i <
count; i++ ) {
557 sit.
typeInfo = &idAFEntity_Base::Type;
558 sit.
textKey =
"articulatedFigure";
562 sit.
typeInfo = &idFuncEmitter::Type;
589 viewBounds.ExpandSelf( 512 );
590 viewTextBounds.ExpandSelf( 128 );
603 bool drawArrows =
false;
604 if ( ent->
GetType() == &idAFEntity_Base::Type ) {
605 if ( !static_cast<idAFEntity_Base *>(ent)->IsActiveAF() ) {
608 }
else if ( ent->
GetType() == &idSound::Type ) {
614 color.
Set( 1.0
f, 0.0
f, 1.0
f, 1.0
f );
616 }
else if ( ent->
GetType() == &idFuncEmitter::Type ) {
632 end = start +
idVec3( 1, 0, 0 ) * -20.0f;
635 end = start +
idVec3( 0, 1, 0 ) * +20.0f;
638 end = start +
idVec3( 0, 1, 0 ) * -20.0f;
641 end = start +
idVec3( 0, 0, 1 ) * +20.0f;
644 end = start +
idVec3( 0, 0, 1 ) * -20.0f;
766 static char name[1024];
985 if ( mapFile && name && *name ) {
1002 mapFile->
Write( (path) ? path : mapFile->
GetName(),
".map");
1013 if ( mapFile && name && *name ) {
1028 if ( mapFile && name && *name ) {
1033 const char *key = kv->
GetKey();
1056 if ( k && *k && count < max ) {
1105 for (
int i = 0 ;
i < entCount;
i++ ) {
1109 if ( work.
Icmp( classname ) == 0 ) {
1110 if ( match && *match ) {
1112 if ( count < max && work.
Icmp( match ) == 0 ) {
1115 }
else if ( count < max ) {
1133 if ( mapFile && name && *name ) {
virtual const idVec3 & GetOrigin(int id=0) const =0
idList< selectedTypeInfo_t > selectableEntityClasses
idPlayer * GetLocalPlayer() const
virtual void EntityUpdateChangeableSpawnArgs(idEntity *ent, const idDict *dict)
bool TracePoint(trace_t &results, const idVec3 &start, const idVec3 &end, int contentMask, const idEntity *passEntity)
static int snPrintf(char *dest, int size, const char *fmt,...) id_attribute((format(printf
bool GetJointTransform(jointHandle_t jointHandle, int currenttime, idVec3 &offset, idMat3 &axis)
idMapEntity * GetEntity(int i) const
GLsizei const GLfloat * value
virtual void MapAddEntity(const idDict *dict) const
virtual void EntitySetColor(idEntity *ent, const idVec3 color)
virtual const idSoundShader * FindSound(const char *name, bool makeDefault=true)=0
const idDict * FindEntityDefDict(const char *name, bool makeDefault=true) const
virtual bool HasDefaultSound() const
#define CLIPMODEL_ID_TO_JOINT_HANDLE(id)
static idTypeInfo * GetType(int num)
bool IsActiveAF(void) const
void Delete(const char *key)
virtual idAnimator * GetAnimator(void)
void UnbindSelected(void)
virtual void DebugArrow(const idVec4 &color, const idVec3 &start, const idVec3 &end, int size, const int lifetime=0)=0
idMapEntity * FindEntity(const char *name)
void Printf(const char *fmt,...) const id_attribute((format(printf
struct idEntity::entityFlags_s fl
void Bind(idEntity *master, bool orientated)
type * GetEntity(void) const
virtual void MapRemoveEntity(const char *name) const
float GetFloat(void) const
virtual void EntityTranslate(idEntity *ent, const idVec3 &org)
const idStr & GetKey(void) const
const idEventDef EV_Activate("activate","e")
idEntity * GetBindMaster(void) const
void DeleteSelected(void)
idMat3 Transpose(void) const
void SetAxis(const idMat3 &axis)
bool IsType(const idTypeInfo &c) const
virtual void EntitySetAxis(idEntity *ent, const idMat3 &axis)
idAFBody * GetBody(const char *bodyName) const
virtual const char * GetUniqueEntityName(const char *classname) const
idCVar g_dragShowSelection("g_dragShowSelection","0", CVAR_GAME|CVAR_BOOL,"")
idEntity * FindEntity(const char *name) const
const idKeyValue * MatchPrefix(const char *prefix, const idKeyValue *lastMatch=NULL) const
idVec3 GetEyePosition(void) const
idEntityPtr< idEntity > selected
bool ProcessEvent(const idEventDef *ev)
virtual void EntityStopSound(idEntity *ent)
virtual void DebugBox(const idVec4 &color, const idBox &box, const int lifetime=0)=0
virtual void PlayerGetOrigin(idVec3 &org) const
virtual void TriggerSelected()
void DisplayEntities(void)
virtual void Translate(const idVec3 &translation, int id=-1)=0
GLuint GLuint GLsizei GLenum type
const char * GetClassname(void) const
void Set(const char *key, const char *value)
virtual void SetModel(const char *modelname)
int Icmp(const char *text) const
void SetDragPosition(const idVec3 &pos)
idCVar g_dragDamping("g_dragDamping","0.5", CVAR_GAME|CVAR_FLOAT,"")
virtual const idDict * FindEntityDefDict(const char *name, bool makeDefault=true) const
idEntity * SpawnEntityType(const idTypeInfo &classdef, const idDict *args=NULL, bool bIsClientReadSnapshot=false)
void SetPhysics(idPhysics *physics, int id, const idVec3 &p)
void RemoveSelectedEntity(idEntity *ent)
virtual void MapCopyDictToEntity(const char *name, const idDict *dict) const
virtual void MapSetEntityKeyVal(const char *name, const char *key, const char *val) const
int GetBindBody(void) const
virtual void EntityGetAxis(idEntity *ent, idMat3 &axis) const
virtual void PlayerGetEyePosition(idVec3 &org) const
GLuint GLuint GLsizei count
idEntity * FindTraceEntity(idVec3 start, idVec3 end, const idTypeInfo &c, const idEntity *skip) const
virtual void Evaluate(int time)
idPhysics * GetPhysics(void) const
const char * GetString(const char *key, const char *defaultString="") const
bool SpawnEntityDef(const idDict &args, idEntity **ent=NULL, bool setDefaults=true)
void SetSelected(idEntity *ent)
int GetNumEntities(void) const
virtual renderEntity_t * GetRenderEntity(void)
idPhysics_AF * GetAFPhysics(void)
virtual void MapSave(const char *path=NULL) const
virtual void PlayerGetViewAngles(idAngles &angles) const
virtual void UpdateChangeableSpawnArgs(const idDict *source)
virtual void EntityDelete(idEntity *ent)
bool Write(const char *fileName, const char *ext, bool fromBasePath=true)
virtual void AddSelectedEntity(idEntity *ent)
int GetInteger(void) const
idVec3 GetVector(const char *key, const char *defaultString=NULL) const
virtual void PlayerGetAxis(idMat3 &axis) const
type * Find(type const &obj) const
const idStr & GetValue(void) const
virtual const idMat3 & GetAxis(int id=0) const =0
idMapFile * GetLevelMap(void)
virtual idAnimator * GetAnimator(void)
virtual void DrawText(const char *text, const idVec3 &origin, float scale, const idVec4 &color, const idMat3 &viewAxis, const int align=1, const int lifetime=0, bool depthTest=false)=0
void Update(idPlayer *player)
bool SelectEntity(const idVec3 &origin, const idVec3 &dir, const idEntity *skip)
idLinkList< idEntity > spawnNode
virtual void ShowEditingDialog(void)
void AddSelectedEntity(idEntity *ent)
int LoadMemory(const char *ptr, int length, const char *name, int startLine=1)
idLinkList< idEntity > spawnedEntities
virtual int GetSelectedEntities(idEntity *list[], int max)
void RemoveEntity(idMapEntity *mapEnt)
#define MAX_DRAG_TRACE_DISTANCE
idDeclManager * declManager
idEntity * entities[MAX_GENTITIES]
virtual void EntitySetModel(idEntity *ent, const char *val)
idList< idEntity * > selectedEntities
int BodyForClipModelId(int id) const
bool EntityIsSelectable(idEntity *ent, idVec4 *color=NULL, idStr *text=NULL)
int AddUnique(const type &obj)
virtual void EntitySetOrigin(idEntity *ent, const idVec3 &org)
idEditEntities * editEntities
idMat3 ToMat3(void) const
virtual void SetColor(float red, float green, float blue)
#define CLASS_DECLARATION(nameofsuperclass, nameofclass)
virtual int MapGetEntitiesMatchingClassWithString(const char *classname, const char *match, const char *list[], const int max) const
const char * GetName(void) const
idEntityPtr< idEntity > dragEnt
virtual bool PlayerIsValid() const
const char * c_str(void) const
virtual const idDict * MapGetEntityDict(const char *name) const
const char * GetJointName(jointHandle_t handle) const
virtual void ClearEntitySelection(void)
void BecomeActive(int flags)
idCVar g_editEntityMode("g_editEntityMode","0", CVAR_GAME|CVAR_INTEGER,"0 = off\n""1 = lights\n""2 = sounds\n""3 = articulated figures\n""4 = particle systems\n""5 = monsters\n""6 = entity names\n""7 = entity models", 0, 7, idCmdSystem::ArgCompletion_Integer< 0, 7 >)
const idKeyValue * GetKeyVal(int index) const
virtual void EntityGetOrigin(idEntity *ent, idVec3 &org) const
virtual void SpawnEntityDef(const idDict &args, idEntity **ent)
void ClearSelectedEntities(void)
jointHandle_t GetBindJoint(void) const
virtual const idDict * EntityGetSpawnArgs(idEntity *ent) const
virtual void DebugBounds(const idVec4 &color, const idBounds &bounds, const idVec3 &org=vec3_origin, const int lifetime=0)=0
idRenderWorld * gameRenderWorld
void GetViewPos(idVec3 &origin, idMat3 &axis) const
char * va(const char *fmt,...)
int AddEntity(idMapEntity *mapentity)
void SetOrigin(const idVec3 &org)
virtual void EntityChangeSpawnArgs(idEntity *ent, const idDict *newArgs)
int GetNumKeyVals(void) const
void Set(const float x, const float y, const float z, const float w)
const char * GetName(void) const
void BecomeInactive(int flags)
int ReadToken(idToken *token)
int sprintf(idStr &string, const char *fmt,...)
#define JOINT_HANDLE_TO_CLIPMODEL_ID(id)
virtual idEntity * FindEntity(const char *name) const
virtual void MapEntityTranslate(const char *name, const idVec3 &v) const
bool Remove(const type &obj)
void StopSound(const s_channelType channel, bool broadcast)
virtual declState_t GetState(void) const =0
void SetVector(const char *key, const idVec3 &val)
const idStr & GetName(void) const
virtual int MapGetUniqueMatchingKeyVals(const char *key, const char *list[], const int max) const
virtual void EntityUpdateVisuals(idEntity *ent)