Node snap radius consolidation
This commit is contained in:
@@ -14,7 +14,7 @@ ROAD_SIZE :: 20
|
|||||||
// Radius of the node
|
// Radius of the node
|
||||||
NODE_RADIUS :: 20
|
NODE_RADIUS :: 20
|
||||||
// Size of designated radius that determines when position is within node's 'sphere'
|
// Size of designated radius that determines when position is within node's 'sphere'
|
||||||
NODE_SNAP_RADIUS :: 3
|
NODE_SNAP_RADIUS :: 3 * NODE_RADIUS
|
||||||
// Default text size
|
// Default text size
|
||||||
TEXT_SIZE :: 50
|
TEXT_SIZE :: 50
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ draw_roads :: proc(self: ^Simulator) {
|
|||||||
draw_nodes :: proc(self: ^Simulator) {
|
draw_nodes :: proc(self: ^Simulator) {
|
||||||
for &node in self.nodes {
|
for &node in self.nodes {
|
||||||
// draws the snapping radius if key is held down
|
// draws the snapping radius if key is held down
|
||||||
if self.show_details do rl.DrawCircleV(node.pos, common.NODE_SNAP_RADIUS * common.NODE_RADIUS, common.NODE_SNAP_COLOUR)
|
if self.show_details do rl.DrawCircleV(node.pos, common.NODE_SNAP_RADIUS, common.NODE_SNAP_COLOUR)
|
||||||
// draws the node
|
// draws the node
|
||||||
rl.DrawCircleV(node.pos, common.NODE_RADIUS, common.NODE_DONE_COLOUR)
|
rl.DrawCircleV(node.pos, common.NODE_RADIUS, common.NODE_DONE_COLOUR)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ node_within_snapping_radius :: proc(self: ^Node, pos: rl.Vector2) -> bool {
|
|||||||
return rl.CheckCollisionPointCircle(
|
return rl.CheckCollisionPointCircle(
|
||||||
pos,
|
pos,
|
||||||
self.pos,
|
self.pos,
|
||||||
common.NODE_SNAP_RADIUS * common.NODE_RADIUS,
|
common.NODE_SNAP_RADIUS,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user