Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Physics.cpp File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "physics.h"
#include "floating.h"
#include "player.h"
#include "Freespace.h"
#include "LinkList.h"
#include "timer.h"
#include "Key.h"

Defines

#define MAX_TURN_LIMIT   0.2618f
#define ROT_DEBUG
#define ROTVEL_TOL   0.1
#define ROTVEL_CAP   14.0
#define DEAD_ROTVEL_CAP   16.3
#define MAX_SHIP_SPEED   300
#define RESET_SHIP_SPEED   240
#define SW_ROT_FACTOR   5
#define SW_BLAST_DURATION   2000
#define REDUCED_DAMP_FACTOR   10
#define REDUCED_DAMP_VEL   30
#define REDUCED_DAMP_TIME   2000
#define WEAPON_SHAKE_TIME   500
#define SPECIAL_WARP_T_CONST   0.651
#define PHYS_DEBUG
#define BANK_WHEN_TURN
#define WHACK_LIMIT   0.001f
#define ROTVEL_WHACK_CONST   0.12
#define STD_PRESSURE   1000
#define MIN_RADIUS   10
#define MAX_RADIUS   50
#define MAX_ROTVEL   0.4
#define MAX_SHAKE   0.1
#define MAX_VEL   8
#define ROTVEL_COLLIDE_WHACK_CONST   1.0

Functions

void update_reduced_damp_timestamp (physics_info *pi, float impulse)
void physics_init (physics_info *pi)
void apply_physics (float damping, float desired_vel, float initial_vel, float t, float *new_vel, float *delta_pos)
void physics_set_viewer (physics_info *p, int dir)
void physics_sim_rot (matrix *orient, physics_info *pi, float sim_time)
void physics_sim_rot_editor (matrix *orient, physics_info *pi, float sim_time)
void physics_sim_vel (vector *position, physics_info *pi, float sim_time, matrix *orient)
void physics_sim (vector *position, matrix *orient, physics_info *pi, float sim_time)
void physics_sim_editor (vector *position, matrix *orient, physics_info *pi, float sim_time)
void physics_predict_pos (physics_info *pi, float delta_time, vector *predicted_pos)
void physics_predict_vel (physics_info *pi, float delta_time, vector *predicted_vel)
void physics_predict_pos_and_vel (physics_info *pi, float delta_time, vector *predicted_vel, vector *predicted_pos)
void physics_read_flying_controls (matrix *orient, physics_info *pi, control_info *ci, float sim_time, vector *wash_rot)
void physics_set_rotvel_and_saturate (float *dest, float delta)
void physics_apply_whack (vector *impulse, vector *pos, physics_info *pi, matrix *orient, float mass)
float velocity_ramp (float v_in, float v_goal, float ramp_time_const, float t)
void physics_apply_shock (vector *direction_vec, float pressure, physics_info *pi, matrix *orient, vector *min, vector *max, float radius)
void physics_collide_whack (vector *impulse, vector *world_delta_rotvel, physics_info *pi, matrix *orient)
int check_rotvel_limit (physics_info *pi)

Variables

float Physics_viewer_bank = 0.0f
int Physics_viewer_direction = PHYSICS_VIEWER_FRONT
physics_infoViewer_physics_info = NULL

Define Documentation

#define BANK_WHEN_TURN
 

#define DEAD_ROTVEL_CAP   16.3
 

#define MAX_RADIUS   50
 

#define MAX_ROTVEL   0.4
 

#define MAX_SHAKE   0.1
 

#define MAX_SHIP_SPEED   300
 

#define MAX_TURN_LIMIT   0.2618f
 

#define MAX_VEL   8
 

#define MIN_RADIUS   10
 

#define PHYS_DEBUG
 

#define REDUCED_DAMP_FACTOR   10
 

#define REDUCED_DAMP_TIME   2000
 

#define REDUCED_DAMP_VEL   30
 

#define RESET_SHIP_SPEED   240
 

#define ROT_DEBUG
 

#define ROTVEL_CAP   14.0
 

#define ROTVEL_COLLIDE_WHACK_CONST   1.0
 

#define ROTVEL_TOL   0.1
 

#define ROTVEL_WHACK_CONST   0.12
 

#define SPECIAL_WARP_T_CONST   0.651
 

#define STD_PRESSURE   1000
 

#define SW_BLAST_DURATION   2000
 

#define SW_ROT_FACTOR   5
 

#define WEAPON_SHAKE_TIME   500
 

#define WHACK_LIMIT   0.001f
 


Function Documentation

void apply_physics float    damping,
float    desired_vel,
float    initial_vel,
float    t,
float *    new_vel,
float *    delta_pos
 

int check_rotvel_limit physics_info   pi
 

void physics_apply_shock vector   direction_vec,
float    pressure,
physics_info   pi,
matrix   orient,
vector   min,
vector   max,
float    radius
 

void physics_apply_whack vector   impulse,
vector   pos,
physics_info   pi,
matrix   orient,
float    mass
 

void physics_collide_whack vector   impulse,
vector   world_delta_rotvel,
physics_info   pi,
matrix   orient
 

void physics_init physics_info   pi
 

void physics_predict_pos physics_info   pi,
float    delta_time,
vector   predicted_pos
 

void physics_predict_pos_and_vel physics_info   pi,
float    delta_time,
vector   predicted_vel,
vector   predicted_pos
 

void physics_predict_vel physics_info   pi,
float    delta_time,
vector   predicted_vel
 

void physics_read_flying_controls matrix   orient,
physics_info   pi,
control_info   ci,
float    sim_time,
vector   wash_rot
 

void physics_set_rotvel_and_saturate float *    dest,
float    delta
 

void physics_set_viewer physics_info   p,
int    dir
 

void physics_sim vector   position,
matrix   orient,
physics_info   pi,
float    sim_time
 

void physics_sim_editor vector   position,
matrix   orient,
physics_info   pi,
float    sim_time
 

void physics_sim_rot matrix   orient,
physics_info   pi,
float    sim_time
 

void physics_sim_rot_editor matrix   orient,
physics_info   pi,
float    sim_time
 

void physics_sim_vel vector   position,
physics_info   pi,
float    sim_time,
matrix   orient
 

void update_reduced_damp_timestamp physics_info   pi,
float    impulse
 

float velocity_ramp float    v_in,
float    v_goal,
float    ramp_time_const,
float    t
 


Variable Documentation

float Physics_viewer_bank = 0.0f
 

int Physics_viewer_direction = PHYSICS_VIEWER_FRONT
 

physics_info* Viewer_physics_info = NULL [static]
 


Generated on Mon Jul 8 11:29:47 2002 for fs2source_released by doxygen1.2.16