why am i like this.
This commit is contained in:
parent
818eac09a1
commit
b453065058
|
|
@ -2859,18 +2859,18 @@ elements.specific_ray_emitter = {
|
||||||
var dir = [0-squareCoords[i][0], 0-squareCoords[i][1]]
|
var dir = [0-squareCoords[i][0], 0-squareCoords[i][1]]
|
||||||
let startx, starty, endx, endy, magnitude
|
let startx, starty, endx, endy, magnitude
|
||||||
if (pixel.specificRayAngle == "nah"){
|
if (pixel.specificRayAngle == "nah"){
|
||||||
startx = pixel.x+(dir[0]*specificRayStart)
|
startx = pixel.x+(dir[0]*pixel.specificRayStart)
|
||||||
starty = pixel.y+(dir[1]*specificRayStart)
|
starty = pixel.y+(dir[1]*pixel.specificRayStart)
|
||||||
magnitude = specificRayEnd
|
magnitude = pixel.specificRayEnd
|
||||||
endx = startx+(magnitude*dir[0])
|
endx = startx+(magnitude*dir[0])
|
||||||
endy = starty+(magnitude*dir[1])
|
endy = starty+(magnitude*dir[1])
|
||||||
} else {
|
} else {
|
||||||
let angleInRadians = pixel.specificRayAngle * Math.PI / 180;
|
let angleInRadians = pixel.specificRayAngle * Math.PI / 180;
|
||||||
console.log("Angle in radians is " + angleInRadians)
|
console.log("Angle in radians is " + angleInRadians)
|
||||||
dir = [(Math.cos(angleInRadians)), (Math.sin(angleInRadians))]
|
dir = [(Math.cos(angleInRadians)), (Math.sin(angleInRadians))]
|
||||||
startx = pixel.x+Math.round((dir[0]*specificRayStart))
|
startx = pixel.x+Math.round((dir[0]*pixel.specificRayStart))
|
||||||
starty = pixel.y+Math.round((dir[1]*specificRayStart))
|
starty = pixel.y+Math.round((dir[1]*pixel.specificRayStart))
|
||||||
magnitude = specificRayEnd
|
magnitude = pixel.specificRayEnd
|
||||||
endx = startx+Math.round((magnitude*dir[0]))
|
endx = startx+Math.round((magnitude*dir[0]))
|
||||||
endy = starty+Math.round((magnitude*dir[1]))
|
endy = starty+Math.round((magnitude*dir[1]))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue