MeshLib C++ Docs
Loading...
Searching...
No Matches
MR::PythonViewer::Viewport Class Reference

#include <MRPythonViewer/MRPythonViewer.h>

Public Member Functions

 Viewport (ViewportId id)
void cameraLookAlong (const Vector3f &dir, const Vector3f &up) const
void cameraRotateAround (const Line3f &axis, float angle) const
Vector3f projectToViewportSpace (const Vector3f &input) const
 Project world space point to viewport coordinates (in pixels), (0,0) will be at the top-left corner of the viewport.

Public Attributes

const ViewportId id

Detailed Description

Viewport is a rectangular area, in which the objects of interest are going to be rendered. An application can have a number of viewports each with its own ID.

Constructor & Destructor Documentation

◆ Viewport()

MR::PythonViewer::Viewport::Viewport ( ViewportId id)
inlineexplicit

Member Function Documentation

◆ cameraLookAlong()

void MR::PythonViewer::Viewport::cameraLookAlong ( const Vector3f & dir,
const Vector3f & up ) const

Set camera look direction and up direction (they should be perpendicular) this function changes camera position and do not change camera spot (0,0,0) by default to change camera position use setCameraTranslation after this function

◆ cameraRotateAround()

void MR::PythonViewer::Viewport::cameraRotateAround ( const Line3f & axis,
float angle ) const

Rotates camera around axis +direction applied to axis point note: this can make camera clip objects (as far as distance to scene center is not fixed)

◆ projectToViewportSpace()

Vector3f MR::PythonViewer::Viewport::projectToViewportSpace ( const Vector3f & input) const
nodiscard

Project world space point to viewport coordinates (in pixels), (0,0) will be at the top-left corner of the viewport.

Member Data Documentation

◆ id

const ViewportId MR::PythonViewer::Viewport::id

The documentation for this class was generated from the following file: