SPYSpheres
Constants.h File Reference

A list of constants used in the ZR program. More...

#include "math_matrix.h"

Go to the source code of this file.

Defines

#define ALLIANCE
#define SHOW_GAME_TRACE
#define GAME_TIME   0
 The time at game start.
#define VEL_X   3
 The index for the beginning of the velocity array inside of ZRState.
#define MAX_GAME_TIME   180
 Length of the whole game in seconds.
#define MAX_FACING_ANGLE   0.968912f
 Cosine of the angle at which pictures may be taken/uploaded.
#define UPLOAD_ANG_VEL   0.05f
 The maximum speed at which pictures can be uploaded in rads/s, which is roughly equal to 2.8 deg/s. This is calculated by taking the absolute value of the magnitude of the attitude rate vector.
#define ITEM_TYPE_ADD_SCORE   0
 The type identifier for a score item.
#define ITEM_TYPE_ADD_ENERGY   1
 The type identifier for an energy item.
#define ITEM_TYPE_MIRROR   2
 The type identifier for a mirror.
#define ITEM_SCORE   1.5f
 The added score given by a score item.
#define ITEM_ENERGY   MAX_ENERGY
 The added energy given by an energy item.
#define ITEM_MIRROR_DURATION   24
 The length a mirror lasts once activated.
#define NUM_ITEMS   9
 The number of items in the game.
#define STARTING_MIRRORS   0
 The number of mirrors each sphere starts with.
#define MP_SPEED   0.01f
 The maximum speed at which an item may be picked up.
#define MP_RADIUS   0.05f
 The maximum distance from which an item may be picked up.
#define MP_ROTATION_ANGLE   0.707106f
 (rad) Rotation of satellite needed to pick up item (cos(90/2))
#define MP_EMPTY   0x0fff
#define LIGHT_SWITCH_PERIOD   60
 The light switches this number of seconds after the first flip in the 2D/3D versions of the game.
#define LIGHT_SPEED   .025f
 The light moves at this speed (in m/s) during the Alliance portion of the game.
#define LIGHT_WIDTH   .8
 The width of the area that is not dark. Note that this includes the grey zone.
#define LIGHT_GREY_WIDTH   .2
 The width of the grey zone in the 2D/3D versions. The width of each grey zone in Alliance is LIGHT_GREY_WIDTH/2.
#define DISABLE_CAMERA_TIME   3
 The camera is disabled for this many seconds after taking and uploading pictures.
#define CAMERA_DEFAULT_MEMORY   2
 The number of memory slots an unmodified camera has.
#define CAMERA_MAX_MEMORY   4
 The number of memory slots the camera may have at a maximum.
#define PHOTO_MIN_DISTANCE   0.5
 The minimum distance the sphere may be from the target of its photograph.
#define MIN_FUEL(a, b)   ((a < b) ? b : a)
#define MAX_FUEL(c, d)   ((c < d) ? c : d)
#define PROP_ALLOWED_SECONDS   60.0f
 Total time in thruster-seconds allowed per user. Full tank ~500 seconds.
#define MAX_ENERGY   5.0f
 Energy capacity.
#define STARTING_ENERGY   MAX_ENERGY
 Starting energy.
#define ENERGY_GAIN_RATE   0.5f
 Energy gained per second.
#define ENERGY_COST_TAKE_PICTURE   1.0f
 The energy cost to take a picture.
#define ENERGY_COST_GET_OTHER_ENERGY   0.0f
 The energy cost to determine how much energy your opponent has.
#define ENERGY_COST_GET_PIC_POINTS   0.1f
 The energy cost to determine how many points taking a picture right now would be worth, should you choose to take it.
#define ENERGY_COST_UPLOAD_PICTURES   1.0f
 The energy cost to upload pictures.
#define ENERGY_COST_THRUSTERS   (.001f)*(.3f)
 The energy cost to use one thousandth of a second of fuel.
#define OFFSIDES_PENALTY   .02*PROP_ALLOWED_SECONDS
#define OOBgain   10.0f
#define DRAG   1000.0f
#define START_SCORE   0.0f
 Your score upon starting the game.
#define ZONE_pX   0.64f
 The highest X coordinate in bounds.
#define ZONE_pY   0.80f
 The highest Y coordinate in bounds.
#define ZONE_pZ   0.64f
 The highest Z coordinate in bounds.
#define ZONE_nX   -ZONE_pX
 The lowest X coordinate in bounds.
#define ZONE_nY   -ZONE_pY
 The lowest Y coordinate in bounds.
#define ZONE_nZ   -ZONE_pZ
 The lowest Z coordinate in bounds.

Variables

const float EARTH [3] = {0.0f, 0.0f, 1.0f}
 Contains the attitude towards Earth.
const int ITEM_TYPES [NUM_ITEMS]
 Array that outlines the types of each item.
const float limits [3] = {ZONE_pX,ZONE_pY,ZONE_pZ}
 The limits of the interaction zone.

Detailed Description

A list of constants used in the ZR program.

Definition in file Constants.h.


Define Documentation

#define ALLIANCE

Definition at line 36 of file Constants.h.

#define CAMERA_DEFAULT_MEMORY   2

The number of memory slots an unmodified camera has.

Definition at line 199 of file Constants.h.

#define CAMERA_MAX_MEMORY   4

The number of memory slots the camera may have at a maximum.

Definition at line 200 of file Constants.h.

#define DISABLE_CAMERA_TIME   3

The camera is disabled for this many seconds after taking and uploading pictures.

Definition at line 198 of file Constants.h.

#define DRAG   1000.0f

Definition at line 226 of file Constants.h.

#define ENERGY_COST_GET_OTHER_ENERGY   0.0f

The energy cost to determine how much energy your opponent has.

Definition at line 215 of file Constants.h.

#define ENERGY_COST_GET_PIC_POINTS   0.1f

The energy cost to determine how many points taking a picture right now would be worth, should you choose to take it.

Definition at line 216 of file Constants.h.

#define ENERGY_COST_TAKE_PICTURE   1.0f

The energy cost to take a picture.

Definition at line 214 of file Constants.h.

#define ENERGY_COST_THRUSTERS   (.001f)*(.3f)

The energy cost to use one thousandth of a second of fuel.

Definition at line 220 of file Constants.h.

#define ENERGY_COST_UPLOAD_PICTURES   1.0f

The energy cost to upload pictures.

Definition at line 219 of file Constants.h.

#define ENERGY_GAIN_RATE   0.5f

Energy gained per second.

Definition at line 213 of file Constants.h.

int GAME_TIME   0

The time at game start.

Definition at line 45 of file Constants.h.

#define ITEM_ENERGY   MAX_ENERGY

The added energy given by an energy item.

Definition at line 91 of file Constants.h.

#define ITEM_MIRROR_DURATION   24

The length a mirror lasts once activated.

Definition at line 92 of file Constants.h.

#define ITEM_SCORE   1.5f

The added score given by a score item.

Definition at line 90 of file Constants.h.

#define ITEM_TYPE_ADD_ENERGY   1

The type identifier for an energy item.

Definition at line 87 of file Constants.h.

#define ITEM_TYPE_ADD_SCORE   0

The type identifier for a score item.

Definition at line 86 of file Constants.h.

#define ITEM_TYPE_MIRROR   2

The type identifier for a mirror.

Definition at line 88 of file Constants.h.

#define LIGHT_GREY_WIDTH   .2

The width of the grey zone in the 2D/3D versions. The width of each grey zone in Alliance is LIGHT_GREY_WIDTH/2.

Definition at line 193 of file Constants.h.

#define LIGHT_SPEED   .025f

The light moves at this speed (in m/s) during the Alliance portion of the game.

Definition at line 191 of file Constants.h.

#define LIGHT_SWITCH_PERIOD   60

The light switches this number of seconds after the first flip in the 2D/3D versions of the game.

Definition at line 190 of file Constants.h.

#define LIGHT_WIDTH   .8

The width of the area that is not dark. Note that this includes the grey zone.

Definition at line 192 of file Constants.h.

#define MAX_ENERGY   5.0f

Energy capacity.

Definition at line 211 of file Constants.h.

float MAX_FACING_ANGLE   0.968912f

Cosine of the angle at which pictures may be taken/uploaded.

Definition at line 73 of file Constants.h.

#define MAX_FUEL (   c,
 
)    ((c < d) ? c : d)

Definition at line 206 of file Constants.h.

int MAX_GAME_TIME   180

Length of the whole game in seconds.

Definition at line 66 of file Constants.h.

#define MIN_FUEL (   a,
 
)    ((a < b) ? b : a)

Definition at line 205 of file Constants.h.

#define MP_EMPTY   0x0fff

Definition at line 187 of file Constants.h.

#define MP_RADIUS   0.05f

The maximum distance from which an item may be picked up.

Definition at line 184 of file Constants.h.

#define MP_ROTATION_ANGLE   0.707106f

(rad) Rotation of satellite needed to pick up item (cos(90/2))

Definition at line 185 of file Constants.h.

#define MP_SPEED   0.01f

The maximum speed at which an item may be picked up.

Definition at line 183 of file Constants.h.

#define NUM_ITEMS   9

The number of items in the game.

Definition at line 93 of file Constants.h.

Definition at line 224 of file Constants.h.

#define OOBgain   10.0f

Definition at line 225 of file Constants.h.

#define PHOTO_MIN_DISTANCE   0.5

The minimum distance the sphere may be from the target of its photograph.

Definition at line 202 of file Constants.h.

#define PROP_ALLOWED_SECONDS   60.0f

Total time in thruster-seconds allowed per user. Full tank ~500 seconds.

Definition at line 207 of file Constants.h.

#define SHOW_GAME_TRACE

Definition at line 38 of file Constants.h.

#define START_SCORE   0.0f

Your score upon starting the game.

Definition at line 231 of file Constants.h.

Starting energy.

Definition at line 212 of file Constants.h.

#define STARTING_MIRRORS   0

The number of mirrors each sphere starts with.

Definition at line 94 of file Constants.h.

#define UPLOAD_ANG_VEL   0.05f

The maximum speed at which pictures can be uploaded in rads/s, which is roughly equal to 2.8 deg/s. This is calculated by taking the absolute value of the magnitude of the attitude rate vector.

Definition at line 75 of file Constants.h.

int VEL_X   3

The index for the beginning of the velocity array inside of ZRState.

Definition at line 59 of file Constants.h.

#define ZONE_nX   -ZONE_pX

The lowest X coordinate in bounds.

Definition at line 242 of file Constants.h.

#define ZONE_nY   -ZONE_pY

The lowest Y coordinate in bounds.

Definition at line 243 of file Constants.h.

#define ZONE_nZ   -ZONE_pZ

The lowest Z coordinate in bounds.

Definition at line 244 of file Constants.h.

#define ZONE_pX   0.64f

The highest X coordinate in bounds.

Definition at line 239 of file Constants.h.

#define ZONE_pY   0.80f

The highest Y coordinate in bounds.

Definition at line 240 of file Constants.h.

#define ZONE_pZ   0.64f

The highest Z coordinate in bounds.

Definition at line 241 of file Constants.h.


Variable Documentation

const float EARTH[3] = {0.0f, 0.0f, 1.0f}

Contains the attitude towards Earth.

The satellite's attidude must be within MAX_FACING_ANGLE to this attitude

Definition at line 31 of file Constants.h.

const int ITEM_TYPES[NUM_ITEMS]
Initial value:

Array that outlines the types of each item.

Usage: ITEM_TYPES[int ItemID] Each element is an integer that refers to one of the previously defined item types.

Definition at line 127 of file Constants.h.

const float limits[3] = {ZONE_pX,ZONE_pY,ZONE_pZ}

The limits of the interaction zone.

Definition at line 246 of file Constants.h.