-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFrameworkDebugDrawer.h
49 lines (35 loc) · 1.27 KB
/
FrameworkDebugDrawer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once
#include "LinearMath/btIDebugDraw.h"
#include "LinearMath/btAlignedObjectArray.h"
#include "LinearMath/btVector3.h"
#include "Vec3.h"
#define BT_LINE_BATCH_SIZE (1<<12)
ATTRIBUTE_ALIGNED16(class) FrameworkDebugDrawer : public btIDebugDraw
{
int m_debugMode = 0;
btVector3 m_linePoints[BT_LINE_BATCH_SIZE*2];
btVector3 m_lineColors[BT_LINE_BATCH_SIZE];
int m_numLines = 0;
DefaultColors m_ourColors;
public:
BT_DECLARE_ALIGNED_ALLOCATOR();
FrameworkDebugDrawer();
virtual ~FrameworkDebugDrawer() override final;
virtual DefaultColors getDefaultColors() const override final;
virtual void setDefaultColors(const DefaultColors& colors) override final;
virtual void drawLine(
const btVector3 & from1,
const btVector3 & to1,
const btVector3& color1) override final;
virtual void drawContactPoint(
const btVector3 & PointOnB,
const btVector3& normalOnB,
btScalar distance,
int lifeTime,
const btVector3& color) override final;
virtual void reportErrorWarning(const char* warningString) override final;
virtual void draw3dText(const btVector3& location, const char* textString) override final;
virtual void setDebugMode(int debugMode) override final;
virtual int getDebugMode() const override final;
virtual void flushLines() override final;
};