Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include "gfxlib.h"
#include "gfx/matrix.h"
#include "gl_matrix.h"
#include "lin_time.h"
#include <stdio.h>
Go to the source code of this file.
Functions | |
float | GFXSphereInFrustum (const QVector &Cnt, float radius) |
checks if a sphere is in the currently loaded Frustum given its center and radius More... | |
CLIPSTATE | GFXBoxInFrustum (const Vector &min, const Vector &max) |
CLIPSTATE | GFXTransformedBoxInFrustum (const Vector &min, const Vector &max) |
CLIPSTATE | GFXSpherePartiallyInFrustum (const Vector &Cnt, float radius) |
CLIPSTATE | GFXTransformedSpherePartiallyInFrustum (const Vector &Cnt, float radius) |
CLIPSTATE | GFXSpherePartiallyInFrustum (double f[6][4], const Vector &Cnt, const float radius) |
CLIPSTATE | GFXBoxInFrustum (double f[6][4], const Vector &min, const Vector &max) |
void | DrawFrustum (double f[6][4]) |
float | GFXSphereInFrustum (double f[6][4], const QVector &Cnt, float radius) |
Checks if a sphere is in the given frustum calculated by GFXCalculateFrustum. Used in Unit clipping. More... | |
void | GFXGetFrustumVars (bool retr, float *l, float *r, float *b, float *t, float *n, float *f) |
Saves and restores last used left,right,bot,top,near,far vals (internal use) More... | |
void | GFXGetFrustum (double f[6][4]) |
Gets the 6 clip planes of the current Projection matrix. More... | |
void | GFXBoxInFrustumModel (const Matrix &model) |
void | GFXCalculateFrustum () |
Calculates frustum matrix (internal use) More... | |
void | WackyMultFloatMatrix (double dest[], const float m1[], const Matrix &m2) |
void | GFXCalculateFrustum (double frustum[6][4], const Matrix &modl, const float *proj) |
Calculates the planes for a given frustum in 3space given a matrix and a projection. More... | |
float | GFXGetZPerspective (const float z) |
Given the current projection matrix, how much will the model be divided by. More... | |
Variables | |
double | BoxFrust [6][4] |
double | frust [6][4] |
void DrawFrustum | ( | double | f[6][4]) |
Definition at line 87 of file gl_clip.cpp.
References a, b, c, d, DEPTHTEST, DEPTHWRITE, GFXBegin(), GFXBlendMode(), GFXColorf(), GFXDisable(), GFXEnable(), GFXEnd(), GFXQUAD, GFXVertexf(), i, LIGHTING, ONE, q, TEXTURE0, TEXTURE1, and Vector.
Definition at line 14 of file gl_clip.cpp.
References BoxFrust, and GFXBoxInFrustum().
Referenced by IdentityTransform::BoxInFrustum(), GFXBoxInFrustum(), and GFXTransformedBoxInFrustum().
Definition at line 48 of file gl_clip.cpp.
References GFX_NOT_VISIBLE, GFX_PARTIALLY_VISIBLE, GFX_TOTALLY_VISIBLE, i, j, v, and Vector.
void GFXBoxInFrustumModel | ( | const Matrix & | model) |
Definition at line 187 of file gl_clip.cpp.
References BoxFrust, GFXCalculateFrustum(), MultMatrix(), GFXMatrices::projection, and GFXMatrices::view.
Referenced by QuadTree::Render().
void GFXCalculateFrustum | ( | ) |
Calculates frustum matrix (internal use)
Definition at line 193 of file gl_clip.cpp.
References frust, GFXCalculateFrustum(), GFXMatrices::projection, and GFXMatrices::view.
Calculates the planes for a given frustum in 3space given a matrix and a projection.
Definition at line 223 of file gl_clip.cpp.
References UniverseUtil::sqrt(), and WackyMultFloatMatrix().
void GFXGetFrustum | ( | double | f[6][4]) |
Gets the 6 clip planes of the current Projection matrix.
Definition at line 183 of file gl_clip.cpp.
References frust.
void GFXGetFrustumVars | ( | bool | retr, |
float * | l, | ||
float * | r, | ||
float * | b, | ||
float * | t, | ||
float * | n, | ||
float * | f | ||
) |
Saves and restores last used left,right,bot,top,near,far vals (internal use)
Definition at line 162 of file gl_clip.cpp.
References b.
Given the current projection matrix, how much will the model be divided by.
GFXGetZPerspective () returns the relative scale of an object placed at distance z from the camera with the current projection matrix.
Definition at line 311 of file gl_clip.cpp.
References a, and GFXGetFrustumVars().
checks if a sphere is in the currently loaded Frustum given its center and radius
Definition at line 10 of file gl_clip.cpp.
References frust, and GFXSphereInFrustum().
Referenced by ContinuousTerrain::Draw(), GameUnit< UnitType >::Draw(), GameUnit< UnitType >::DrawNow(), GFXSphereInFrustum(), and GameUnit< UnitType >::queryFrustum().
Checks if a sphere is in the given frustum calculated by GFXCalculateFrustum. Used in Unit clipping.
Definition at line 140 of file gl_clip.cpp.
References d.
Definition at line 23 of file gl_clip.cpp.
References BoxFrust, and GFXSpherePartiallyInFrustum().
Referenced by SphericalTransform::BoxInFrustum(), GFXSpherePartiallyInFrustum(), and GFXTransformedSpherePartiallyInFrustum().
Definition at line 32 of file gl_clip.cpp.
References d, GFX_NOT_VISIBLE, GFX_PARTIALLY_VISIBLE, and GFX_TOTALLY_VISIBLE.
Definition at line 18 of file gl_clip.cpp.
References frust, and GFXBoxInFrustum().
Definition at line 27 of file gl_clip.cpp.
References frust, and GFXSpherePartiallyInFrustum().
Definition at line 197 of file gl_clip.cpp.
References InvTransformNormal(), Matrix::p, QVector, Matrix::r, and TransformNormal().
Referenced by GFXCalculateFrustum().
double BoxFrust[6][4] |
Definition at line 7 of file gl_clip.cpp.
Referenced by GFXBoxInFrustum(), GFXBoxInFrustumModel(), and GFXSpherePartiallyInFrustum().
double frust[6][4] |
Definition at line 8 of file gl_clip.cpp.
Referenced by GFXCalculateFrustum(), GFXGetFrustum(), GFXSphereInFrustum(), GFXTransformedBoxInFrustum(), and GFXTransformedSpherePartiallyInFrustum().