Open source remastering of the Freespace 2 engine
debris.h File Reference

Go to the source code of this file.


struct  debris


#define MAX_DEBRIS_ARCS   8
#define DEBRIS_USED   (1<<0)
#define DEBRIS_EXPIRE   (1<<1)
#define MAX_DEBRIS_PIECES   64


typedef struct debris debris


void debris_init ()
void debris_render_DEPRECATED (object *obj)
void debris_render (object *obj, draw_list *scene)
void debris_delete (object *obj)
void debris_process_post (object *obj, float frame_time)
objectdebris_create (object *source_obj, int model_num, int submodel_num, vec3d *pos, vec3d *exp_center, int hull_flag, float exp_force)
int debris_check_collision (object *obj, object *other_obj, vec3d *hitpos, collision_info_struct *debris_hit_info=NULL)
void debris_hit (object *debris_obj, object *other_obj, vec3d *hitpos, float damage)
int debris_get_team (object *objp)
void debris_clear_expired_flag (debris *db)


debris Debris [MAX_DEBRIS_PIECES]
int Num_debris_pieces

Macro Definition Documentation

#define DEBRIS_EXPIRE   (1<<1)

Definition at line 55 of file debris.h.

#define DEBRIS_USED   (1<<0)

Definition at line 54 of file debris.h.

#define MAX_DEBRIS_ARCS   8

Definition at line 21 of file debris.h.

#define MAX_DEBRIS_PIECES   64

Definition at line 57 of file debris.h.

Typedef Documentation

typedef struct debris debris

Function Documentation

int debris_check_collision ( object pdebris,
object other_obj,
vec3d hitpos,
collision_info_struct debris_hit_info 

See if poor debris object *obj got whacked by evil *other_obj at point *hitpos. NOTE: debris_hit_info pointer NULL for debris:weapon collision, otherwise debris:ship collision.

true if hit, else return false.

Definition at line 808 of file debris.cpp.

void debris_clear_expired_flag ( debris db)

Removed the DEBRIS_EXPIRE flag, and remove item from Hull_debris_list

Definition at line 208 of file debris.cpp.

object* debris_create ( object source_obj,
int  model_num,
int  submodel_num,
vec3d pos,
vec3d exp_center,
int  hull_flag,
float  exp_force 

Create debris from an object

source_objSource object
model_numModel number
submodel_numSub-model number
posPosition in vector space
exp_centerExplosion center in vector space
hull_flagHull flag settings
exp_forceExplosion force, used to assign velocity to pieces. 1.0f assigns velocity like before. 2.0f assigns twice as much to non-inherited part of velocity

Definition at line 462 of file debris.cpp.

void debris_delete ( object obj)

Delete the debris object. This is only ever called via obj_delete(). Do not call directly. Use debris_start_death_roll() if you want to force a debris piece to die.

Definition at line 225 of file debris.cpp.

int debris_get_team ( object objp)

Return the team field for a debris object

Definition at line 1065 of file debris.cpp.

void debris_hit ( object debris_obj,
object other_obj,
vec3d hitpos,
float  damage 

Alas, poor debris_obj got whacked. Fortunately, we know who did it, where and how hard, so we can do something about it.

Definition at line 751 of file debris.cpp.

void debris_init ( )

This will get called at the start of each level.

Definition at line 87 of file debris.cpp.

void debris_process_post ( object obj,
float  frame_time 

Do various updates to debris: check if time to die, start fireballs Maybe delete debris if it's very far away from player.

objpointer to debris object
frame_timetime elapsed since last debris_move() called

Definition at line 284 of file debris.cpp.

void debris_render ( object obj,
draw_list scene 

Definition at line 1099 of file debris.cpp.

void debris_render_DEPRECATED ( object obj)

Render debris

Definition at line 150 of file debris.cpp.

Variable Documentation

Definition at line 41 of file debris.cpp.

int Num_debris_pieces

Definition at line 43 of file debris.cpp.