Cleanup AxisHelper
This commit is contained in:
@@ -27,16 +27,12 @@ class AxisHelper(var size: Int = 80) : Extension {
|
|||||||
|
|
||||||
fun draw(drawer: Drawer) {
|
fun draw(drawer: Drawer) {
|
||||||
val viewMatrix = drawer.view
|
val viewMatrix = drawer.view
|
||||||
val projMatrix = drawer.projection
|
|
||||||
val x = drawer.width - (size + 5.0)
|
val x = drawer.width - (size + 5.0)
|
||||||
val y = 5.0
|
val y = 5.0
|
||||||
|
|
||||||
drawer.isolatedWithTarget(fbo) {
|
drawer.isolatedWithTarget(fbo) {
|
||||||
drawer.view = Matrix44.IDENTITY
|
drawer.defaults()
|
||||||
drawer.model = Matrix44.IDENTITY
|
drawer.ortho(fbo)
|
||||||
drawer.drawStyle.depthTestPass = DepthTestPass.ALWAYS
|
|
||||||
|
|
||||||
drawer.ortho(0.0, side, 0.0, side, -1.0, 1.0)
|
|
||||||
|
|
||||||
drawer.background(ColorRGBa.TRANSPARENT)
|
drawer.background(ColorRGBa.TRANSPARENT)
|
||||||
drawer.stroke = null
|
drawer.stroke = null
|
||||||
@@ -60,17 +56,11 @@ class AxisHelper(var size: Int = 80) : Extension {
|
|||||||
drawer.lineSegment(Vector3.ZERO, Vector3.UNIT_Z * axisLength)
|
drawer.lineSegment(Vector3.ZERO, Vector3.UNIT_Z * axisLength)
|
||||||
}
|
}
|
||||||
|
|
||||||
drawer.view = Matrix44.IDENTITY
|
|
||||||
drawer.model = Matrix44.IDENTITY
|
|
||||||
drawer.ortho()
|
|
||||||
|
|
||||||
drawer.isolated {
|
drawer.isolated {
|
||||||
val cb = fbo.colorBuffer(0)
|
drawer.defaults()
|
||||||
drawer.image(cb, x, y, side, side)
|
|
||||||
}
|
|
||||||
|
|
||||||
drawer.view = viewMatrix
|
drawer.image(fbo.colorBuffer(0), x, y, side, side)
|
||||||
drawer.projection = projMatrix
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user