This commit is contained in:
Branimir Karadžić
2018-09-18 17:24:18 -07:00
parent be8b8381cc
commit 2b427d5126
3 changed files with 9 additions and 344 deletions

View File

@@ -407,10 +407,11 @@ public:
imguiEndFrame();
ddBegin(0);
DebugDrawEncoder dde;
dde.begin(0);
float center[3] = { 0.0f, 0.0f, 0.0f };
ddDrawGrid(Axis::Y, center);
dde.drawGrid(Axis::Y, center);
float eye[3];
cameraGetPosition(eye);
@@ -424,14 +425,14 @@ public:
{
Aabb aabb;
psGetAabb(m_emitter[currentEmitter].m_handle, aabb);
ddPush();
ddSetWireframe(true);
ddSetColor(0xff0000ff);
ddDraw(aabb);
ddPop();
dde.push();
dde.setWireframe(true);
dde.setColor(0xff0000ff);
dde.draw(aabb);
dde.pop();
}
ddEnd();
dde.end();
// Advance to next frame. Rendering thread will be kicked to
// process submitted rendering primitives.

View File

@@ -2435,216 +2435,6 @@ void ddDestroy(GeometryHandle _handle)
s_dds.destroy(_handle);
}
void ddBegin(uint16_t _viewId, bool _depthTestLess, bgfx::Encoder* _encoder)
{
s_dde.begin(_viewId, _depthTestLess, _encoder);
}
void ddEnd()
{
s_dde.end();
}
void ddPush()
{
s_dde.push();
}
void ddPop()
{
s_dde.pop();
}
void ddSetDepthTestLess(bool _depthTestLess)
{
s_dde.setDepthTestLess(_depthTestLess);
}
void ddSetState(bool _depthTest, bool _depthWrite, bool _clockwise)
{
s_dde.setState(_depthTest, _depthWrite, _clockwise);
}
void ddSetColor(uint32_t _abgr)
{
s_dde.setColor(_abgr);
}
void ddSetLod(uint8_t _lod)
{
s_dde.setLod(_lod);
}
void ddSetWireframe(bool _wireframe)
{
s_dde.setWireframe(_wireframe);
}
void ddSetStipple(bool _stipple, float _scale, float _offset)
{
s_dde.setStipple(_stipple, _scale, _offset);
}
void ddSetSpin(float _spin)
{
s_dde.setSpin(_spin);
}
void ddSetTransform(const void* _mtx)
{
s_dde.setTransform(_mtx);
}
void ddSetTranslate(float _x, float _y, float _z)
{
s_dde.setTranslate(_x, _y, _z);
}
void ddMoveTo(float _x, float _y, float _z)
{
s_dde.moveTo(_x, _y, _z);
}
void ddMoveTo(const void* _pos)
{
s_dde.moveTo(_pos);
}
void ddLineTo(float _x, float _y, float _z)
{
s_dde.lineTo(_x, _y, _z);
}
void ddLineTo(const void* _pos)
{
s_dde.lineTo(_pos);
}
void ddClose()
{
s_dde.close();
}
void ddDraw(const Aabb& _aabb)
{
s_dde.draw(_aabb);
}
void ddDraw(const Cylinder& _cylinder)
{
s_dde.draw(_cylinder, false);
}
void ddDraw(const Capsule& _capsule)
{
s_dde.draw(*( (const Cylinder*)&_capsule), true);
}
void ddDraw(const Disk& _disk)
{
s_dde.draw(_disk);
}
void ddDraw(const Obb& _obb)
{
s_dde.draw(_obb);
}
void ddDraw(const Sphere& _sphere)
{
s_dde.draw(_sphere);
}
void ddDraw(const Cone& _cone)
{
s_dde.drawCone(_cone.m_pos, _cone.m_end, _cone.m_radius);
}
void ddDraw(GeometryHandle _handle)
{
s_dde.draw(_handle);
}
void ddDrawLineList(uint32_t _numVertices, const DdVertex* _vertices, uint32_t _numIndices, const uint16_t* _indices)
{
s_dde.draw(true, _numVertices, _vertices, _numIndices, _indices);
}
void ddDrawTriList(uint32_t _numVertices, const DdVertex* _vertices, uint32_t _numIndices, const uint16_t* _indices)
{
s_dde.draw(false, _numVertices, _vertices, _numIndices, _indices);
}
void ddDrawFrustum(const void* _viewProj)
{
s_dde.drawFrustum(_viewProj);
}
void ddDrawArc(Axis::Enum _axis, float _x, float _y, float _z, float _radius, float _degrees)
{
s_dde.drawArc(_axis, _x, _y, _z, _radius, _degrees);
}
void ddDrawCircle(const void* _normal, const void* _center, float _radius, float _weight)
{
s_dde.drawCircle(_normal, _center, _radius, _weight);
}
void ddDrawCircle(Axis::Enum _axis, float _x, float _y, float _z, float _radius, float _weight)
{
s_dde.drawCircle(_axis, _x, _y, _z, _radius, _weight);
}
void ddDrawQuad(const float* _normal, const float* _center, float _size)
{
s_dde.drawQuad(_normal, _center, _size);
}
void ddDrawQuad(SpriteHandle _handle, const float* _normal, const float* _center, float _size)
{
s_dde.drawQuad(_handle, _normal, _center, _size);
}
void ddDrawQuad(bgfx::TextureHandle _handle, const float* _normal, const float* _center, float _size)
{
s_dde.drawQuad(_handle, _normal, _center, _size);
}
void ddDrawCone(const void* _from, const void* _to, float _radius)
{
s_dde.drawCone(_from, _to, _radius);
}
void ddDrawCylinder(const void* _from, const void* _to, float _radius)
{
s_dde.drawCylinder(_from, _to, _radius, false);
}
void ddDrawCapsule(const void* _from, const void* _to, float _radius)
{
s_dde.drawCylinder(_from, _to, _radius, true);
}
void ddDrawAxis(float _x, float _y, float _z, float _len, Axis::Enum _hightlight, float _thickness)
{
s_dde.drawAxis(_x, _y, _z, _len, _hightlight, _thickness);
}
void ddDrawGrid(const void* _normal, const void* _center, uint32_t _size, float _step)
{
s_dde.drawGrid(_normal, _center, _size, _step);
}
void ddDrawGrid(Axis::Enum _axis, const void* _center, uint32_t _size, float _step)
{
s_dde.drawGrid(_axis, _center, _size, _step);
}
void ddDrawOrb(float _x, float _y, float _z, float _radius, Axis::Enum _hightlight)
{
s_dde.drawOrb(_x, _y, _z, _radius, _hightlight);
}
#define DEBUG_DRAW_ENCODER(_func) reinterpret_cast<DebugDrawEncoderImpl*>(this)->_func
DebugDrawEncoder::DebugDrawEncoder()

View File

@@ -194,130 +194,4 @@ struct DebugDrawEncoder
BX_ALIGN_DECL_CACHE_LINE(uint8_t) m_internal[50<<10];
};
///
void ddBegin(uint16_t _viewId, bool _depthTestLess = true, bgfx::Encoder* _encoder = NULL);
///
void ddEnd();
///
void ddPush();
///
void ddPop();
///
void ddSetDepthTestLess(bool _depthTestLess);
///
void ddSetState(bool _depthTest, bool _depthWrite, bool _clockwise);
///
void ddSetColor(uint32_t _abgr);
///
void ddSetLod(uint8_t _lod);
///
void ddSetWireframe(bool _wireframe);
///
void ddSetStipple(bool _stipple, float _scale = 1.0f, float _offset = 0.0f);
///
void ddSetSpin(float _spin);
///
void ddSetTransform(const void* _mtx);
///
void ddSetTranslate(float _x, float _y, float _z);
///
void ddMoveTo(float _x, float _y, float _z = 0.0f);
///
void ddMoveTo(const void* _pos);
///
void ddLineTo(float _x, float _y, float _z = 0.0f);
///
void ddLineTo(const void* _pos);
///
void ddClose();
///
void ddDraw(const Aabb& _aabb);
///
void ddDraw(const Cylinder& _cylinder);
///
void ddDraw(const Capsule& _capsule);
///
void ddDraw(const Disk& _disk);
///
void ddDraw(const Obb& _obb);
///
void ddDraw(const Sphere& _sphere);
///
void ddDraw(const Cone& _cone);
///
void ddDraw(GeometryHandle _handle);
///
void ddDrawLineList(uint32_t _numVertices, const DdVertex* _vertices, uint32_t _numIndices = 0, const uint16_t* _indices = NULL);
///
void ddDrawTriList(uint32_t _numVertices, const DdVertex* _vertices, uint32_t _numIndices = 0, const uint16_t* _indices = NULL);
///
void ddDrawFrustum(const void* _viewProj);
///
void ddDrawArc(Axis::Enum _axis, float _x, float _y, float _z, float _radius, float _degrees);
///
void ddDrawCircle(const void* _normal, const void* _center, float _radius, float _weight = 0.0f);
///
void ddDrawCircle(Axis::Enum _axis, float _x, float _y, float _z, float _radius, float _weight = 0.0f);
///
void ddDrawQuad(const float* _normal, const float* _center, float _size);
///
void ddDrawQuad(SpriteHandle _handle, const float* _normal, const float* _center, float _size);
///
void ddDrawQuad(bgfx::TextureHandle _handle, const float* _normal, const float* _center, float _size);
///
void ddDrawCone(const void* _from, const void* _to, float _radius);
///
void ddDrawCylinder(const void* _from, const void* _to, float _radius);
///
void ddDrawCapsule(const void* _from, const void* _to, float _radius);
///
void ddDrawAxis(float _x, float _y, float _z, float _len = 1.0f, Axis::Enum _highlight = Axis::Count, float _thickness = 0.0f);
///
void ddDrawGrid(const void* _normal, const void* _center, uint32_t _size = 20, float _step = 1.0f);
///
void ddDrawGrid(Axis::Enum _axis, const void* _center, uint32_t _size = 20, float _step = 1.0f);
///
void ddDrawOrb(float _x, float _y, float _z, float _radius, Axis::Enum _highlight = Axis::Count);
#endif // DEBUGDRAW_H_HEADER_GUARD