home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / alt / sources / 2611 / static.c < prev   
Encoding:
C/C++ Source or Header  |  1992-11-23  |  2.0 KB  |  102 lines

  1. #ifndef lint
  2. static    char    sccsid[] = "@(#)static.c 1.1 92/05/28 SMI" ;
  3.     /* from static.c 1.2 88/10/19 SMI */
  4. #endif
  5.  
  6. /*
  7.  * Copyright (c) 1986 by Sun Microsystems, Inc.
  8.  */
  9.  
  10. /*
  11.  * special routines for driving a static object
  12.  */
  13.  
  14.  
  15.  
  16. #include <stdio.h>
  17. #include <sys/time.h>
  18.  
  19. #include "dstar.h"
  20. #include "object_types.h"
  21.  
  22.  
  23. extern    new_status() ;
  24. extern    control_object() ;
  25.  
  26.  
  27.     fptr    static_vector[VECTOR_LENGTH] = {
  28.           new_status,        /* new status        */
  29.           control_object,    /* control        */
  30.           NULL,            /* when killed        */
  31.           NULL,            /* when kills        */
  32.         } ;
  33.  
  34.  
  35.  
  36.  
  37.  
  38. create_planet(id)
  39.     int    id ;
  40. {
  41.     Object    *object = &objects[id] ;
  42.  
  43.     object->id = id ;
  44.     strncpy(object->name, "mars", NAMELEN) ;
  45.     object->class = OBJ_STATIC ;
  46.     object->status = OBJ_ACTIVE ;
  47.     object->flags = 0 ;
  48.     object->Posn.x = -1000.0 ;
  49.     object->Posn.y = 0 ;
  50.     object->Posn.z = 0 ;
  51.     object->Forward.x = 0.0 ;
  52.     object->Forward.y = 0.0 ;
  53.     object->Forward.z = 1.0 ;
  54.     object->Up.x = 0.0 ;
  55.     object->Up.y = 1.0 ;
  56.     object->Up.z = 0.0 ;
  57.     object->Right.x = 1.0 ;
  58.     object->Right.y = 0.0 ;
  59.     object->Right.z = 0.0 ;
  60.     object->Delta.x = 0.003 ;
  61.     object->Delta.y = 0.0 ;
  62.     object->Delta.z = 0.0 ;
  63.     object->Speed = 3.0 ;
  64.     object->target = NULL ;
  65.     object->description = PLANET1_DESC ;
  66.     bcopy(static_vector, object->f_vector, sizeof(static_vector)) ;
  67.     special_add_player(object) ;
  68. }
  69.  
  70.  
  71. create_monolith(id)
  72.     int    id ;
  73. {
  74.     Object    *object = &objects[id] ;
  75.  
  76.     object->id = id ;
  77.     strncpy(object->name,"TMA-2",NAMELEN) ;
  78.     object->class = OBJ_STATIC ;
  79.     object->status = OBJ_ACTIVE ;
  80.     object->flags = 0 ;
  81.     object->Posn.x = 0.0 ;
  82.     object->Posn.y = -1000.0 ;
  83.     object->Posn.z = 0 ;
  84.     object->Forward.x = 0.0 ;
  85.     object->Forward.y = 0.0 ;
  86.     object->Forward.z = 1.0 ;
  87.     object->Up.x = 0.0 ;
  88.     object->Up.y = 1.0 ;
  89.     object->Up.z = 0.0 ;
  90.     object->Right.x = 1.0 ;
  91.     object->Right.y = 0.0 ;
  92.     object->Right.z = 0.0 ;
  93.     object->Delta.x = 0.0 ;
  94.     object->Delta.y = 0.005 ;
  95.     object->Delta.z = 0.0 ;
  96.     object->Speed = 5.0 ;
  97.     object->target = NULL ;
  98.     object->description = MONOLITH_DESC ;
  99.     bcopy(static_vector, object->f_vector, sizeof(static_vector)) ;
  100.     special_add_player(object) ;
  101. }
  102.