FS2_Open
Open source remastering of the Freespace 2 engine
|
#include "freespace2/freespace.h"
#include "mission/missionparse.h"
#include "model/model.h"
#include "network/multi.h"
#include "object/objectshield.h"
#include "render/3d.h"
#include "ship/ship.h"
#include "species_defs/species_defs.h"
Go to the source code of this file.
Classes | |
struct | gshield_tri |
struct | shield_hit |
struct | shield_point |
Macros | |
#define | SHIELD_HIT_SCALE 0.15f |
#define | MAX_TRIS_PER_HIT 40 |
#define | MAX_SHIELD_HITS 20 |
#define | MAX_SHIELD_TRI_BUFFER (MAX_SHIELD_HITS*MAX_TRIS_PER_HIT) |
#define | SHIELD_HIT_DURATION (3*F1_0/4) |
#define | SH_UNUSED -1 |
#define | SH_TYPE_1 1 |
#define | UV_MAX (63.95f/64.0f) |
#define | MAX_SHIELD_POINTS 100 |
Typedefs | |
typedef struct gshield_tri | gshield_tri |
typedef struct shield_hit | shield_hit |
typedef struct shield_point | shield_point |
#define MAX_SHIELD_HITS 20 |
Definition at line 32 of file shield.cpp.
#define MAX_SHIELD_POINTS 100 |
Definition at line 75 of file shield.cpp.
#define MAX_SHIELD_TRI_BUFFER (MAX_SHIELD_HITS*MAX_TRIS_PER_HIT) |
Definition at line 33 of file shield.cpp.
#define MAX_TRIS_PER_HIT 40 |
Definition at line 31 of file shield.cpp.
#define SH_TYPE_1 1 |
Definition at line 37 of file shield.cpp.
#define SH_UNUSED -1 |
Definition at line 36 of file shield.cpp.
#define SHIELD_HIT_DURATION (3*F1_0/4) |
Definition at line 34 of file shield.cpp.
#define SHIELD_HIT_SCALE 0.15f |
Definition at line 30 of file shield.cpp.
#define UV_MAX (63.95f/64.0f) |
Definition at line 39 of file shield.cpp.
typedef struct gshield_tri gshield_tri |
Structure which mimics the shield_tri structure in model.h.
Since the global shield triangle array needs the vertex information, we will acutally store the information in this structure instead of the indices into the vertex list
typedef struct shield_hit shield_hit |
typedef struct shield_point shield_point |
Stores point at which shield was hit. Gets processed in frame interval.
Add data for a shield hit.
Definition at line 779 of file shield.cpp.
Definition at line 802 of file shield.cpp.
Return absolute amount of damage not applied.
This is the version that works on a quadrant basis.
Definition at line 644 of file shield.cpp.
void copy_shield_to_globals | ( | int | objnum, |
shield_info * | shieldp | ||
) |
Copy information from Current_tris to Global_tris, stuffing information in a slot in Shield_hits.
The Global_tris array is not a shield_tri structure. We need to store vertex information in the global array since the vertex list will not be available to us when we actually use the array.
Definition at line 585 of file shield.cpp.
Definition at line 179 of file shield.cpp.
void create_shield_explosion | ( | int | objnum, |
int | model_num, | ||
matrix * | orient, | ||
vec3d * | centerp, | ||
vec3d * | tcp, | ||
int | tr0 | ||
) |
Definition at line 731 of file shield.cpp.
Create all the shield explosions that occurred on object *objp this frame.
Definition at line 838 of file shield.cpp.
void create_shield_from_triangle | ( | int | trinum, |
matrix * | orient, | ||
shield_info * | shieldp, | ||
vec3d * | tcp, | ||
vec3d * | centerp, | ||
float | radius, | ||
vec3d * | rvec, | ||
vec3d * | uvec | ||
) |
Definition at line 566 of file shield.cpp.
void create_shield_low_detail | ( | int | objnum, |
int | model_num, | ||
matrix * | orient, | ||
vec3d * | centerp, | ||
vec3d * | tcp, | ||
int | tr0, | ||
shield_info * | shieldp | ||
) |
This function needs to be called by big ships which have shields. It should be able to be modified to deal with the large polygons we use for their shield meshes - unknownplayer
At lower detail levels, shield hit effects are a single texture, applied to one enlarged triangle.
Definition at line 679 of file shield.cpp.
void create_tris_containing | ( | vec3d * | vp, |
matrix * | orient, | ||
shield_info * | shieldp, | ||
vec3d * | tcp, | ||
vec3d * | centerp, | ||
float | radius, | ||
vec3d * | rvec, | ||
vec3d * | uvec | ||
) |
Definition at line 501 of file shield.cpp.
Free records in Global_tris previously used by Shield_hits[shnum].tri_list
Definition at line 243 of file shield.cpp.
int get_free_global_shield_index | ( | ) |
Definition at line 533 of file shield.cpp.
int get_global_shield_tri | ( | ) |
Definition at line 548 of file shield.cpp.
Definition at line 988 of file shield.cpp.
void load_shield_hit_bitmap | ( | ) |
Definition at line 90 of file shield.cpp.
void release_shield_hit_bitmap | ( | ) |
Release the storage allocated to store the shield effect.
This doesn't need to do anything; the bitmap manager will release everything.
Definition at line 155 of file shield.cpp.
void render_low_detail_shield_bitmap | ( | gshield_tri * | trip, |
matrix * | orient, | ||
vec3d * | pos, | ||
ubyte | r, | ||
ubyte | g, | ||
ubyte | b | ||
) |
Definition at line 256 of file shield.cpp.
Render a shield mesh in the global array Shield_hits[]
Definition at line 381 of file shield.cpp.
void render_shield_triangle | ( | gshield_tri * | trip, |
matrix * | orient, | ||
vec3d * | pos, | ||
ubyte | r, | ||
ubyte | g, | ||
ubyte | b | ||
) |
Render one triangle of a shield hit effect on one ship. Each frame, the triangle needs to be rotated into global coords.
trip | pointer to triangle in global array |
orient | orientation of object shield is associated with |
pos | center point of object |
r | Red colour |
g | Green colour |
b | Blue colour |
Definition at line 318 of file shield.cpp.
void render_shields | ( | ) |
Render all the shield hits in the global array Shield_hits[]
This is a temporary function. Shield hit rendering will at least have to occur with the ship, perhaps even internal to the ship.
Definition at line 486 of file shield.cpp.
void rs_compute_uvs | ( | shield_tri * | stp, |
shield_vertex * | verts, | ||
vec3d * | tcp, | ||
float | radius, | ||
vec3d * | rightv, | ||
vec3d * | upv | ||
) |
Given a shield triangle, compute the uv coordinates at its vertices given the center point of the explosion texture, distance to center of shield and right and up vectors.
For small distances (relative to radius), coordinates can be computed using distance. For larger values, should compute angle.
Definition at line 221 of file shield.cpp.
void shield_frame_init | ( | ) |
Definition at line 173 of file shield.cpp.
void shield_hit_close | ( | ) |
De-initialize the shield hit system. Called from game_level_close().
Definition at line 168 of file shield.cpp.
void shield_hit_init | ( | ) |
Initialize shield hit system.
Called from game_level_init()
Definition at line 131 of file shield.cpp.
void shield_hit_page_in | ( | ) |
Definition at line 109 of file shield.cpp.
void shield_point_multi_setup | ( | ) |
Sets up the shield point hit information for multiplayer clients
Definition at line 817 of file shield.cpp.
Draw the whole shield as a wireframe mesh, not looking at the current integrity.
Definition at line 879 of file shield.cpp.
Returns true if the shield presents any opposition to something trying to force through it.
Definition at line 964 of file shield.cpp.
void visit_children | ( | int | trinum, |
int | vertex_index, | ||
matrix * | orient, | ||
shield_info * | shieldp, | ||
vec3d * | tcp, | ||
vec3d * | centerp, | ||
float | radius, | ||
vec3d * | rvec, | ||
vec3d * | uvec | ||
) |
Definition at line 521 of file shield.cpp.
int Break_value = -1 |
Definition at line 873 of file shield.cpp.
int Cmdline_nohtl |
Definition at line 438 of file cmdline.cpp.
int Gi_max = 0 |
Definition at line 531 of file shield.cpp.
gshield_tri Global_tris[MAX_SHIELD_TRI_BUFFER] |
Definition at line 80 of file shield.cpp.
int Num_multi_shield_points |
Definition at line 78 of file shield.cpp.
int Num_shield_points |
Definition at line 77 of file shield.cpp.
int Num_tris |
Definition at line 81 of file shield.cpp.
int Poly_count = 0 |
Definition at line 161 of file shield.cpp.
int Shield_bitmaps_loaded = 0 |
Definition at line 85 of file shield.cpp.
shield_hit Shield_hits[MAX_SHIELD_HITS] |
Definition at line 83 of file shield.cpp.
shield_point Shield_points[MAX_SHIELD_POINTS] |
Definition at line 76 of file shield.cpp.
float Shield_scale = SHIELD_HIT_SCALE |
Definition at line 41 of file shield.cpp.
int Show_shield_mesh = 0 |
Definition at line 27 of file shield.cpp.