Cogs.Core
Public Member Functions | Private Attributes | List of all members
Cogs::ClipmapDepthQuery Struct Reference

Public Member Functions

void initialize (IGraphicsDevice *device, ClipmapRenderer *clipmapRenderer)
 
void readBack ()
 
bool getPositions (const Vector2 *mousePositions, const Matrix &inverseViewProjection, const size_t numPositions, Vector4 *worldPos, bool *positionValid, int rayPickId)
 
float getNearestTerrainSample (const Matrix &inverseProjection)
 Returns the nearest sample in the query readback buffer.
 
float getNearestTerrainSample2 (const Matrix &inverseProjection, const Matrix &viewMatrix)
 Returns the nearest sample in the query readback buffer for two frames.
 

Private Attributes

IGraphicsDevicedevice
 
BufferHandle queryReadBackBuffer
 
ClipmapRendererclipmapRenderer
 
bool hasReadBack = false
 
Vector4 prevViewPos
 
Matrix prevViewMatrix
 

Detailed Description

Definition at line 11 of file ClipmapDepthQuery.h.

Constructor & Destructor Documentation

◆ ClipmapDepthQuery()

Cogs::ClipmapDepthQuery::ClipmapDepthQuery ( )

Definition at line 14 of file ClipmapDepthQuery.cpp.

◆ ~ClipmapDepthQuery()

Cogs::ClipmapDepthQuery::~ClipmapDepthQuery ( )

Definition at line 31 of file ClipmapDepthQuery.cpp.

Member Function Documentation

◆ getNearestTerrainSample()

float Cogs::ClipmapDepthQuery::getNearestTerrainSample ( const Matrix &  inverseProjection)

Returns the nearest sample in the query readback buffer.

Returns
A floating point sample given in view space units, with positive numbers representing increasing distance from the camera.

Definition at line 124 of file ClipmapDepthQuery.cpp.

References Cogs::MapMode::Read.

◆ getNearestTerrainSample2()

float Cogs::ClipmapDepthQuery::getNearestTerrainSample2 ( const Matrix &  inverseProjection,
const Matrix &  viewMatrix 
)

Returns the nearest sample in the query readback buffer for two frames.

Returns
A floating point sample given in view space units, with positive numbers representing increasing distance from the camera.

Definition at line 187 of file ClipmapDepthQuery.cpp.

References Cogs::MapMode::Read.

◆ getPositions()

bool Cogs::ClipmapDepthQuery::getPositions ( const Vector2 *  mousePositions,
const Matrix &  inverseViewProjection,
const size_t  numPositions,
Vector4 *  worldPos,
bool *  positionValid,
int  rayPickId 
)

Definition at line 56 of file ClipmapDepthQuery.cpp.

◆ initialize()

void Cogs::ClipmapDepthQuery::initialize ( IGraphicsDevice device,
ClipmapRenderer clipmapRenderer 
)

Definition at line 21 of file ClipmapDepthQuery.cpp.

◆ readBack()

void Cogs::ClipmapDepthQuery::readBack ( )

Definition at line 42 of file ClipmapDepthQuery.cpp.

Member Data Documentation

◆ clipmapRenderer

ClipmapRenderer* Cogs::ClipmapDepthQuery::clipmapRenderer
private

Definition at line 41 of file ClipmapDepthQuery.h.

◆ device

IGraphicsDevice* Cogs::ClipmapDepthQuery::device
private

Definition at line 39 of file ClipmapDepthQuery.h.

◆ hasReadBack

bool Cogs::ClipmapDepthQuery::hasReadBack = false
private

Definition at line 42 of file ClipmapDepthQuery.h.

◆ prevViewMatrix

Matrix Cogs::ClipmapDepthQuery::prevViewMatrix
private

Definition at line 45 of file ClipmapDepthQuery.h.

◆ prevViewPos

Vector4 Cogs::ClipmapDepthQuery::prevViewPos
private

Definition at line 44 of file ClipmapDepthQuery.h.

◆ queryReadBackBuffer

BufferHandle Cogs::ClipmapDepthQuery::queryReadBackBuffer
private

Definition at line 40 of file ClipmapDepthQuery.h.


The documentation for this struct was generated from the following files: