Home
Quake Architecture
Super Spectator Architecture
Pseudocamera functions
Usage

Design

What the Pseudocam knows...(a lot)

The pseudocam, and camera structs

Each pseudocam knows the following things....

          
          pseudocam  {
             its state  
             client number you are following
             dimensions[2]
             looking angles vector
             position vector
             playerstate
             fovx, fovy
             zoomfov
             max fov
             screen height, width
             Array of camera (look down for camera stuct)
             if this pseudocamera exists yet
             the number of cameras currently attached to it
             and its its zoomed or not
          }

          camera  {    
             /* this is for each camera that is attached to the
             pseudocamera */
             clientNum of client associated with this camera
             its original initalisation yaw
             its looking angles vector
             its name
             individual fov
         }
         

What the pseudocam does

The pseudocam methods

These are the methods written explicity in the g_pseudocam.c file, there are other methods written to support these as well as to provide extra functionality and interface. But these are the heart and soul (more so the heart).

int pcCreate(int x, int y, int xPos, int yPos, int zPos);

Creates and initialises a pseudo camera

void pcList(int clientNum);

lists the available pseudocams

void pcSetDims (gentity_t * ent, int width, int height);

sets the screen dimenstions of the pserudocam related to the scrren height and width of the client that connects

int pcExists(int pc_num);

Tells if the pseudo cam exists or not

void pcUpdateCams ( pseudocam_t *pc, vec3_t origin, vec3_t angles);

This is the major method that gets called once a frame, this method determines the position of the pseudocamera, then the camera. It also determines the looking vectors for each of the cameras associated with the pseudocamera, and does a lot of maths to calculate the final vectors

void pcFollowCycle (pseudocam_t *pc);

Goes through the folllow cycle of the players

void pcUpdateClients (pseudocam_t *pc);

Updates the clients that are associacted with individual cameras, this is called from the updateCamera

void pcViewpos(gentity_t *ent, int pc_num);

gives you the viewpos of the pseudocamera

void pcSetViewpos(gentity_t *ent, int pc_num, vec3_t pos, vec3_t angles);

sets the viewpos of the pseudocamera so you can jump around with it

int pcJoin(gentity_t *ent, int pc_num, char *result);

lets an entity (player) join the pseudo camera

void pcListClients(gentity_t *ent, int pc_num);

lists each of the clients associated with the pseudocamera and gives you their position and looking vectors

void pcFree(gentity_t *ent, int pc_num);

frees the client from the pseudocamera

void pcZoomIn(pseudocam_t *pc);

Zooms in the pseudocamera (called everyframe when zooming in)

void pcZoomOut(pseudocam_t *pc);

Zooms out the pseudocamera (called everyframe when zooming in)