29 #include "../idlib/precompiled.h"
52 local = in - surface->
origin;
55 for ( i = 0 ; i < 3 ; i++ ) {
56 d = local * surface->
axis[
i];
57 transformed += d * camera->
axis[
i];
60 out = transformed + camera->
origin;
73 for ( i = 0 ; i < 3 ; i++ ) {
74 d = in * surface->
axis[
i];
75 out += d * camera->
axis[
i];
114 unsigned int pointOr;
115 unsigned int pointAnd;
122 pointAnd = (
unsigned int)~0;
127 for ( i = 0; i < tri->
numVerts; i++ ) {
129 unsigned int pointFlags;
135 for ( j = 0; j < 3; j++ ) {
136 if ( clip[j] >= clip[3] ) {
137 pointFlags |= (1 << (j*2));
138 }
else if ( clip[j] <= -clip[3] ) {
139 pointFlags |= ( 1 << (j*2+1));
143 pointAnd &= pointFlags;
144 pointOr |= pointFlags;
174 normal = d2.
Cross( d1 );
176 dir = v1 - localView;
189 w[0].s = w[0].t = w[1].s = w[1].t = w[2].s = w[2].t = 0.0f;
191 for ( j = 0; j < 4; j++ ) {
231 R_PlaneForSurface( drawSurf->
geo, originalPlane );
236 surface.
axis[0].NormalVectors( surface.
axis[1], surface.
axis[2] );
253 viewOrigin += ( originalPlane.
Normal() * 16 );
360 parms = R_MirrorViewBySurface( surf );
410 parms = R_XrayViewBySurface( surf );
484 scissor.
x1 = v->
x1 + (
int)( (v->
x2 - v->
x1 + 1 ) * 0.5f * ( ndcBounds[0][0] + 1.0f ));
485 scissor.
y1 = v->
y1 + (
int)( (v->
y2 - v->
y1 + 1 ) * 0.5f * ( ndcBounds[0][1] + 1.0f ));
486 scissor.
x2 = v->
x1 + (
int)( (v->
x2 - v->
x1 + 1 ) * 0.5f * ( ndcBounds[1][0] + 1.0f ));
487 scissor.
y2 = v->
y1 + (
int)( (v->
y2 - v->
y1 + 1 ) * 0.5f * ( ndcBounds[1][1] + 1.0f ));
505 R_RemoteRender( drawSurf, const_cast<textureStage_t *>(&stage->
texture) );
519 parms = R_MirrorViewBySurface( drawSurf );
const srfTriangles_t * geo
bool FromPoints(const idVec3 &p1, const idVec3 &p2, const idVec3 &p3, bool fixDegenerate=true)
const idVec3 & Normal(void) const
const float GetSort(void) const
const int GetNumStages(void) const
bool HasSubview(void) const
bool R_PreciseCullSurface(const drawSurf_t *drawSurf, idBounds &ndcBounds)
virtual void CaptureRenderToImage(const char *imageName)
struct drawSurf_s * subviewSurface
idVec3 Cross(const idVec3 &a) const
const struct viewEntity_s * space
const idMaterial * material
float projectionMatrix[16]
virtual void CropRenderSize(int width, int height, bool makePowerOfTwo=false, bool forceDimensions=false)
bool AddPoint(const idVec3 &v)
GLfloat GLfloat GLfloat v2
int GetNumPoints(void) const
GLubyte GLubyte GLubyte GLubyte w
const shaderStage_t * GetStage(const int index) const
idVec3 vec3_origin(0.0f, 0.0f, 0.0f)
idImageManager * globalImages
void Intersect(const idScreenRect &rect)
void R_GlobalToNormalizedDeviceCoordinates(const idVec3 &global, idVec3 &ndc)
void RenderViewToViewport(const renderView_t *renderView, idScreenRect *viewport)
idRenderEntityLocal * entityDef
void R_TransformModelToClip(const idVec3 &src, const float *modelMatrix, const float *projectionMatrix, idPlane &eye, idPlane &dst)
void R_MirrorRender(drawSurf_t *surf, textureStage_t *stage, idScreenRect scissor)
void R_GlobalPointToLocal(const float modelMatrix[16], const idVec3 &in, idVec3 &out)
void R_RenderView(viewDef_t *parms)
GLfloat GLfloat GLfloat GLfloat v3
bool IsCleared(void) const
void R_XrayRender(drawSurf_t *surf, textureStage_t *stage, idScreenRect scissor)
void R_LocalPlaneToGlobal(const float modelMatrix[16], const idPlane &in, idPlane &out)
float modelViewMatrix[16]
bool R_GenerateSubViews(void)
void * R_FrameAlloc(int bytes)
idVec3 initialViewAreaOrigin
float dot(float a[], float b[])
void R_LocalPointToGlobal(const float modelMatrix[16], const idVec3 &in, idVec3 &out)
idCVar r_skipSubviews("r_skipSubviews","0", CVAR_RENDERER|CVAR_INTEGER,"1 = don't render any gui elements on surfaces")
bool ClipInPlace(const idPlane &plane, const float epsilon=ON_EPSILON, const bool keepOn=false)
idPlane clipPlanes[MAX_CLIP_PLANES]
struct viewDef_s * superView
struct renderView_s * remoteRenderView
bool R_GenerateSurfaceSubview(drawSurf_t *drawSurf)