-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement material overlay, depends on godotengine/godot#50823, pleas…
…e compile Godot 3.x with that pr to make this work.
- Loading branch information
1 parent
3e43c2a
commit d24223c
Showing
10 changed files
with
173 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
extends Control | ||
|
||
|
||
func _process(delta): | ||
$Label.text = "" | ||
$Label.text += "FPS: %d\n" % Engine.get_frames_per_second() | ||
$Label.text += "BuildingPlacer.is_buildable: %s" % [$"../Tools/BuildingTool".is_buildable] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[gd_resource type="SpatialMaterial" format=2] | ||
|
||
[resource] | ||
flags_transparent = true | ||
albedo_color = Color( 0, 1, 1, 0.247059 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
extends Node | ||
|
||
|
||
export(NodePath) var quadtree_pth | ||
onready var quad_tree = get_node(quadtree_pth) as QuadTreeNode | ||
|
||
func get_closest_building(to_position: Vector3, distance: int = 0.5): | ||
pass | ||
|
||
func add_building(transform: Transform, building: BuildingInstance): | ||
pass | ||
|
||
func remove_building(building: BuildingInstance): | ||
pass | ||
|
||
func _get_aabb_for_query(position: Vector3, radius: int = 10, height: int = 20) -> AABB: | ||
var mesh_inst = MeshInstance.new() | ||
var cylinder = CylinderMesh.new() | ||
cylinder.top_radius = radius | ||
cylinder.bottom_radius = radius | ||
cylinder.height = height | ||
mesh_inst.mesh = cylinder | ||
var aabb = mesh_inst.get_aabb() | ||
aabb.position.x += position.x | ||
aabb.position.y += position.y | ||
aabb.position.z += position.z | ||
mesh_inst.free() | ||
return aabb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
extends Spatial | ||
|
||
|
||
var enabled | ||
func _input(event): | ||
if event is InputEventKey: | ||
if event.scancode == KEY_Y and event.pressed: | ||
enabled = !enabled | ||
|
||
if event is InputEventMouseMotion: | ||
pass | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[gd_resource type="SpatialMaterial" format=2] | ||
|
||
[resource] | ||
flags_transparent = true | ||
albedo_color = Color( 1, 0, 0, 0.247059 ) |
Oops, something went wrong.