31 #ifndef VP_PANDA3D_BASE_RENDERER_H
32 #define VP_PANDA3D_BASE_RENDERER_H
34 #include <visp3/core/vpConfig.h>
36 #if defined(VISP_HAVE_PANDA3D)
37 #include <visp3/core/vpPoint.h>
38 #include <visp3/core/vpCameraParameters.h>
39 #include <visp3/ar/vpPanda3DRenderParameters.h>
41 #include <pandaFramework.h>
42 #include <pandaSystem.h>
61 : m_name(rendererName), m_renderOrder(-100), m_framework(nullptr), m_window(nullptr), m_camera(nullptr)
63 setVerticalSyncEnabled(
false);
73 virtual void initFramework();
74 virtual void initFromParent(std::shared_ptr<PandaFramework> framework, PointerTo<WindowFramework> window);
78 virtual void renderFrame();
81 GraphicsOutput *mainBuffer = getMainOutputBuffer();
82 if (mainBuffer !=
nullptr) {
83 m_framework->get_graphics_engine()->extract_texture_data(mainBuffer->get_texture(), mainBuffer->get_gsg());
92 const std::string &
getName()
const {
return m_name; }
94 void setName(
const std::string &name) { m_name = name; }
127 int previousOrder = m_renderOrder;
128 m_renderOrder = order;
129 for (GraphicsOutput *buffer: m_buffers) {
130 buffer->set_sort(buffer->get_sort() + (order - previousOrder));
200 void computeNearAndFarPlanesFromNode(
const std::string &name,
float &near,
float &far,
bool fast);
211 NodePath loadObject(
const std::string &nodeName,
const std::string &modelPath);
218 virtual void addNodeToScene(
const NodePath &
object);
226 void setVerticalSyncEnabled(
bool useVsync);
233 void setAbortOnPandaError(
bool abort);
234 void enableDebugLog();
239 void printStructure();
253 virtual void setupScene();
259 virtual void setupCamera();
Implementation of column vector and the associated operations.
Implementation of an homogeneous matrix and operations on such kind of matrices.
Base class for a panda3D renderer. This class handles basic functionalities, such as loading object,...
vpPanda3DBaseRenderer(const std::string &rendererName)
void setRenderOrder(int order)
const std::string & getName() const
Get the name of the renderer.
std::shared_ptr< PandaFramework > m_framework
Rendering priority for this renderer and its buffers. A lower value will be rendered first....
virtual GraphicsOutput * getMainOutputBuffer()
NodePath m_renderRoot
Rendering parameters.
PointerTo< Camera > m_camera
Node containing all the objects and the camera for this renderer.
virtual bool isRendering3DScene() const
Returns true if this renderer process 3D data and its scene root can be interacted with.
virtual ~vpPanda3DBaseRenderer()=default
static const vpHomogeneousMatrix PANDA_T_VISP
Homogeneous transformation matrix to convert from the Panda coordinate system (right-handed Z-up) to ...
std::string m_name
Inverse of VISP_T_PANDA.
static const vpHomogeneousMatrix VISP_T_PANDA
virtual void afterFrameRendered()
void setName(const std::string &name)
PointerTo< WindowFramework > m_window
Pointer to the active panda framework.
int getRenderOrder() const
Get the rendering order of this renderer. If a renderer A has a lower order value than B,...
NodePath & getRenderRoot()
Get the scene root.
virtual void setupRenderTarget()
Initialize buffers and other objects that are required to save the render.
int m_renderOrder
name of the renderer
virtual void beforeFrameRendered()
std::vector< GraphicsOutput * > m_buffers
NodePath of the camera.
vpPanda3DRenderParameters m_renderParameters
Pointer to owning window, which can create buffers etc. It is not necessarily visible.
Rendering parameters for a panda3D simulation.