Coverage Report

Created: 2025-07-18 07:04

/src/ogre/OgreMain/include/OgreDefaultDebugDrawer.h
Line
Count
Source (jump to first uncovered line)
1
// This file is part of the OGRE project.
2
// It is subject to the license terms in the LICENSE file found in the top-level directory
3
// of this distribution and at https://www.ogre3d.org/licensing.
4
5
#ifndef OGREMAIN_INCLUDE_OGREDEFAULTDEBUGDRAWER_H_
6
#define OGREMAIN_INCLUDE_OGREDEFAULTDEBUGDRAWER_H_
7
8
#include "OgreSceneManager.h"
9
10
namespace Ogre
11
{
12
13
class _OgreExport DefaultDebugDrawer : public DebugDrawer
14
{
15
    ManualObject mLines;
16
    ManualObject mAxes;
17
    int mDrawType;
18
    bool mStatic;
19
    float mBoneAxesSize;
20
    void preFindVisibleObjects(SceneManager* source, SceneManager::IlluminationRenderStage irs, Viewport* v) override;
21
    void postFindVisibleObjects(SceneManager* source, SceneManager::IlluminationRenderStage irs, Viewport* v) override;
22
    void beginLines();
23
    void beginAxes();
24
    void drawAxis2D(const Affine3& pose, const Matrix3& rot, float scale, const ColourValue& col);
25
public:
26
    enum DrawType
27
    {
28
        DT_AXES = 1 << 0,
29
        DT_WIREBOX = 1 << 1
30
    };
31
32
    DefaultDebugDrawer();
33
34
    /// if static, the drawer contents are preserved across frames. They are cleared otherwise.
35
0
    void setStatic(bool enable) { mStatic = enable; }
36
37
    void drawBone(const Node* node, const Affine3 & transform = Affine3::IDENTITY) override;
38
    void drawSceneNode(const SceneNode* node) override;
39
    void drawFrustum(const Frustum* frust) override;
40
    /// Allows the rendering of a wireframe bounding box.
41
    void drawWireBox(const AxisAlignedBox& aabb, const ColourValue& colour = ColourValue::White);
42
    /// draw coordinate axes
43
    void drawAxes(const Affine3& pose, float size = 1.0f);
44
    /// Specifes the size of the axes drawn by drawBone()
45
    void setBoneAxesSize(float size);
46
};
47
48
} /* namespace Ogre */
49
50
#endif /* OGREMAIN_INCLUDE_OGREDEFAULTDEBUGDRAWER_H_ */