Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <mesh.h>
Public Member Functions | |
void | initTechnique (const string &technique) |
TechniquePtr | getTechnique () const |
void | setTechnique (TechniquePtr tech) |
bool | LoadExistant (Mesh *mesh) |
Loads a mesh that has been found in the hash table into this mesh (copying original data) More... | |
bool | LoadExistant (const string filehash, const Vector &scale, int faction) |
Mesh () | |
Mesh (const Mesh &m) | |
GFXVertexList * | getVertexList () const |
void | setVertexList (GFXVertexList *_vlist) |
float | getFramesPerSecond () const |
float | getCurrentFrame () const |
void | setCurrentFrame (float) |
int | getNumAnimationFrames (const string &which=string()) const |
int | getNumLOD () const |
int | getNumTextureFrames () const |
float | getTextureFramesPerSecond () const |
double | getTextureCumulativeTime () const |
void | setTextureCumulativeTime (double) |
bool | getConvex () const |
void | setConvex (bool b) |
virtual int | MeshType () const |
BLENDFUNC | getBlendSrc () const |
BLENDFUNC | getBlendDst () const |
void | Fork (Mesh *&one, Mesh *&two, float a, float b, float c, float d) |
Forks the mesh across the plane a,b,c,d into two separate meshes...upon which this may be deleted. More... | |
virtual | ~Mesh () |
Destructor... kills orig if refcount of orig becomes zero. More... | |
unsigned int | numFX () const |
Gets number of specialFX. More... | |
void | EnableSpecialFX () |
Turns on SpecialFX. More... | |
unsigned int | numTextures () const |
Texture * | texture (int i) const |
void | SetBlendMode (BLENDFUNC src, BLENDFUNC dst, bool lodcascade=false) |
void | GetPolys (vector< mesh_polygon > &) |
Gets all polygons in this mesh for collision computation. More... | |
void | SetMaterial (const GFXMaterial &mat) |
Sets the material of this mesh to mat (affects original as well) More... | |
const GFXMaterial & | GetMaterial () const |
GFXBOOL | HasBeenDrawn () const |
If it has already been drawn this frame. More... | |
void | UnDraw () |
so one can query if it has or not been drawn More... | |
Vector const & | Position () const |
Returns center of this mesh. More... | |
void | Draw (float lod, const Matrix &m=identity_matrix, float toofar=1, int cloak=-1, float nebdist=0, unsigned char damage=0, bool renormalize_normals=false, const MeshFX *mfx=NULL) |
Draws lod pixel wide mesh at Transformation LATER. More... | |
void | DrawNow (float lod, bool centered, const Matrix &m=identity_matrix, int cloak=-1, float nebdist=0) |
Draws lod pixels wide, mesh at Transformation NOW. If centered, then will center on camera and disable cull. More... | |
virtual void | ProcessDrawQueue (size_t whichpass, int whichdrawqueue, bool zsort, const QVector &sortctr) |
Will draw all undrawn meshes of this type. More... | |
virtual void | SelectCullFace (int whichdrawqueue) |
Will draw all undrawn far meshes beyond the range of zbuffer (better be convex). More... | |
virtual void | RestoreCullFace (int whichdrawqueue) |
void | forceCullFace (GFXBOOL newValue) |
Sets whether or not this unit should be environment mapped. More... | |
GFXBOOL | getCullFaceForcedOn () const |
GFXBOOL | getCullFaceForcedOff () const |
void | setEnvMap (GFXBOOL newValue, bool lodcascade=false) |
GFXBOOL | getEnvMap () const |
void | setLighting (GFXBOOL newValue, bool lodcascade=false) |
GFXBOOL | getLighting () const |
Vector | corner_min () |
Returns bounding box values. More... | |
Vector | corner_max () |
BoundingBox * | getBoundingBox () |
Returns a physical boudning box in 3space instead of in current unit space. More... | |
bool | queryBoundingBox (const QVector &start, const float err) const |
queries this bounding box with a vector and radius More... | |
bool | queryBoundingBox (const QVector &start, const QVector &end, const float err) const |
Queries bounding box with a ray. More... | |
float | rSize () const |
returns the radial size of this More... | |
virtual float | clipRadialSize () const |
void | UpdateFX (float ttime) |
based on TTL, etc, updates shield effects More... | |
void | AddDamageFX (const Vector &LocalPos, const Vector &LocalNorm, const float percentage, const GFXColor &color=GFXColor(1, 1, 1, 1)) |
Adds a new damage effect with age damage to the part of the unit. Color specifies the shield oclor. More... | |
void | setVirtualBoundingBox (const Vector &mn, const Vector &mx, float rsize) |
Static Public Member Functions | |
static Mesh * | LoadMesh (const char *filename, const Vector &scalex, int faction, class Flightgroup *fg, const std::vector< std::string > &textureOverride=std::vector< std::string >()) |
Loading a mesh from an XML file. faction specifies the logos. Orig is for internal (LOD) use only! More... | |
static vector< Mesh * > | LoadMeshes (const char *filename, const Vector &scalex, int faction, class Flightgroup *fg, const std::vector< std::string > &textureOverride=std::vector< std::string >()) |
static vector< Mesh * > | LoadMeshes (VSFileSystem::VSFile &f, const Vector &scalex, int faction, class Flightgroup *fg, std::string hash_name, const std::vector< std::string > &textureOverride=std::vector< std::string >()) |
static void | ProcessZFarMeshes (bool nocamerasetup=false) |
static void | ProcessUndrawnMeshes (bool pushSpecialEffects=false, bool nocamerasetup=false) |
Will draw all undrawn meshes in total If pushSpclFX, the last series of meshes will be drawn with other lighting off. More... | |
Protected Member Functions | |
void | PostProcessLoading (struct MeshXML *xml, const vector< string > &overrideTexture) |
Mesh (std::string filename, const Vector &scalex, int faction, class Flightgroup *fg, bool orig=false) | |
void | InitUnit () |
Setting all values to defaults (good for mesh copying and stuff) More... | |
Mesh * | getLOD (float lod, bool bBypassDamping=true) |
Returing the mesh relevant to "size" pixels LOD of this mesh. More... | |
Protected Attributes | |
Vector | local_pos |
the position of the center of this mesh for collision detection More... | |
int | refcount |
The refcount:: how many meshes are referencing the appropriate original. More... | |
Vector | mx |
bounding box More... | |
Vector | mn |
float | radialSize |
The radial size of this mesh. More... | |
int | numlods |
num lods contained in the array of Mesh "orig" More... | |
float | framespersecond |
Mesh * | orig |
float | lodsize |
The size that this LOD (if original) comes into effect. More... | |
Logo * | forcelogos |
The number of force logos on this mesh (original) More... | |
int | numforcelogo |
Logo * | squadlogos |
The number of squad logos on this mesh (original) More... | |
int | numsquadlogo |
GFXVertexList * | vlist |
tri,quad,line, strips, etc More... | |
unsigned int | myMatNum |
The number of the appropriate material for this mesh (default 0) More... | |
TechniquePtr | technique |
The technique used to render this mesh. More... | |
vector< Texture * > | Decal |
The decal relevant to this mesh. More... | |
Texture * | detailTexture |
vector< Vector > | detailPlanes |
float | polygon_offset |
char | envMapAndLit |
whether this should be environment mapped 0x1 and 0x2 for if it should be lit (ored together) More... | |
GFXBOOL | will_be_drawn |
Whether this original will be drawn this frame. More... | |
bool | convex |
The blend functions. More... | |
unsigned char | alphatest |
enum BLENDFUNC | blendSrc |
enum BLENDFUNC | blendDst |
vector< MeshDrawContext > * | draw_queue |
Support for reorganized rendering. More... | |
int | draw_sequence |
How transparent this mesh is (in what order should it be rendered in. More... | |
string | hash_name |
The name of this unit. More... | |
vector< MeshFX > | LocalFX |
The enabled light effects on this mesh. More... | |
Static Protected Attributes | |
static Hashtable< std::string, Mesh, MESH_HASTHABLE_SIZE > | meshHashTable |
The hash table of all meshes. More... | |
static Hashtable< std::string, std::vector< int > , MESH_HASTHABLE_SIZE > | animationSequences |
Friends | |
class | OrigMeshContainer |
Needs to have access to our class. More... | |
Mesh is the basic textured drawable Mesh has 1 texture and 1 vertex list (with possibly multiple primitives inside Meshes have a center-location but do not need to be translated to be drawn Meshes store various LOD's and originals in the orig pointer. These may be accessed in order to draw quickly a whole series of meshes. Unless DrawNow is invoked, Drawing only stores the mesh on teh appropriate draw queue so they may be drawn at a later date Also meshe contain Logos, flags based on squadron and faction that may be user-edited and appear in pleasing places on the hull.
|
protected |
Definition at line 173 of file mesh.cpp.
References convex, Hashtable< KEY, VALUE, SIZ >::Delete(), StarSystemGent::faction, fprintf, Hashtable< KEY, VALUE, SIZ >::Get(), LoadExistant(), LoadMesh(), meshHashTable, orig, and refcount.
Mesh::Mesh | ( | ) |
Definition at line 109 of file mesh.cpp.
References InitUnit().
Referenced by Fork(), and LoadMeshes().
Mesh::Mesh | ( | const Mesh & | m) |
Definition at line 139 of file mesh.cpp.
References fprintf, Hashtable< KEY, VALUE, SIZ >::Get(), hash_name, i, InitUnit(), LoadExistant(), meshHashTable, and orig.
|
virtual |
Destructor... kills orig if refcount of orig becomes zero.
Definition at line 359 of file mesh_gfx.cpp.
References Decal, Hashtable< KEY, VALUE, SIZ >::Delete(), draw_queue, forcelogos, Hashtable< KEY, VALUE, SIZ >::Get(), hash_name, i, j, meshHashTable, NUM_MESH_SEQUENCE, orig, refcount, squadlogos, undrawn_meshes, vlist, and VSFileSystem::vs_fprintf().
void Mesh::AddDamageFX | ( | const Vector & | LocalPos, |
const Vector & | LocalNorm, | ||
const float | percentage, | ||
const GFXColor & | color = GFXColor( 1, 1, 1, 1 ) |
||
) |
Adds a new damage effect with age damage to the part of the unit. Color specifies the shield oclor.
Definition at line 85 of file mesh_fx.cpp.
References GFXColor::a, GFXColor::b, endpotency, flickertime, GFXColor::g, LocalFX, MAXLOCALFX, mindamage, GFXColor::r, rSize(), startpotency, and Vector.
|
inlinevirtual |
|
inline |
Definition at line 390 of file mesh.h.
References mx.
Referenced by Planet::AddSpaceElevator(), ContinuousTerrain::AdjustTerrain(), Box::Box(), ContinuousTerrain::Collide(), ContinuousTerrain::ContinuousTerrain(), and Box::ProcessDrawQueue().
|
inline |
Returns bounding box values.
Definition at line 386 of file mesh.h.
References mn.
Referenced by Planet::AddSpaceElevator(), ContinuousTerrain::AdjustTerrain(), Box::Box(), ContinuousTerrain::Collide(), ContinuousTerrain::ContinuousTerrain(), and Box::ProcessDrawQueue().
void Mesh::Draw | ( | float | lod, |
const Matrix & | m = identity_matrix , |
||
float | toofar = 1 , |
||
int | cloak = -1 , |
||
float | nebdist = 0 , |
||
unsigned char | damage = 0 , |
||
bool | renormalize_normals = false , |
||
const MeshFX * | mfx = NULL |
||
) |
Draws lod pixel wide mesh at Transformation LATER.
all else == defaults, only ambient
Definition at line 406 of file mesh_gfx.cpp.
References GFXColor::a, GFXColor::b, c, MeshDrawContext::CLOAK, MeshDrawContext::cloaked, MeshDrawContext::CloakFX, MeshDrawContext::damage, draw_queue, draw_sequence, float, MeshDrawContext::FOG, GFXColor::g, g_game, GetElapsedTime(), getLOD(), MeshDrawContext::GLASSCLOAK, LocalFX, MeshDrawContext::mesh_seq, MESH_SPECIAL_FX_ONLY, MeshDrawContext::NEARINVIS, MeshDrawContext::NONE, NUM_ZBUF_SEQ, OrigMeshContainer, GFXColor::r, MeshDrawContext::RENORMALIZE, rSize(), MeshDrawContext::SpecialFX, technique, undrawn_meshes, UpdateFX(), MeshDrawContext::useXtraFX, will_be_drawn, MeshDrawContext::xtraFX, and game_data_t::zfar.
Referenced by ContinuousTerrain::Draw(), WarpTrail::Draw(), HaloSystem::Draw(), SphereMesh::Draw(), GameUnit< UnitType >::Draw(), NavigationSystem::Draw(), and GameUnit< UnitType >::DrawNow().
void Mesh::DrawNow | ( | float | lod, |
bool | centered, | ||
const Matrix & | m = identity_matrix , |
||
int | cloak = -1 , |
||
float | nebdist = 0 |
||
) |
Draws lod pixels wide, mesh at Transformation NOW. If centered, then will center on camera and disable cull.
Definition at line 463 of file mesh_gfx.cpp.
References _Universe, Universe::AccessCamera(), blendDst, blendSrc, Decal, DEPTHWRITE, draw_sequence, GFXVertexList::DrawOnce(), FOG_OFF, getLOD(), Camera::GetNebula(), GFXADDTEXTURE, GFXBlendMode(), GFXCenterCamera(), GFXCreateLight(), GFXDeleteLight(), GFXDisable(), GFXEnable(), GFXFogMode(), GFXLoadIdentity(), GFXLoadMatrixModel(), GFXMODULATETEXTURE, GFXPickLights(), GFXSelectMaterial(), GFXTextureEnv(), GFXToggleTexture(), i, LocalFX, MESH_SPECIAL_FX_ONLY, MODEL, myMatNum, Matrix::p, rSize(), Nebula::SetFogState(), SRCALPHA, TEXTURE1, Vector, vlist, and ZERO.
Referenced by Background::Draw(), and Atmosphere::Draw().
void Mesh::EnableSpecialFX | ( | ) |
Turns on SpecialFX.
Definition at line 118 of file mesh_fx.cpp.
References blendDst, blendSrc, draw_sequence, GFXFALSE, GFXTRUE, MESH_SPECIAL_FX_ONLY, ONE, orig, setEnvMap(), and setLighting().
|
inline |
Sets whether or not this unit should be environment mapped.
Definition at line 350 of file mesh.h.
References envMapAndLit.
Referenced by Fork(), and LoadMeshes().
Forks the mesh across the plane a,b,c,d into two separate meshes...upon which this may be deleted.
Definition at line 25 of file mesh_poly.cpp.
References blendDst, blendSrc, Decal, draw_queue, forceCullFace(), forcelogos, Fork(), getEnvMap(), getLighting(), GFXVertexList::GetPolys(), GFXFALSE, GFXQUAD, GFXTRI, i, j, local_pos, Magnitude(), VsnetOSS::memcpy(), Mesh(), mn, mx, NUM_ZBUF_SEQ, numforcelogo, numsquadlogo, orig, PFRONT, radialSize, refcount, setEnvMap(), setLighting(), squadlogos, updateMax(), Vector, vlist, whichside(), x, AiXml::X, y, and AiXml::Y.
Referenced by Fork().
|
inline |
|
inline |
BoundingBox* Mesh::getBoundingBox | ( | ) |
Returns a physical boudning box in 3space instead of in current unit space.
|
inline |
|
inline |
Definition at line 359 of file mesh.h.
References envMapAndLit.
Referenced by RestoreCullFace(), and SelectCullFace().
|
inline |
float Mesh::getCurrentFrame | ( | ) | const |
|
inline |
Definition at line 370 of file mesh.h.
References envMapAndLit.
Referenced by Fork(), and initTechnique().
float Mesh::getFramesPerSecond | ( | ) | const |
Definition at line 298 of file mesh.cpp.
References framespersecond.
Referenced by Mount::ComputeAnimatedFrame(), and getLOD().
|
inline |
Returing the mesh relevant to "size" pixels LOD of this mesh.
Definition at line 303 of file mesh.cpp.
References animationSequences, float_to_int(), Hashtable< KEY, VALUE, SIZ >::Get(), getCurrentFrame(), GetElapsedTime(), getFramesPerSecond(), getNumLOD(), VegaConfig::getVariable(), hash_name, i, int, LOD_HYSTHERESIS_DIVIDER, LOD_HYSTHERESIS_MAXENLARGEMENT_FACTOR, lodsize, numlods, XMLSupport::parse_float(), setCurrentFrame(), and vs_config.
Referenced by Draw(), and DrawNow().
const GFXMaterial & Mesh::GetMaterial | ( | ) | const |
Definition at line 548 of file mesh_gfx.cpp.
References GFXGetMaterial(), and myMatNum.
int Mesh::getNumAnimationFrames | ( | const string & | which = string() ) | const |
Definition at line 57 of file mesh.cpp.
References animationSequences, Hashtable< KEY, VALUE, SIZ >::Get(), and hash_name.
int Mesh::getNumLOD | ( | ) | const |
int Mesh::getNumTextureFrames | ( | ) | const |
void Mesh::GetPolys | ( | vector< mesh_polygon > & | polys) |
Gets all polygons in this mesh for collision computation.
Definition at line 171 of file mesh_poly.cpp.
References GetPolys(), GFXVertexList::GetPolys(), i, j, orig, Vector, vlist, GFXVertex::x, GFXVertex::y, and GFXVertex::z.
Referenced by ContinuousTerrain::ContinuousTerrain(), GetPolys(), and Unit::LoadRow().
|
inline |
double Mesh::getTextureCumulativeTime | ( | ) | const |
float Mesh::getTextureFramesPerSecond | ( | ) | const |
GFXVertexList * Mesh::getVertexList | ( | ) | const |
|
inline |
If it has already been drawn this frame.
Definition at line 316 of file mesh.h.
References will_be_drawn.
void Mesh::initTechnique | ( | const string & | technique) |
Definition at line 1867 of file mesh_gfx.cpp.
References Decal, getEnvMap(), Technique::getTechnique(), VegaConfig::getVariable(), technique, and vs_config.
Referenced by SphereMesh::InitSphere(), and InitUnit().
|
protected |
Setting all values to defaults (good for mesh copying and stuff)
Definition at line 69 of file mesh.cpp.
References alphatest, blendDst, blendSrc, convex, Decal, detailTexture, draw_queue, draw_sequence, envMapAndLit, forcelogos, framespersecond, GFXFALSE, GFXTRUE, initTechnique(), local_pos, lodsize, mn, mx, myMatNum, numforcelogo, numlods, numsquadlogo, ONE, orig, polygon_offset, radialSize, refcount, setEnvMap(), setLighting(), squadlogos, Vector, vlist, will_be_drawn, and ZERO.
Referenced by Box::Box(), and Mesh().
Loads a mesh that has been found in the hash table into this mesh (copying original data)
Definition at line 114 of file mesh.cpp.
References orig, and refcount.
Referenced by SphereMesh::InitSphere(), LoadExistant(), LoadMeshes(), and Mesh().
Definition at line 122 of file mesh.cpp.
References Hashtable< KEY, VALUE, SIZ >::Get(), VSFileSystem::GetHashName(), VSFileSystem::GetSharedMeshHashName(), hash_name, LoadExistant(), and meshHashTable.
|
static |
Loading a mesh from an XML file. faction specifies the logos. Orig is for internal (LOD) use only!
Definition at line 1239 of file mesh_xml.cpp.
References fprintf.
Referenced by HaloSystem::AddHalo(), addRapidMesh(), addShieldMesh(), Planet::AddSpaceElevator(), ContinuousTerrain::ContinuousTerrain(), getTemplate(), GetWarpMesh(), MeshAnimation::Init(), MakeFogMesh(), Mesh(), and NavigationSystem::ParseFile().
|
static |
Definition at line 1257 of file mesh_xml.cpp.
References bfxmHashTable, VSFileSystem::VSFile::Close(), f, VSFileSystem::GetHashName(), VSFileSystem::GetSharedMeshHashName(), VSFileSystem::VSFile::GoTo(), LoadExistant(), VSFileSystem::MeshFile, VSFileSystem::Ok, VSFileSystem::VSFile::OpenReadOnly(), orig, VSFileSystem::VSFile::Read(), VSFileSystem::Shared, and VSFileSystem::vs_fprintf().
Referenced by pushMesh().
|
static |
Definition at line 296 of file mesh_bxm.cpp.
References GFXMaterial::aa, GFXMaterial::ab, GFXMaterial::ag, ALPHAMAP, alphatest, ANIMATION, animationSequences, GFXMaterial::ar, BEGINSTATE, bxmfopen, bxmfprintf, char8bit, VSFileSystem::VSFile::Close(), GFXMaterial::da, GFXMaterial::db, Decal, MeshXML::decals, detailPlanes, detailTexture, GFXMaterial::dg, DOVERTEX, GFXMaterial::dr, draw_queue, GFXMaterial::ea, GFXMaterial::eb, GFXMaterial::eg, ENDSTATE, GFXMaterial::er, error, MeshXML::faction, StarSystemGent::faction, fcloseInput(), MeshXML::fg, float32bit, MeshXML::force_texture, forceCullFace(), fprintf, framespersecond, FactionUtil::GetFaction(), VSFileSystem::VSFile::GetFilename(), VegaConfig::getVariable(), GFXTRUE, i, index, int, int32bit, inverseblend, j, k, MeshXML::lineind, MeshXML::lines, MeshXML::linestripind, MeshXML::linestrips, MeshXML::LOD, MeshXML::lodscale, MeshXML::logos, MeshXML::material, Mesh(), myMatNum, NUM_ZBUF_SEQ, MeshXML::ZeLogo::offset, XMLSupport::parse_bool(), polygon_offset, PostProcessLoading(), power, GFXMaterial::power, Hashtable< KEY, VALUE, SIZ >::Put(), MeshXML::quadind, MeshXML::quads, MeshXML::quadstripind, MeshXML::quadstrips, VSFileSystem::VSFile::Read(), READSTRING, MeshXML::reverse, reverse_vector(), MeshXML::ZeLogo::rotate, GFXMaterial::sa, GFXMaterial::sb, MeshXML::scale, SetBlendMode(), setEnvMap(), setLighting(), GFXMaterial::sg, MeshXML::sharevert, size, MeshXML::ZeLogo::size, VSFileSystem::VSFile::Size(), UniverseUtil::sqrt(), GFXMaterial::sr, t1(), TECHNIQUE, MeshXML::technique, TEXTURE, MeshXML::trifans, MeshXML::triind, MeshXML::tris, MeshXML::tristripind, MeshXML::tristrips, MeshXML::ZeLogo::type, MeshXML::usenormals, Vector, vert, MeshXML::vertexcount, MeshXML::vertices, vlist, vs_config, VSSwapHostFloatToLittle(), VSSwapHostIntToLittle(), Mesh_vec3f::x, x, Mesh_vec3f::y, y, Mesh_vec3f::z, and z.
|
inlinevirtual |
|
inline |
|
inline |
|
inline |
|
protected |
Definition at line 1696 of file mesh_xml.cpp.
References a, ClearTangents(), MeshXML::decals, MeshXML::faction, MeshXML::fg, FLAT_SHADE, FactionUtil::GetFaction(), VegaConfig::getVariable(), GFXLINE, GFXLINESTRIP, GFXOptimizeList(), GFXQUAD, GFXQUADSTRIP, GFXSetMaterial(), GFXTRI, GFXTRIFAN, GFXTRISTRIP, GFXVertex::i, index, GFXVertex::j, j, GFXVertex::k, k, MeshXML::lineind, MeshXML::lines, MeshXML::linestripind, MeshXML::linestrips, Magnitude(), MeshXML::material, NormalizeNormals(), NormalizeTangents(), XMLSupport::parse_bool(), XMLSupport::parse_float(), MeshXML::quadind, MeshXML::quads, MeshXML::quadshade, MeshXML::quadstripind, MeshXML::quadstrips, MeshXML::scale, MeshXML::sharevert, SumNormals(), SumTangents(), MeshXML::technique, MeshXML::trifanind, MeshXML::trifans, MeshXML::triind, MeshXML::tris, MeshXML::trishade, MeshXML::tristripind, MeshXML::tristrips, updateMax(), MeshXML::usenormals, MeshXML::usetangents, v, Vector, MeshXML::vertices, vs_config, and z.
Referenced by LoadMeshes().
|
virtual |
Will draw all undrawn meshes of this type.
Definition at line 957 of file mesh_gfx.cpp.
References GFXToggleTexture(), gl_options, i, gl_options_t::Multitexture, Technique::Pass::ShaderPass, technique, and Technique::Pass::type.
Referenced by SphereMesh::ProcessDrawQueue(), CityLights::ProcessDrawQueue(), ProcessUndrawnMeshes(), and ProcessZFarMeshes().
|
static |
Will draw all undrawn meshes in total If pushSpclFX, the last series of meshes will be drawn with other lighting off.
Definition at line 561 of file mesh_gfx.cpp.
References _Universe, a, Universe::AccessCamera(), DEPTHWRITE, draw_queue, gl_options_t::ext_srgb_framebuffer, g_game, Camera::GetPosition(), GFXClear(), GFXDeactivateShader(), GFXDisable(), GFXEnable(), GFXFALSE, GFXPopGlobalEffects(), GFXPushGlobalEffects(), GFXTRUE, GL_FRAMEBUFFER_SRGB_EXT, gl_options, MESH_SPECIAL_FX_ONLY, NUM_ZBUF_SEQ, orig, Logo::ProcessDrawQueue(), ProcessDrawQueue(), undrawn_logos, undrawn_meshes, Camera::UpdateGFXFrustum(), Logo::will_be_drawn, will_be_drawn, game_data_t::zfar, and game_data_t::znear.
Referenced by GameStarSystem::Draw(), GameCockpit::Draw(), NavigationSystem::Draw(), GameUnit< UnitType >::DrawNow(), and Briefing::Render().
|
static |
Definition at line 519 of file mesh_gfx.cpp.
References _Universe, a, Universe::AccessCamera(), draw_queue, gl_options_t::ext_srgb_framebuffer, g_game, Camera::GetPosition(), VegaConfig::getVariable(), GFXClear(), GFXDeactivateShader(), GFXFALSE, GFXTRUE, GL_FRAMEBUFFER_SRGB_EXT, gl_options, NUM_ZBUF_SEQ, orig, XMLSupport::parse_float(), ProcessDrawQueue(), Animation::ProcessFarDrawQueue(), undrawn_meshes, Camera::UpdateGFXFrustum(), vs_config, will_be_drawn, and game_data_t::zfar.
Referenced by GameStarSystem::Draw(), GameCockpit::Draw(), NavigationSystem::Draw(), and GameUnit< UnitType >::DrawNow().
queries this bounding box with a vector and radius
Queries bounding box with a ray.
|
virtual |
Reimplemented in SphereMesh.
Definition at line 603 of file mesh_gfx.cpp.
References blendDst, blendSrc, CULLFACE, getCullFaceForcedOff(), GFXEnable(), SRCALPHA, and ZERO.
|
inline |
returns the radial size of this
Definition at line 401 of file mesh.h.
References radialSize.
Referenced by AddDamageFX(), RingMesh::clipRadialSize(), HaloSystem::Draw(), GameUnit< UnitType >::Draw(), Draw(), GameUnit< UnitType >::DrawNow(), and DrawNow().
|
virtual |
Will draw all undrawn far meshes beyond the range of zbuffer (better be convex).
Reimplemented in SphereMesh.
Definition at line 610 of file mesh_gfx.cpp.
References blendDst, blendSrc, CULLFACE, getCullFaceForcedOff(), getCullFaceForcedOn(), GFXDisable(), GFXEnable(), SRCALPHA, and ZERO.
Definition at line 341 of file mesh.cpp.
References blendDst, blendSrc, draw_sequence, i, numlods, ONE, and ZERO.
Referenced by addShieldMesh(), SphereMesh::InitSphere(), and LoadMeshes().
void Mesh::setConvex | ( | bool | b) |
Definition at line 163 of file mesh.cpp.
References b, convex, orig, and setConvex().
Referenced by CityLights::CityLights(), SphereMesh::InitSphere(), MakeFogMesh(), setConvex(), and SphereMesh::SphereMesh().
void Mesh::setCurrentFrame | ( | float | which) |
Definition at line 278 of file mesh.cpp.
References framespersecond.
Referenced by GameUnit< UnitType >::Draw(), GameUnit< UnitType >::DrawNow(), and getLOD().
Definition at line 363 of file mesh.h.
References envMapAndLit, i, and numlods.
Referenced by addShieldMesh(), Box::Box(), EnableSpecialFX(), Fork(), SphereMesh::InitSphere(), InitUnit(), and LoadMeshes().
Definition at line 374 of file mesh.h.
References envMapAndLit, i, and numlods.
Referenced by addShieldMesh(), EnableSpecialFX(), Fork(), InitUnit(), and LoadMeshes().
void Mesh::SetMaterial | ( | const GFXMaterial & | mat) |
Sets the material of this mesh to mat (affects original as well)
Definition at line 265 of file mesh.cpp.
References GFXSetMaterial(), i, myMatNum, and numlods.
Referenced by Atmosphere::Draw(), and SetFogMaterialColor().
|
inline |
void Mesh::setTextureCumulativeTime | ( | double | d) |
void Mesh::setVertexList | ( | GFXVertexList * | _vlist) |
Definition at line 417 of file mesh.h.
References mn, mx, and radialSize.
Definition at line 304 of file mesh.h.
References Decal.
Referenced by Background::Cache(), and SphereMesh::InitSphere().
|
inline |
so one can query if it has or not been drawn
Definition at line 321 of file mesh.h.
References GFXFALSE, and will_be_drawn.
void Mesh::UpdateFX | ( | float | ttime) |
based on TTL, etc, updates shield effects
Definition at line 108 of file mesh_fx.cpp.
Referenced by Draw().
|
friend |
|
protected |
Definition at line 218 of file mesh.h.
Referenced by InitUnit(), and LoadMeshes().
Definition at line 181 of file mesh.h.
Referenced by getLOD(), getNumAnimationFrames(), and LoadMeshes().
|
protected |
Definition at line 220 of file mesh.h.
Referenced by Box::Box(), DrawNow(), EnableSpecialFX(), Fork(), getBlendDst(), InitUnit(), OrigMeshContainer::OrigMeshContainer(), RestoreCullFace(), SelectCullFace(), and SetBlendMode().
|
protected |
Definition at line 219 of file mesh.h.
Referenced by Box::Box(), DrawNow(), EnableSpecialFX(), Fork(), getBlendSrc(), InitUnit(), OrigMeshContainer::OrigMeshContainer(), RestoreCullFace(), SelectCullFace(), and SetBlendMode().
|
protected |
The blend functions.
Definition at line 217 of file mesh.h.
Referenced by getConvex(), InitUnit(), Mesh(), and setConvex().
|
protected |
The decal relevant to this mesh.
Definition at line 208 of file mesh.h.
Referenced by DrawNow(), Fork(), getNumTextureFrames(), getTextureCumulativeTime(), getTextureFramesPerSecond(), SphereMesh::InitSphere(), initTechnique(), InitUnit(), LoadMeshes(), numTextures(), OrigMeshContainer::operator<(), setTextureCumulativeTime(), texture(), and ~Mesh().
|
protected |
Definition at line 210 of file mesh.h.
Referenced by LoadMeshes().
|
protected |
Definition at line 209 of file mesh.h.
Referenced by InitUnit(), and LoadMeshes().
|
protected |
Support for reorganized rendering.
Definition at line 223 of file mesh.h.
Referenced by Box::Box(), Draw(), Fork(), SphereMesh::InitSphere(), InitUnit(), LoadMeshes(), Box::ProcessDrawQueue(), ProcessUndrawnMeshes(), ProcessZFarMeshes(), and ~Mesh().
|
protected |
How transparent this mesh is (in what order should it be rendered in.
Definition at line 225 of file mesh.h.
Referenced by Box::Box(), Draw(), DrawNow(), EnableSpecialFX(), SphereMesh::InitSphere(), InitUnit(), and SetBlendMode().
|
protected |
whether this should be environment mapped 0x1 and 0x2 for if it should be lit (ored together)
Definition at line 213 of file mesh.h.
Referenced by forceCullFace(), getCullFaceForcedOff(), getCullFaceForcedOn(), getEnvMap(), getLighting(), InitUnit(), setEnvMap(), and setLighting().
|
protected |
The number of force logos on this mesh (original)
Definition at line 196 of file mesh.h.
Referenced by Fork(), InitUnit(), and ~Mesh().
|
protected |
Definition at line 191 of file mesh.h.
Referenced by getCurrentFrame(), getFramesPerSecond(), InitUnit(), LoadMeshes(), and setCurrentFrame().
|
protected |
The name of this unit.
Definition at line 227 of file mesh.h.
Referenced by getLOD(), getNumAnimationFrames(), SphereMesh::InitSphere(), LoadExistant(), Mesh(), and ~Mesh().
|
protected |
the position of the center of this mesh for collision detection
Definition at line 178 of file mesh.h.
Referenced by Fork(), InitUnit(), and Position().
|
protected |
The enabled light effects on this mesh.
Definition at line 233 of file mesh.h.
Referenced by AddDamageFX(), Draw(), DrawNow(), numFX(), and UpdateFX().
|
protected |
The size that this LOD (if original) comes into effect.
Definition at line 194 of file mesh.h.
Referenced by getLOD(), SphereMesh::InitSphere(), and InitUnit().
The hash table of all meshes.
Definition at line 180 of file mesh.h.
Referenced by Box::Box(), SphereMesh::InitSphere(), LoadExistant(), Mesh(), and ~Mesh().
|
protected |
Definition at line 186 of file mesh.h.
Referenced by corner_min(), Fork(), SphereMesh::InitSphere(), InitUnit(), and setVirtualBoundingBox().
|
protected |
bounding box
Definition at line 185 of file mesh.h.
Referenced by corner_max(), Fork(), SphereMesh::InitSphere(), InitUnit(), and setVirtualBoundingBox().
|
protected |
The number of the appropriate material for this mesh (default 0)
Definition at line 204 of file mesh.h.
Referenced by DrawNow(), GetMaterial(), InitUnit(), LoadMeshes(), and SetMaterial().
|
protected |
Definition at line 197 of file mesh.h.
Referenced by Fork(), and InitUnit().
|
protected |
num lods contained in the array of Mesh "orig"
Definition at line 190 of file mesh.h.
Referenced by getLOD(), getNumLOD(), SphereMesh::InitSphere(), InitUnit(), SetBlendMode(), setEnvMap(), setLighting(), and SetMaterial().
|
protected |
Definition at line 200 of file mesh.h.
Referenced by Fork(), and InitUnit().
|
protected |
Definition at line 192 of file mesh.h.
Referenced by Box::Box(), EnableSpecialFX(), Fork(), GetPolys(), SphereMesh::InitSphere(), InitUnit(), LoadExistant(), LoadMeshes(), Mesh(), ProcessUndrawnMeshes(), ProcessZFarMeshes(), setConvex(), and ~Mesh().
|
protected |
Definition at line 211 of file mesh.h.
Referenced by InitUnit(), and LoadMeshes().
|
protected |
The radial size of this mesh.
Definition at line 188 of file mesh.h.
Referenced by clipRadialSize(), Fork(), SphereMesh::InitSphere(), InitUnit(), rSize(), and setVirtualBoundingBox().
|
protected |
The refcount:: how many meshes are referencing the appropriate original.
Definition at line 183 of file mesh.h.
Referenced by Box::Box(), Fork(), SphereMesh::InitSphere(), Texture::InitTexture(), InitUnit(), LoadExistant(), Mesh(), and ~Mesh().
|
protected |
The number of squad logos on this mesh (original)
Definition at line 199 of file mesh.h.
Referenced by Fork(), InitUnit(), and ~Mesh().
|
protected |
The technique used to render this mesh.
Definition at line 206 of file mesh.h.
Referenced by Draw(), getTechnique(), initTechnique(), OrigMeshContainer::operator<(), OrigMeshContainer::OrigMeshContainer(), and ProcessDrawQueue().
|
protected |
tri,quad,line, strips, etc
Definition at line 202 of file mesh.h.
Referenced by Box::Box(), DrawNow(), Fork(), GetPolys(), getVertexList(), SphereMesh::InitSphere(), InitUnit(), LoadMeshes(), setVertexList(), and ~Mesh().
|
protected |
Whether this original will be drawn this frame.
Definition at line 215 of file mesh.h.
Referenced by Draw(), HasBeenDrawn(), InitUnit(), ProcessUndrawnMeshes(), ProcessZFarMeshes(), and UnDraw().