AAAAAAAAAAAAAAAAAAAAAAAAH
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { Point } from "./Point.js"
|
||||
import { renderCube } from "../../3D/cube.js"
|
||||
|
||||
class Segment
|
||||
{
|
||||
@ -17,16 +18,19 @@ class Segment
|
||||
*/
|
||||
draw(ctx)
|
||||
{
|
||||
if(this.gl instanceof CanvasRenderingContext2D)
|
||||
if(ctx instanceof CanvasRenderingContext2D)
|
||||
{
|
||||
ctx.moveTo(this.start.x, this.start.y);
|
||||
ctx.lineTo(this.stop.x, this.stop.y);
|
||||
}
|
||||
else if(this.gl instanceof WebGLRenderingContext)
|
||||
else if(ctx instanceof WebGLRenderingContext)
|
||||
{
|
||||
renderCube(ctx, this.start.x, -3, this.start.y, 0, 0.5, 0.5, 0.5);
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('Unknown rendering context type');
|
||||
}
|
||||
}
|
||||
|
||||
from_json(data)
|
||||
|
Reference in New Issue
Block a user