App::cViewer class

Contents

Public functions

auto Initialize(bool) -> bool
auto ClearScene(int8_t flags) -> bool
Clears one or more surfaces such as the render target, the depth buffer or the stencil buffer.
auto LoadTransformations() -> bool
void SetBackgroundColor(const Math::ColorRGBA& color)
Sets the background color that is shown in the background of the scene.
auto GetNearPlane() const -> float
auto GetFarPlane() const -> float
void SetNearPlane(float fValue)
void SetFarPlane(float fValue)
void SetAspectRatio(float fValue)
void SetCameraMaterialLODs(const Vector4& values)
auto GetCameraMaterialLODs() const -> Vector4
void SetRenderType(int renderType, bool = 0)
void SetViewTransform(const Transform& transform)
auto GetViewTransform() const -> Transform
auto GetCameraToMouse(Vector3& cameraPosition, Vector3& direction) const -> bool
Just calls GetCameraToPoint() for the current mouse coordinates.
auto GetCameraToPoint(float x, float y, Vector3& cameraPosition, Vector3& direction) const -> bool
auto GetViewport() const -> D3DVIEWPORT9

Public variables

Matrix4 viewTransform
Matrix4 field_40
Matrix4 field_80
Matrix4 field_C0
Matrix4 field_100
ColorRGBA backgroundColor
int renderType
bool field_154
int field_158
float cameraMaterialLODs
bool field_16C
Camera* camera

Function documentation

bool App::cViewer::ClearScene(int8_t flags)

Clears one or more surfaces such as the render target, the depth buffer or the stencil buffer.

Parameters
flags A combination of flags in the D3DCLEAR enum.
Returns true If the operation was carried out successfully.

This calls the IDirect3DDevice9::Clear() method using this Viewer background color. It will also call IDirect3DDevice9::SetViewport() if the current viewport is not that from the viewer.

void App::cViewer::SetBackgroundColor(const Math::ColorRGBA& color)

Sets the background color that is shown in the background of the scene.

Parameters
color

More exactly, this is the color used to clear the scene.

bool App::cViewer::GetCameraToMouse(Vector3& cameraPosition, Vector3& direction) const

Just calls GetCameraToPoint() for the current mouse coordinates.

Parameters
cameraPosition [Output]
direction [Output]

bool App::cViewer::GetCameraToPoint(float x, float y, Vector3& cameraPosition, Vector3& direction) const

Parameters
x
y
cameraPosition [Output]
direction [Output]