doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GameEdit.cpp
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
21 
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
23 
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
25 
26 ===========================================================================
27 */
28 
29 #include "../idlib/precompiled.h"
30 #pragma hdrstop
31 
32 #include "Game_local.h"
33 
34 
35 /*
36 ===============================================================================
37 
38  Ingame cursor.
39 
40 ===============================================================================
41 */
42 
45 
46 /*
47 ===============
48 idCursor3D::idCursor3D
49 ===============
50 */
52  draggedPosition.Zero();
53 }
54 
55 /*
56 ===============
57 idCursor3D::~idCursor3D
58 ===============
59 */
61 }
62 
63 /*
64 ===============
65 idCursor3D::Spawn
66 ===============
67 */
68 void idCursor3D::Spawn( void ) {
69 }
70 
71 /*
72 ===============
73 idCursor3D::Present
74 ===============
75 */
76 void idCursor3D::Present( void ) {
77  // don't present to the renderer if the entity hasn't changed
78  if ( !( thinkFlags & TH_UPDATEVISUALS ) ) {
79  return;
80  }
81  BecomeInactive( TH_UPDATEVISUALS );
82 
83  const idVec3 &origin = GetPhysics()->GetOrigin();
84  const idMat3 &axis = GetPhysics()->GetAxis();
85  gameRenderWorld->DebugArrow( colorYellow, origin + axis[1] * -5.0f + axis[2] * 5.0f, origin, 2 );
87 }
88 
89 /*
90 ===============
91 idCursor3D::Think
92 ===============
93 */
94 void idCursor3D::Think( void ) {
95  if ( thinkFlags & TH_THINK ) {
97  }
98  Present();
99 }
100 
101 
102 /*
103 ===============================================================================
104 
105  Allows entities to be dragged through the world with physics.
106 
107 ===============================================================================
108 */
109 
110 #define MAX_DRAG_TRACE_DISTANCE 2048.0f
111 
112 /*
113 ==============
114 idDragEntity::idDragEntity
115 ==============
116 */
118  cursor = NULL;
119  Clear();
120 }
121 
122 /*
123 ==============
124 idDragEntity::~idDragEntity
125 ==============
126 */
128  StopDrag();
129  selected = NULL;
130  delete cursor;
131  cursor = NULL;
132 }
133 
134 
135 /*
136 ==============
137 idDragEntity::Clear
138 ==============
139 */
141  dragEnt = NULL;
143  id = 0;
146  bodyName.Clear();
147  selected = NULL;
148 }
149 
150 /*
151 ==============
152 idDragEntity::StopDrag
153 ==============
154 */
156  dragEnt = NULL;
157  if ( cursor ) {
159  }
160 }
161 
162 /*
163 ==============
164 idDragEntity::Update
165 ==============
166 */
168  idVec3 viewPoint, origin;
169  idMat3 viewAxis, axis;
170  trace_t trace;
171  idEntity *newEnt;
172  idAngles angles;
173  jointHandle_t newJoint;
174  idStr newBodyName;
175 
176  player->GetViewPos( viewPoint, viewAxis );
177 
178  // if no entity selected for dragging
179  if ( !dragEnt.GetEntity() ) {
180 
181  if ( player->usercmd.buttons & BUTTON_ATTACK ) {
182 
183  gameLocal.clip.TracePoint( trace, viewPoint, viewPoint + viewAxis[0] * MAX_DRAG_TRACE_DISTANCE, (CONTENTS_SOLID|CONTENTS_RENDERMODEL|CONTENTS_BODY), player );
184  if ( trace.fraction < 1.0f ) {
185 
186  newEnt = gameLocal.entities[ trace.c.entityNum ];
187  if ( newEnt ) {
188 
189  if ( newEnt->GetBindMaster() ) {
190  if ( newEnt->GetBindJoint() ) {
191  trace.c.id = JOINT_HANDLE_TO_CLIPMODEL_ID( newEnt->GetBindJoint() );
192  } else {
193  trace.c.id = newEnt->GetBindBody();
194  }
195  newEnt = newEnt->GetBindMaster();
196  }
197 
198  if ( newEnt->IsType( idAFEntity_Base::Type ) && static_cast<idAFEntity_Base *>(newEnt)->IsActiveAF() ) {
199  idAFEntity_Base *af = static_cast<idAFEntity_Base *>(newEnt);
200 
201  // joint being dragged
202  newJoint = CLIPMODEL_ID_TO_JOINT_HANDLE( trace.c.id );
203  // get the body id from the trace model id which might be a joint handle
204  trace.c.id = af->BodyForClipModelId( trace.c.id );
205  // get the name of the body being dragged
206  newBodyName = af->GetAFPhysics()->GetBody( trace.c.id )->GetName();
207 
208  } else if ( !newEnt->IsType( idWorldspawn::Type ) ) {
209 
210  if ( trace.c.id < 0 ) {
211  newJoint = CLIPMODEL_ID_TO_JOINT_HANDLE( trace.c.id );
212  } else {
213  newJoint = INVALID_JOINT;
214  }
215  newBodyName = "";
216 
217  } else {
218 
219  newJoint = INVALID_JOINT;
220  newEnt = NULL;
221  }
222  }
223  if ( newEnt ) {
224  dragEnt = newEnt;
225  selected = newEnt;
226  joint = newJoint;
227  id = trace.c.id;
228  bodyName = newBodyName;
229 
230  if ( !cursor ) {
231  cursor = ( idCursor3D * )gameLocal.SpawnEntityType( idCursor3D::Type );
232  }
233 
234  idPhysics *phys = dragEnt.GetEntity()->GetPhysics();
235  localPlayerPoint = ( trace.c.point - viewPoint ) * viewAxis.Transpose();
236  origin = phys->GetOrigin( id );
237  axis = phys->GetAxis( id );
238  localEntityPoint = ( trace.c.point - origin ) * axis.Transpose();
239 
241  cursor->drag.SetPhysics( phys, id, localEntityPoint );
242  cursor->Show();
243 
244  if ( phys->IsType( idPhysics_AF::Type ) ||
245  phys->IsType( idPhysics_RigidBody::Type ) ||
246  phys->IsType( idPhysics_Monster::Type ) ) {
248  }
249  }
250  }
251  }
252  }
253 
254  // if there is an entity selected for dragging
255  idEntity *drag = dragEnt.GetEntity();
256  if ( drag ) {
257 
258  if ( !( player->usercmd.buttons & BUTTON_ATTACK ) ) {
259  StopDrag();
260  return;
261  }
262 
263  cursor->SetOrigin( viewPoint + localPlayerPoint * viewAxis );
264  cursor->SetAxis( viewAxis );
265 
267 
268  renderEntity_t *renderEntity = drag->GetRenderEntity();
269  idAnimator *dragAnimator = drag->GetAnimator();
270 
271  if ( joint != INVALID_JOINT && renderEntity && dragAnimator ) {
272  dragAnimator->GetJointTransform( joint, gameLocal.time, cursor->draggedPosition, axis );
273  cursor->draggedPosition = renderEntity->origin + cursor->draggedPosition * renderEntity->axis;
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 );
275  } else {
277  gameRenderWorld->DrawText( va( "%s\n%s\n%s", drag->GetName(), drag->GetType()->classname, bodyName.c_str() ), cursor->GetPhysics()->GetOrigin(), 0.1f, colorWhite, viewAxis, 1 );
278  }
279  }
280 
281  // if there is a selected entity
283  // draw the bbox of the selected entity
284  renderEntity_t *renderEntity = selected.GetEntity()->GetRenderEntity();
285  if ( renderEntity ) {
286  gameRenderWorld->DebugBox( colorYellow, idBox( renderEntity->bounds, renderEntity->origin, renderEntity->axis ) );
287  }
288  }
289 }
290 
291 /*
292 ==============
293 idDragEntity::SetSelected
294 ==============
295 */
297  selected = ent;
298  StopDrag();
299 }
300 
301 /*
302 ==============
303 idDragEntity::DeleteSelected
304 ==============
305 */
307  delete selected.GetEntity();
308  selected = NULL;
309  StopDrag();
310 }
311 
312 /*
313 ==============
314 idDragEntity::BindSelected
315 ==============
316 */
318  int num, largestNum;
319  idLexer lexer;
321  idStr key, value, bindBodyName;
322  const idKeyValue *kv;
323  idAFEntity_Base *af;
324 
325  af = static_cast<idAFEntity_Base *>(dragEnt.GetEntity());
326 
327  if ( !af || !af->IsType( idAFEntity_Base::Type ) || !af->IsActiveAF() ) {
328  return;
329  }
330 
331  bindBodyName = af->GetAFPhysics()->GetBody( id )->GetName();
332  largestNum = 1;
333 
334  // parse all the bind constraints
335  kv = af->spawnArgs.MatchPrefix( "bindConstraint ", NULL );
336  while ( kv ) {
337  key = kv->GetKey();
338  key.Strip( "bindConstraint " );
339  if ( sscanf( key, "bind%d", &num ) ) {
340  if ( num >= largestNum ) {
341  largestNum = num + 1;
342  }
343  }
344 
345  lexer.LoadMemory( kv->GetValue(), kv->GetValue().Length(), kv->GetKey() );
346  lexer.ReadToken( &type );
347  lexer.ReadToken( &bodyName );
348  lexer.FreeSource();
349 
350  // if there already exists a bind constraint for this body
351  if ( bodyName.Icmp( bindBodyName ) == 0 ) {
352  // delete the bind constraint
353  af->spawnArgs.Delete( kv->GetKey() );
354  kv = NULL;
355  }
356 
357  kv = af->spawnArgs.MatchPrefix( "bindConstraint ", kv );
358  }
359 
360  sprintf( key, "bindConstraint bind%d", largestNum );
361  sprintf( value, "ballAndSocket %s %s", bindBodyName.c_str(), af->GetAnimator()->GetJointName( joint ) );
362 
363  af->spawnArgs.Set( key, value );
364  af->spawnArgs.Set( "bind", "worldspawn" );
365  af->Bind( gameLocal.world, true );
366 }
367 
368 /*
369 ==============
370 idDragEntity::UnbindSelected
371 ==============
372 */
374  const idKeyValue *kv;
375  idAFEntity_Base *af;
376 
377  af = static_cast<idAFEntity_Base *>(selected.GetEntity());
378 
379  if ( !af || !af->IsType( idAFEntity_Base::Type ) || !af->IsActiveAF() ) {
380  return;
381  }
382 
383  // unbind the selected entity
384  af->Unbind();
385 
386  // delete all the bind constraints
387  kv = selected.GetEntity()->spawnArgs.MatchPrefix( "bindConstraint ", NULL );
388  while ( kv ) {
390  kv = selected.GetEntity()->spawnArgs.MatchPrefix( "bindConstraint ", NULL );
391  }
392 
393  // delete any bind information
394  af->spawnArgs.Delete( "bind" );
395  af->spawnArgs.Delete( "bindToJoint" );
396  af->spawnArgs.Delete( "bindToBody" );
397 }
398 
399 
400 /*
401 ===============================================================================
402 
403  Handles ingame entity editing.
404 
405 ===============================================================================
406 */
407 
408 /*
409 ==============
410 idEditEntities::idEditEntities
411 ==============
412 */
414  selectableEntityClasses.Clear();
415  nextSelectTime = 0;
416 }
417 
418 /*
419 =============
420 idEditEntities::SelectEntity
421 =============
422 */
423 bool idEditEntities::SelectEntity( const idVec3 &origin, const idVec3 &dir, const idEntity *skip ) {
424  idVec3 end;
425  idEntity *ent;
426 
427  if ( !g_editEntityMode.GetInteger() || selectableEntityClasses.Num() == 0 ) {
428  return false;
429  }
430 
431  if ( gameLocal.time < nextSelectTime ) {
432  return true;
433  }
434  nextSelectTime = gameLocal.time + 300;
435 
436  end = origin + dir * 4096.0f;
437 
438  ent = NULL;
439  for ( int i = 0; i < selectableEntityClasses.Num(); i++ ) {
440  ent = gameLocal.FindTraceEntity( origin, end, *selectableEntityClasses[i].typeInfo, skip );
441  if ( ent ) {
442  break;
443  }
444  }
445  if ( ent ) {
447  if ( EntityIsSelectable( ent ) ) {
448  AddSelectedEntity( ent );
449  gameLocal.Printf( "entity #%d: %s '%s'\n", ent->entityNumber, ent->GetClassname(), ent->name.c_str() );
450  ent->ShowEditingDialog();
451  return true;
452  }
453  }
454  return false;
455 }
456 
457 /*
458 =============
459 idEditEntities::AddSelectedEntity
460 =============
461 */
463  ent->fl.selected = true;
465 }
466 
467 /*
468 ==============
469 idEditEntities::RemoveSelectedEntity
470 ==============
471 */
473  if ( selectedEntities.Find( ent ) ) {
474  selectedEntities.Remove( ent );
475  }
476 }
477 
478 /*
479 =============
480 idEditEntities::ClearSelectedEntities
481 =============
482 */
484  int i, count;
485 
486  count = selectedEntities.Num();
487  for ( i = 0; i < count; i++ ) {
488  selectedEntities[i]->fl.selected = false;
489  }
491 }
492 
493 
494 /*
495 =============
496 idEditEntities::EntityIsSelectable
497 =============
498 */
500  for ( int i = 0; i < selectableEntityClasses.Num(); i++ ) {
501  if ( ent->GetType() == selectableEntityClasses[i].typeInfo ) {
502  if ( text ) {
503  *text = selectableEntityClasses[i].textKey;
504  }
505  if ( color ) {
506  if ( ent->fl.selected ) {
507  *color = colorRed;
508  } else {
509  switch( i ) {
510  case 1 :
511  *color = colorYellow;
512  break;
513  case 2 :
514  *color = colorBlue;
515  break;
516  default:
517  *color = colorGreen;
518  }
519  }
520  }
521  return true;
522  }
523  }
524  return false;
525 }
526 
527 /*
528 =============
529 idEditEntities::DisplayEntities
530 =============
531 */
533  idEntity *ent;
534 
535  if ( !gameLocal.GetLocalPlayer() ) {
536  return;
537  }
538 
539  selectableEntityClasses.Clear();
540  selectedTypeInfo_t sit;
541 
542  switch( g_editEntityMode.GetInteger() ) {
543  case 1:
544  sit.typeInfo = &idLight::Type;
545  sit.textKey = "texture";
546  selectableEntityClasses.Append( sit );
547  break;
548  case 2:
549  sit.typeInfo = &idSound::Type;
550  sit.textKey = "s_shader";
551  selectableEntityClasses.Append( sit );
552  sit.typeInfo = &idLight::Type;
553  sit.textKey = "texture";
554  selectableEntityClasses.Append( sit );
555  break;
556  case 3:
557  sit.typeInfo = &idAFEntity_Base::Type;
558  sit.textKey = "articulatedFigure";
559  selectableEntityClasses.Append( sit );
560  break;
561  case 4:
562  sit.typeInfo = &idFuncEmitter::Type;
563  sit.textKey = "model";
564  selectableEntityClasses.Append( sit );
565  break;
566  case 5:
567  sit.typeInfo = &idAI::Type;
568  sit.textKey = "name";
569  selectableEntityClasses.Append( sit );
570  break;
571  case 6:
572  sit.typeInfo = &idEntity::Type;
573  sit.textKey = "name";
574  selectableEntityClasses.Append( sit );
575  break;
576  case 7:
577  sit.typeInfo = &idEntity::Type;
578  sit.textKey = "model";
579  selectableEntityClasses.Append( sit );
580  break;
581  default:
582  return;
583  }
584 
585  idBounds viewBounds( gameLocal.GetLocalPlayer()->GetPhysics()->GetOrigin() );
586  idBounds viewTextBounds( gameLocal.GetLocalPlayer()->GetPhysics()->GetOrigin() );
588 
589  viewBounds.ExpandSelf( 512 );
590  viewTextBounds.ExpandSelf( 128 );
591 
592  idStr textKey;
593 
594  for( ent = gameLocal.spawnedEntities.Next(); ent != NULL; ent = ent->spawnNode.Next() ) {
595 
596  idVec4 color;
597 
598  textKey = "";
599  if ( !EntityIsSelectable( ent, &color, &textKey ) ) {
600  continue;
601  }
602 
603  bool drawArrows = false;
604  if ( ent->GetType() == &idAFEntity_Base::Type ) {
605  if ( !static_cast<idAFEntity_Base *>(ent)->IsActiveAF() ) {
606  continue;
607  }
608  } else if ( ent->GetType() == &idSound::Type ) {
609  if ( ent->fl.selected ) {
610  drawArrows = true;
611  }
612  const idSoundShader * ss = declManager->FindSound( ent->spawnArgs.GetString( textKey ) );
613  if ( ss->HasDefaultSound() || ss->base->GetState() == DS_DEFAULTED ) {
614  color.Set( 1.0f, 0.0f, 1.0f, 1.0f );
615  }
616  } else if ( ent->GetType() == &idFuncEmitter::Type ) {
617  if ( ent->fl.selected ) {
618  drawArrows = true;
619  }
620  }
621 
622  if ( !viewBounds.ContainsPoint( ent->GetPhysics()->GetOrigin() ) ) {
623  continue;
624  }
625 
626  gameRenderWorld->DebugBounds( color, idBounds( ent->GetPhysics()->GetOrigin() ).Expand( 8 ) );
627  if ( drawArrows ) {
628  idVec3 start = ent->GetPhysics()->GetOrigin();
629  idVec3 end = start + idVec3( 1, 0, 0 ) * 20.0f;
630  gameRenderWorld->DebugArrow( colorWhite, start, end, 2 );
631  gameRenderWorld->DrawText( "x+", end + idVec3( 4, 0, 0 ), 0.15f, colorWhite, axis );
632  end = start + idVec3( 1, 0, 0 ) * -20.0f;
633  gameRenderWorld->DebugArrow( colorWhite, start, end, 2 );
634  gameRenderWorld->DrawText( "x-", end + idVec3( -4, 0, 0 ), 0.15f, colorWhite, axis );
635  end = start + idVec3( 0, 1, 0 ) * +20.0f;
636  gameRenderWorld->DebugArrow( colorGreen, start, end, 2 );
637  gameRenderWorld->DrawText( "y+", end + idVec3( 0, 4, 0 ), 0.15f, colorWhite, axis );
638  end = start + idVec3( 0, 1, 0 ) * -20.0f;
639  gameRenderWorld->DebugArrow( colorGreen, start, end, 2 );
640  gameRenderWorld->DrawText( "y-", end + idVec3( 0, -4, 0 ), 0.15f, colorWhite, axis );
641  end = start + idVec3( 0, 0, 1 ) * +20.0f;
642  gameRenderWorld->DebugArrow( colorBlue, start, end, 2 );
643  gameRenderWorld->DrawText( "z+", end + idVec3( 0, 0, 4 ), 0.15f, colorWhite, axis );
644  end = start + idVec3( 0, 0, 1 ) * -20.0f;
645  gameRenderWorld->DebugArrow( colorBlue, start, end, 2 );
646  gameRenderWorld->DrawText( "z-", end + idVec3( 0, 0, -4 ), 0.15f, colorWhite, axis );
647  }
648 
649  if ( textKey.Length() ) {
650  const char *text = ent->spawnArgs.GetString( textKey );
651  if ( viewTextBounds.ContainsPoint( ent->GetPhysics()->GetOrigin() ) ) {
652  gameRenderWorld->DrawText( text, ent->GetPhysics()->GetOrigin() + idVec3(0, 0, 12), 0.25, colorWhite, axis, 1 );
653  }
654  }
655  }
656 }
657 
658 
659 /*
660 ===============================================================================
661 
662  idGameEdit
663 
664 ===============================================================================
665 */
666 
669 
670 
671 /*
672 =============
673 idGameEdit::GetSelectedEntities
674 =============
675 */
677  int num = 0;
678  idEntity *ent;
679 
680  for( ent = gameLocal.spawnedEntities.Next(); ent != NULL; ent = ent->spawnNode.Next() ) {
681  if ( ent->fl.selected ) {
682  list[num++] = ent;
683  if ( num >= max ) {
684  break;
685  }
686  }
687  }
688  return num;
689 }
690 
691 /*
692 =============
693 idGameEdit::TriggerSelected
694 =============
695 */
697  idEntity *ent;
698  for( ent = gameLocal.spawnedEntities.Next(); ent != NULL; ent = ent->spawnNode.Next() ) {
699  if ( ent->fl.selected ) {
701  }
702  }
703 }
704 
705 /*
706 ================
707 idGameEdit::ClearEntitySelection
708 ================
709 */
711  idEntity *ent;
712 
713  for( ent = gameLocal.spawnedEntities.Next(); ent != NULL; ent = ent->spawnNode.Next() ) {
714  ent->fl.selected = false;
715  }
717 }
718 
719 /*
720 ================
721 idGameEdit::AddSelectedEntity
722 ================
723 */
725  if ( ent ) {
727  }
728 }
729 
730 /*
731 ================
732 idGameEdit::FindEntityDefDict
733 ================
734 */
735 const idDict *idGameEdit::FindEntityDefDict( const char *name, bool makeDefault ) const {
736  return gameLocal.FindEntityDefDict( name, makeDefault );
737 }
738 
739 /*
740 ================
741 idGameEdit::SpawnEntityDef
742 ================
743 */
744 void idGameEdit::SpawnEntityDef( const idDict &args, idEntity **ent ) {
745  gameLocal.SpawnEntityDef( args, ent );
746 }
747 
748 /*
749 ================
750 idGameEdit::FindEntity
751 ================
752 */
753 idEntity *idGameEdit::FindEntity( const char *name ) const {
754  return gameLocal.FindEntity( name );
755 }
756 
757 /*
758 =============
759 idGameEdit::GetUniqueEntityName
760 
761 generates a unique name for a given classname
762 =============
763 */
764 const char *idGameEdit::GetUniqueEntityName( const char *classname ) const {
765  int id;
766  static char name[1024];
767 
768  // can only have MAX_GENTITIES, so if we have a spot available, we're guaranteed to find one
769  for( id = 0; id < MAX_GENTITIES; id++ ) {
770  idStr::snPrintf( name, sizeof( name ), "%s_%d", classname, id );
771  if ( !gameLocal.FindEntity( name ) ) {
772  return name;
773  }
774  }
775 
776  // id == MAX_GENTITIES + 1, which can't be in use if we get here
777  idStr::snPrintf( name, sizeof( name ), "%s_%d", classname, id );
778  return name;
779 }
780 
781 /*
782 ================
783 idGameEdit::EntityGetOrigin
784 ================
785 */
786 void idGameEdit::EntityGetOrigin( idEntity *ent, idVec3 &org ) const {
787  if ( ent ) {
788  org = ent->GetPhysics()->GetOrigin();
789  }
790 }
791 
792 /*
793 ================
794 idGameEdit::EntityGetAxis
795 ================
796 */
797 void idGameEdit::EntityGetAxis( idEntity *ent, idMat3 &axis ) const {
798  if ( ent ) {
799  axis = ent->GetPhysics()->GetAxis();
800  }
801 }
802 
803 /*
804 ================
805 idGameEdit::EntitySetOrigin
806 ================
807 */
808 void idGameEdit::EntitySetOrigin( idEntity *ent, const idVec3 &org ) {
809  if ( ent ) {
810  ent->SetOrigin( org );
811  }
812 }
813 
814 /*
815 ================
816 idGameEdit::EntitySetAxis
817 ================
818 */
819 void idGameEdit::EntitySetAxis( idEntity *ent, const idMat3 &axis ) {
820  if ( ent ) {
821  ent->SetAxis( axis );
822  }
823 }
824 
825 /*
826 ================
827 idGameEdit::EntitySetColor
828 ================
829 */
831  if ( ent ) {
832  ent->SetColor( color );
833  }
834 }
835 
836 /*
837 ================
838 idGameEdit::EntityTranslate
839 ================
840 */
841 void idGameEdit::EntityTranslate( idEntity *ent, const idVec3 &org ) {
842  if ( ent ) {
843  ent->GetPhysics()->Translate( org );
844  }
845 }
846 
847 /*
848 ================
849 idGameEdit::EntityGetSpawnArgs
850 ================
851 */
853  if ( ent ) {
854  return &ent->spawnArgs;
855  }
856  return NULL;
857 }
858 
859 /*
860 ================
861 idGameEdit::EntityUpdateChangeableSpawnArgs
862 ================
863 */
865  if ( ent ) {
866  ent->UpdateChangeableSpawnArgs( dict );
867  }
868 }
869 
870 /*
871 ================
872 idGameEdit::EntityChangeSpawnArgs
873 ================
874 */
875 void idGameEdit::EntityChangeSpawnArgs( idEntity *ent, const idDict *newArgs ) {
876  if ( ent ) {
877  for ( int i = 0 ; i < newArgs->GetNumKeyVals () ; i ++ ) {
878  const idKeyValue *kv = newArgs->GetKeyVal( i );
879 
880  if ( kv->GetValue().Length() > 0 ) {
881  ent->spawnArgs.Set ( kv->GetKey() ,kv->GetValue() );
882  } else {
883  ent->spawnArgs.Delete ( kv->GetKey() );
884  }
885  }
886  }
887 }
888 
889 /*
890 ================
891 idGameEdit::EntityUpdateVisuals
892 ================
893 */
895  if ( ent ) {
896  ent->UpdateVisuals();
897  }
898 }
899 
900 /*
901 ================
902 idGameEdit::EntitySetModel
903 ================
904 */
905 void idGameEdit::EntitySetModel( idEntity *ent, const char *val ) {
906  if ( ent ) {
907  ent->spawnArgs.Set( "model", val );
908  ent->SetModel( val );
909  }
910 }
911 
912 /*
913 ================
914 idGameEdit::EntityStopSound
915 ================
916 */
918  if ( ent ) {
919  ent->StopSound( SND_CHANNEL_ANY, false );
920  }
921 }
922 
923 /*
924 ================
925 idGameEdit::EntityDelete
926 ================
927 */
929  delete ent;
930 }
931 
932 /*
933 ================
934 idGameEdit::PlayerIsValid
935 ================
936 */
938  return ( gameLocal.GetLocalPlayer() != NULL );
939 }
940 
941 /*
942 ================
943 idGameEdit::PlayerGetOrigin
944 ================
945 */
948 }
949 
950 /*
951 ================
952 idGameEdit::PlayerGetAxis
953 ================
954 */
955 void idGameEdit::PlayerGetAxis( idMat3 &axis ) const {
957 }
958 
959 /*
960 ================
961 idGameEdit::PlayerGetViewAngles
962 ================
963 */
965  angles = gameLocal.GetLocalPlayer()->viewAngles;
966 }
967 
968 /*
969 ================
970 idGameEdit::PlayerGetEyePosition
971 ================
972 */
975 }
976 
977 
978 /*
979 ================
980 idGameEdit::MapGetEntityDict
981 ================
982 */
983 const idDict *idGameEdit::MapGetEntityDict( const char *name ) const {
984  idMapFile *mapFile = gameLocal.GetLevelMap();
985  if ( mapFile && name && *name ) {
986  idMapEntity *mapent = mapFile->FindEntity( name );
987  if ( mapent ) {
988  return &mapent->epairs;
989  }
990  }
991  return NULL;
992 }
993 
994 /*
995 ================
996 idGameEdit::MapSave
997 ================
998 */
999 void idGameEdit::MapSave( const char *path ) const {
1000  idMapFile *mapFile = gameLocal.GetLevelMap();
1001  if (mapFile) {
1002  mapFile->Write( (path) ? path : mapFile->GetName(), ".map");
1003  }
1004 }
1005 
1006 /*
1007 ================
1008 idGameEdit::MapSetEntityKeyVal
1009 ================
1010 */
1011 void idGameEdit::MapSetEntityKeyVal( const char *name, const char *key, const char *val ) const {
1012  idMapFile *mapFile = gameLocal.GetLevelMap();
1013  if ( mapFile && name && *name ) {
1014  idMapEntity *mapent = mapFile->FindEntity( name );
1015  if ( mapent ) {
1016  mapent->epairs.Set( key, val );
1017  }
1018  }
1019 }
1020 
1021 /*
1022 ================
1023 idGameEdit::MapCopyDictToEntity
1024 ================
1025 */
1026 void idGameEdit::MapCopyDictToEntity( const char *name, const idDict *dict ) const {
1027  idMapFile *mapFile = gameLocal.GetLevelMap();
1028  if ( mapFile && name && *name ) {
1029  idMapEntity *mapent = mapFile->FindEntity( name );
1030  if ( mapent ) {
1031  for ( int i = 0; i < dict->GetNumKeyVals(); i++ ) {
1032  const idKeyValue *kv = dict->GetKeyVal( i );
1033  const char *key = kv->GetKey();
1034  const char *val = kv->GetValue();
1035  mapent->epairs.Set( key, val );
1036  }
1037  }
1038  }
1039 }
1040 
1041 
1042 
1043 /*
1044 ================
1045 idGameEdit::MapGetUniqueMatchingKeyVals
1046 ================
1047 */
1048 int idGameEdit::MapGetUniqueMatchingKeyVals( const char *key, const char *list[], int max ) const {
1049  idMapFile *mapFile = gameLocal.GetLevelMap();
1050  int count = 0;
1051  if ( mapFile ) {
1052  for ( int i = 0; i < mapFile->GetNumEntities(); i++ ) {
1053  idMapEntity *ent = mapFile->GetEntity( i );
1054  if ( ent ) {
1055  const char *k = ent->epairs.GetString( key );
1056  if ( k && *k && count < max ) {
1057  list[count++] = k;
1058  }
1059  }
1060  }
1061  }
1062  return count;
1063 }
1064 
1065 /*
1066 ================
1067 idGameEdit::MapAddEntity
1068 ================
1069 */
1070 void idGameEdit::MapAddEntity( const idDict *dict ) const {
1071  idMapFile *mapFile = gameLocal.GetLevelMap();
1072  if ( mapFile ) {
1073  idMapEntity *ent = new idMapEntity();
1074  ent->epairs = *dict;
1075  mapFile->AddEntity( ent );
1076  }
1077 }
1078 
1079 /*
1080 ================
1081 idGameEdit::MapRemoveEntity
1082 ================
1083 */
1084 void idGameEdit::MapRemoveEntity( const char *name ) const {
1085  idMapFile *mapFile = gameLocal.GetLevelMap();
1086  if ( mapFile ) {
1087  idMapEntity *ent = mapFile->FindEntity( name );
1088  if ( ent ) {
1089  mapFile->RemoveEntity( ent );
1090  }
1091  }
1092 }
1093 
1094 
1095 /*
1096 ================
1097 idGameEdit::MapGetEntitiesMatchignClassWithString
1098 ================
1099 */
1100 int idGameEdit::MapGetEntitiesMatchingClassWithString( const char *classname, const char *match, const char *list[], const int max ) const {
1101  idMapFile *mapFile = gameLocal.GetLevelMap();
1102  int count = 0;
1103  if ( mapFile ) {
1104  int entCount = mapFile->GetNumEntities();
1105  for ( int i = 0 ; i < entCount; i++ ) {
1106  idMapEntity *ent = mapFile->GetEntity(i);
1107  if (ent) {
1108  idStr work = ent->epairs.GetString("classname");
1109  if ( work.Icmp( classname ) == 0 ) {
1110  if ( match && *match ) {
1111  work = ent->epairs.GetString( "soundgroup" );
1112  if ( count < max && work.Icmp( match ) == 0 ) {
1113  list[count++] = ent->epairs.GetString( "name" );
1114  }
1115  } else if ( count < max ) {
1116  list[count++] = ent->epairs.GetString( "name" );
1117  }
1118  }
1119  }
1120  }
1121  }
1122  return count;
1123 }
1124 
1125 
1126 /*
1127 ================
1128 idGameEdit::MapEntityTranslate
1129 ================
1130 */
1131 void idGameEdit::MapEntityTranslate( const char *name, const idVec3 &v ) const {
1132  idMapFile *mapFile = gameLocal.GetLevelMap();
1133  if ( mapFile && name && *name ) {
1134  idMapEntity *mapent = mapFile->FindEntity( name );
1135  if ( mapent ) {
1136  idVec3 origin;
1137  mapent->epairs.GetVector( "origin", "", origin );
1138  origin += v;
1139  mapent->epairs.SetVector( "origin", origin );
1140  }
1141  }
1142 }
virtual const idVec3 & GetOrigin(int id=0) const =0
idList< selectedTypeInfo_t > selectableEntityClasses
Definition: GameEdit.h:115
jointHandle_t
Definition: Model.h:156
idTypeInfo * typeInfo
Definition: GameEdit.h:100
idPlayer * GetLocalPlayer() const
virtual void EntityUpdateChangeableSpawnArgs(idEntity *ent, const idDict *dict)
Definition: GameEdit.cpp:864
byte color[4]
Definition: MegaTexture.cpp:54
bool TracePoint(trace_t &results, const idVec3 &start, const idVec3 &end, int contentMask, const idEntity *passEntity)
Definition: Clip.h:333
static int snPrintf(char *dest, int size, const char *fmt,...) id_attribute((format(printf
Definition: Str.cpp:1465
bool GetJointTransform(jointHandle_t jointHandle, int currenttime, idVec3 &offset, idMat3 &axis)
idMapEntity * GetEntity(int i) const
Definition: MapFile.h:198
GLsizei const GLfloat * value
Definition: glext.h:3614
void Clear()
Definition: GameEdit.cpp:140
idVec4 colorGreen
Definition: Lib.cpp:118
virtual void MapAddEntity(const idDict *dict) const
Definition: GameEdit.cpp:1070
virtual void EntitySetColor(idEntity *ent, const idVec3 color)
Definition: GameEdit.cpp:830
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
Definition: snd_shader.cpp:467
#define CLIPMODEL_ID_TO_JOINT_HANDLE(id)
Definition: Clip.h:40
static idTypeInfo * GetType(int num)
Definition: Class.cpp:570
bool IsActiveAF(void) const
Definition: AFEntity.h:168
void Delete(const char *key)
Definition: Dict.cpp:496
virtual idAnimator * GetAnimator(void)
Definition: Entity.cpp:1566
void UnbindSelected(void)
Definition: GameEdit.cpp:373
virtual void DebugArrow(const idVec4 &color, const idVec3 &start, const idVec3 &end, int size, const int lifetime=0)=0
idMapEntity * FindEntity(const char *name)
Definition: MapFile.cpp:895
idClip clip
Definition: Game_local.h:296
idVec4 colorWhite
Definition: Lib.cpp:116
void Printf(const char *fmt,...) const id_attribute((format(printf
Definition: Game_local.cpp:699
~idCursor3D(void)
Definition: GameEdit.cpp:60
struct idEntity::entityFlags_s fl
void Spawn(void)
Definition: GameEdit.cpp:68
#define MAX_GENTITIES
Definition: Game_local.h:83
void Bind(idEntity *master, bool orientated)
Definition: Entity.cpp:1896
type * GetEntity(void) const
Definition: Game_local.h:695
void Think(void)
Definition: GameEdit.cpp:94
virtual void MapRemoveEntity(const char *name) const
Definition: GameEdit.cpp:1084
float GetFloat(void) const
Definition: CVarSystem.h:144
const GLdouble * v
Definition: glext.h:2936
virtual void EntityTranslate(idEntity *ent, const idVec3 &org)
Definition: GameEdit.cpp:841
const idStr & GetKey(void) const
Definition: Dict.h:52
void FreeSource(void)
Definition: Lexer.cpp:1676
const idEventDef EV_Activate("activate","e")
idEntity * GetBindMaster(void) const
Definition: Entity.cpp:2153
void DeleteSelected(void)
Definition: GameEdit.cpp:306
idMat3 Transpose(void) const
Definition: Matrix.h:677
idVec3 localEntityPoint
Definition: GameEdit.h:82
int Length(void) const
Definition: Str.h:702
void SetAxis(const idMat3 &axis)
Definition: Entity.cpp:2796
bool IsType(const idTypeInfo &c) const
Definition: Class.h:337
idCursor3D * cursor
Definition: GameEdit.h:85
virtual void EntitySetAxis(idEntity *ent, const idMat3 &axis)
Definition: GameEdit.cpp:819
idAFBody * GetBody(const char *bodyName) const
virtual const char * GetUniqueEntityName(const char *classname) const
Definition: GameEdit.cpp:764
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
Definition: Dict.cpp:523
idVec3 GetEyePosition(void) const
idVec3 draggedPosition
Definition: GameEdit.h:53
idEntityPtr< idEntity > selected
Definition: GameEdit.h:86
bool ProcessEvent(const idEventDef *ev)
Definition: Class.cpp:858
void Strip(const char c)
Definition: Str.h:915
virtual void EntityStopSound(idEntity *ent)
Definition: GameEdit.cpp:917
virtual void DebugBox(const idVec4 &color, const idBox &box, const int lifetime=0)=0
virtual void PlayerGetOrigin(idVec3 &org) const
Definition: GameEdit.cpp:946
virtual void TriggerSelected()
Definition: GameEdit.cpp:696
idGameEdit gameEditLocal
Definition: GameEdit.cpp:667
Definition: Vector.h:316
void DisplayEntities(void)
Definition: GameEdit.cpp:532
virtual void Translate(const idVec3 &translation, int id=-1)=0
GLuint GLuint GLsizei GLenum type
Definition: glext.h:2845
Definition: Token.h:71
idEditEntities(void)
Definition: GameEdit.cpp:413
const char * GetClassname(void) const
Definition: Class.cpp:593
void Set(const char *key, const char *value)
Definition: Dict.cpp:275
idDict spawnArgs
Definition: Entity.h:122
int i
Definition: process.py:33
contactInfo_t c
GLuint GLuint num
Definition: glext.h:5390
idDragEntity(void)
Definition: GameEdit.cpp:117
virtual void SetModel(const char *modelname)
Definition: Entity.cpp:1150
void StopDrag(void)
Definition: GameEdit.cpp:155
int Icmp(const char *text) const
Definition: Str.h:667
idForce_Drag drag
Definition: GameEdit.h:52
float fraction
void SetDragPosition(const idVec3 &pos)
Definition: Force_Drag.cpp:86
idDict epairs
Definition: MapFile.h:166
idVec4 colorRed
Definition: Lib.cpp:117
const int BUTTON_ATTACK
Definition: UsercmdGen.h:44
idVec3 localPlayerPoint
Definition: GameEdit.h:83
idCVar g_dragDamping("g_dragDamping","0.5", CVAR_GAME|CVAR_FLOAT,"")
virtual const idDict * FindEntityDefDict(const char *name, bool makeDefault=true) const
Definition: GameEdit.cpp:735
idEntity * SpawnEntityType(const idTypeInfo &classdef, const idDict *args=NULL, bool bIsClientReadSnapshot=false)
void SetPhysics(idPhysics *physics, int id, const idVec3 &p)
Definition: Force_Drag.cpp:75
void RemoveSelectedEntity(idEntity *ent)
Definition: GameEdit.cpp:472
virtual void MapCopyDictToEntity(const char *name, const idDict *dict) const
Definition: GameEdit.cpp:1026
virtual void MapSetEntityKeyVal(const char *name, const char *key, const char *val) const
Definition: GameEdit.cpp:1011
int GetBindBody(void) const
Definition: Entity.cpp:2171
virtual void EntityGetAxis(idEntity *ent, idMat3 &axis) const
Definition: GameEdit.cpp:797
Definition: Lexer.h:137
virtual void Show(void)
Definition: Entity.cpp:1239
virtual void PlayerGetEyePosition(idVec3 &org) const
Definition: GameEdit.cpp:973
void Present(void)
Definition: GameEdit.cpp:76
GLuint GLuint GLsizei count
Definition: glext.h:2845
idVec4 colorYellow
Definition: Lib.cpp:120
idEntity * FindTraceEntity(idVec3 start, idVec3 end, const idTypeInfo &c, const idEntity *skip) const
virtual void Evaluate(int time)
Definition: Force_Drag.cpp:113
idPhysics * GetPhysics(void) const
Definition: Entity.cpp:2607
const char * GetString(const char *key, const char *defaultString="") const
Definition: Dict.h:240
bool SpawnEntityDef(const idDict &args, idEntity **ent=NULL, bool setDefaults=true)
Definition: Vector.h:808
idWorldspawn * world
Definition: Game_local.h:280
void SetSelected(idEntity *ent)
Definition: GameEdit.cpp:296
int GetNumEntities(void) const
Definition: MapFile.h:196
virtual renderEntity_t * GetRenderEntity(void)
Definition: Entity.cpp:1506
void Unbind(void)
Definition: Entity.cpp:2011
idStr bodyName
Definition: GameEdit.h:84
GLuint GLuint end
Definition: glext.h:2845
idPhysics_AF * GetAFPhysics(void)
Definition: AFEntity.h:170
virtual void MapSave(const char *path=NULL) const
Definition: GameEdit.cpp:999
virtual void PlayerGetViewAngles(idAngles &angles) const
Definition: GameEdit.cpp:964
virtual void UpdateChangeableSpawnArgs(const idDict *source)
Definition: Entity.cpp:377
Definition: Dict.h:65
#define NULL
Definition: Lib.h:88
virtual void EntityDelete(idEntity *ent)
Definition: GameEdit.cpp:928
bool Write(const char *fileName, const char *ext, bool fromBasePath=true)
Definition: MapFile.cpp:833
virtual void AddSelectedEntity(idEntity *ent)
Definition: GameEdit.cpp:724
int GetInteger(void) const
Definition: CVarSystem.h:143
idVec3 GetVector(const char *key, const char *defaultString=NULL) const
Definition: Dict.h:260
virtual void PlayerGetAxis(idMat3 &axis) const
Definition: GameEdit.cpp:955
usercmd_t usercmd
Definition: Player.h:249
void Init(float damping)
Definition: Force_Drag.cpp:64
type * Find(type const &obj) const
Definition: List.h:782
const char * path
Definition: sws.c:117
const idStr & GetValue(void) const
Definition: Dict.h:53
virtual const idMat3 & GetAxis(int id=0) const =0
idMapFile * GetLevelMap(void)
virtual idAnimator * GetAnimator(void)
Definition: Entity.cpp:5213
void Clear(void)
Definition: Str.h:724
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)
Definition: GameEdit.cpp:167
bool SelectEntity(const idVec3 &origin, const idVec3 &dir, const idEntity *skip)
Definition: GameEdit.cpp:423
idLinkList< idEntity > spawnNode
Definition: Entity.h:114
idGameLocal gameLocal
Definition: Game_local.cpp:64
virtual void ShowEditingDialog(void)
Definition: Entity.cpp:3800
#define END_CLASS
Definition: Class.h:54
jointHandle_t joint
Definition: GameEdit.h:80
void AddSelectedEntity(idEntity *ent)
Definition: GameEdit.cpp:462
int LoadMemory(const char *ptr, int length, const char *name, int startLine=1)
Definition: Lexer.cpp:1646
idLinkList< idEntity > spawnedEntities
Definition: Game_local.h:281
virtual int GetSelectedEntities(idEntity *list[], int max)
Definition: GameEdit.cpp:676
void RemoveEntity(idMapEntity *mapEnt)
Definition: MapFile.cpp:910
#define MAX_DRAG_TRACE_DISTANCE
Definition: GameEdit.cpp:110
idDeclManager * declManager
idEntity * entities[MAX_GENTITIES]
Definition: Game_local.h:275
virtual void EntitySetModel(idEntity *ent, const char *val)
Definition: GameEdit.cpp:905
idList< idEntity * > selectedEntities
Definition: GameEdit.h:116
int BodyForClipModelId(int id) const
Definition: AFEntity.cpp:639
Definition: Matrix.h:333
bool EntityIsSelectable(idEntity *ent, idVec4 *color=NULL, idStr *text=NULL)
Definition: GameEdit.cpp:499
int AddUnique(const type &obj)
Definition: List.h:742
void UpdateVisuals(void)
Definition: Entity.cpp:1310
virtual void EntitySetOrigin(idEntity *ent, const idVec3 &org)
Definition: GameEdit.cpp:808
GLuint id
Definition: glext.h:3103
bool GetBool(void) const
Definition: CVarSystem.h:142
tuple f
Definition: idal.py:89
idAngles viewAngles
Definition: Player.h:258
idEditEntities * editEntities
Definition: Game_local.h:308
int Num(void) const
Definition: List.h:265
idMat3 ToMat3(void) const
Definition: Angles.cpp:199
~idDragEntity(void)
Definition: GameEdit.cpp:127
virtual void SetColor(float red, float green, float blue)
Definition: Entity.cpp:1082
const GLcharARB * name
Definition: glext.h:3629
#define CLASS_DECLARATION(nameofsuperclass, nameofclass)
Definition: Class.h:110
Definition: Str.h:116
idBounds bounds
Definition: RenderWorld.h:95
virtual int MapGetEntitiesMatchingClassWithString(const char *classname, const char *match, const char *list[], const int max) const
Definition: GameEdit.cpp:1100
const char * GetName(void) const
Definition: Entity.cpp:875
idGameEdit * gameEdit
Definition: GameEdit.cpp:668
idEntityPtr< idEntity > dragEnt
Definition: GameEdit.h:79
virtual bool PlayerIsValid() const
Definition: GameEdit.cpp:937
const char * c_str(void) const
Definition: Str.h:487
virtual const idDict * MapGetEntityDict(const char *name) const
Definition: GameEdit.cpp:983
const char * GetJointName(jointHandle_t handle) const
virtual void ClearEntitySelection(void)
Definition: GameEdit.cpp:710
void BecomeActive(int flags)
Definition: Entity.cpp:995
idDeclBase * base
Definition: DeclManager.h:236
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
Definition: Dict.h:294
virtual void EntityGetOrigin(idEntity *ent, idVec3 &org) const
Definition: GameEdit.cpp:786
virtual void SpawnEntityDef(const idDict &args, idEntity **ent)
Definition: GameEdit.cpp:744
void ClearSelectedEntities(void)
Definition: GameEdit.cpp:483
jointHandle_t GetBindJoint(void) const
Definition: Entity.cpp:2162
void BindSelected(void)
Definition: GameEdit.cpp:317
virtual const idDict * EntityGetSpawnArgs(idEntity *ent) const
Definition: GameEdit.cpp:852
virtual void DebugBounds(const idVec4 &color, const idBounds &bounds, const idVec3 &org=vec3_origin, const int lifetime=0)=0
idRenderWorld * gameRenderWorld
Definition: Game_local.cpp:55
void GetViewPos(idVec3 &origin, idMat3 &axis) const
const char * classname
Definition: Class.h:273
char * va(const char *fmt,...)
Definition: Str.cpp:1568
int AddEntity(idMapEntity *mapentity)
Definition: MapFile.cpp:885
void SetOrigin(const idVec3 &org)
Definition: Entity.cpp:2784
#define max(x, y)
Definition: os.h:70
int entityNumber
Definition: Entity.h:111
virtual void EntityChangeSpawnArgs(idEntity *ent, const idDict *newArgs)
Definition: GameEdit.cpp:875
idStr name
Definition: Entity.h:121
int thinkFlags
Definition: Entity.h:125
int GetNumKeyVals(void) const
Definition: Dict.h:290
void Zero(void)
Definition: Vector.h:415
void Set(const float x, const float y, const float z, const float w)
Definition: Vector.h:873
const char * GetName(void) const
Definition: MapFile.h:200
void BecomeInactive(int flags)
Definition: Entity.cpp:1025
int ReadToken(idToken *token)
Definition: Lexer.cpp:820
int sprintf(idStr &string, const char *fmt,...)
Definition: Str.cpp:1528
#define JOINT_HANDLE_TO_CLIPMODEL_ID(id)
Definition: Clip.h:41
int nextSelectTime
Definition: GameEdit.h:114
virtual idEntity * FindEntity(const char *name) const
Definition: GameEdit.cpp:753
Definition: Box.h:40
byte buttons
Definition: UsercmdGen.h:94
virtual void MapEntityTranslate(const char *name, const idVec3 &v) const
Definition: GameEdit.cpp:1131
GLuint start
Definition: glext.h:2845
bool Remove(const type &obj)
Definition: List.h:878
void StopSound(const s_channelType channel, bool broadcast)
Definition: Entity.cpp:1713
virtual declState_t GetState(void) const =0
idVec4 colorBlue
Definition: Lib.cpp:119
void SetVector(const char *key, const idVec3 &val)
Definition: Dict.h:200
const idStr & GetName(void) const
Definition: Physics_AF.h:668
virtual int MapGetUniqueMatchingKeyVals(const char *key, const char *list[], const int max) const
Definition: GameEdit.cpp:1048
virtual void EntityUpdateVisuals(idEntity *ent)
Definition: GameEdit.cpp:894
void Clear(void)
Definition: List.h:184