Bugbot now properly uses project settings to determine raycast length for marker placement.
This commit is contained in:
parent
cf1c6a3632
commit
c7e78ba4ac
@ -7,9 +7,6 @@ extends CharacterBody3D
|
|||||||
## Scene to use as the bug marker.
|
## Scene to use as the bug marker.
|
||||||
@export_file("*.scn","*.tscn") var bug_marker : String
|
@export_file("*.scn","*.tscn") var bug_marker : String
|
||||||
|
|
||||||
## Distance from camera to allow placing bug markers.
|
|
||||||
@export_range(0.0, 100.0, 0.01, "or_greater", "suffix:m") var ray_length : float = 10.0
|
|
||||||
|
|
||||||
#region InputEvent Exports
|
#region InputEvent Exports
|
||||||
@export_group("Inputs")
|
@export_group("Inputs")
|
||||||
@export_subgroup("Keyboard", "keyboard_")
|
@export_subgroup("Keyboard", "keyboard_")
|
||||||
@ -66,6 +63,11 @@ extends CharacterBody3D
|
|||||||
@onready var __camera : Camera3D = $CollisionShape3D/Camera3D
|
@onready var __camera : Camera3D = $CollisionShape3D/Camera3D
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Constants
|
||||||
|
const DEFAULT_PRECISE_PLACEMENT_DISTANCE : float = 10.0
|
||||||
|
const DEFAULT_ARBITRARY_PLACEMENT_DISTANCE : float = 2.5
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Private Properties
|
#region Private Properties
|
||||||
static var __bugbot_server : BugbotServerAPI
|
static var __bugbot_server : BugbotServerAPI
|
||||||
static var __bug_marker_root : Node
|
static var __bug_marker_root : Node
|
||||||
@ -346,6 +348,7 @@ func __on_exit_placement_timer_timeout() -> void:
|
|||||||
queue_free()
|
queue_free()
|
||||||
|
|
||||||
func __raycast_to_world() -> void:
|
func __raycast_to_world() -> void:
|
||||||
|
var ray_length : float = ProjectSettings.get_setting("bugbot/bug_placement/precise_placement_distance", DEFAULT_PRECISE_PLACEMENT_DISTANCE)
|
||||||
var space : PhysicsDirectSpaceState3D = get_world_3d().direct_space_state
|
var space : PhysicsDirectSpaceState3D = get_world_3d().direct_space_state
|
||||||
var query : PhysicsRayQueryParameters3D = PhysicsRayQueryParameters3D.create(global_position, global_position - global_transform.basis.z * ray_length)
|
var query : PhysicsRayQueryParameters3D = PhysicsRayQueryParameters3D.create(global_position, global_position - global_transform.basis.z * ray_length)
|
||||||
query.collide_with_areas = true
|
query.collide_with_areas = true
|
||||||
|
|||||||
28
bugbot.gd
28
bugbot.gd
@ -34,8 +34,8 @@ func _exit_tree() -> void:
|
|||||||
|
|
||||||
func __initialise_project_settings() -> void:
|
func __initialise_project_settings() -> void:
|
||||||
#region Placement
|
#region Placement
|
||||||
__add_project_setting("bugbot/bug_placement/precise_placement_distance", TYPE_FLOAT, 15.0, PROPERTY_HINT_RANGE, "0.0,100.0,0.1,or_greater")
|
__add_project_setting("bugbot/bug_placement/precise_placement_distance", TYPE_FLOAT, Bugbot.DEFAULT_PRECISE_PLACEMENT_DISTANCE, PROPERTY_HINT_RANGE, "0.0,100.0,0.1,or_greater")
|
||||||
__add_project_setting("bugbot/bug_placement/arbitrary_placement_distance", TYPE_FLOAT, 2.5, PROPERTY_HINT_RANGE, "0.0,100.0,0.1,or_greater")
|
__add_project_setting("bugbot/bug_placement/arbitrary_placement_distance", TYPE_FLOAT, Bugbot.DEFAULT_ARBITRARY_PLACEMENT_DISTANCE, PROPERTY_HINT_RANGE, "0.0,100.0,0.1,or_greater")
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Reporting
|
#region Reporting
|
||||||
@ -68,18 +68,18 @@ func __initialise_project_settings() -> void:
|
|||||||
__add_project_setting("bugbot/reporting/gitea/status_labels/show_assigned_as_in_progress", TYPE_BOOL, BugbotServerGiteaAPI.DEFAULT_SHOW_ASSIGNED_AS_IN_PROGRESS)
|
__add_project_setting("bugbot/reporting/gitea/status_labels/show_assigned_as_in_progress", TYPE_BOOL, BugbotServerGiteaAPI.DEFAULT_SHOW_ASSIGNED_AS_IN_PROGRESS)
|
||||||
#endregion
|
#endregion
|
||||||
#region Jira
|
#region Jira
|
||||||
__add_project_setting("bugbot/reporting/jira/server", TYPE_STRING, "https://jira.example.com")
|
__add_project_setting("bugbot/reporting/jira/server", TYPE_STRING, BugbotServerJiraAPI.DEFAULT_SERVER)
|
||||||
__add_project_setting("bugbot/reporting/jira/REST_URI", TYPE_STRING, "rest/")
|
__add_project_setting("bugbot/reporting/jira/REST_URI", TYPE_STRING, BugbotServerJiraAPI.DEFAULT_REST_URI)
|
||||||
__add_project_setting("bugbot/reporting/jira/project_name", TYPE_STRING, "ProjectName")
|
__add_project_setting("bugbot/reporting/jira/project_name", TYPE_STRING, BugbotServerJiraAPI.DEFAULT_PROJECT_NAME)
|
||||||
__add_project_setting("bugbot/reporting/jira/email", TYPE_STRING, "")
|
__add_project_setting("bugbot/reporting/jira/email", TYPE_STRING, BugbotServerJiraAPI.DEFAULT_EMAIL)
|
||||||
__add_project_setting("bugbot/reporting/jira/API_key", TYPE_STRING, "")
|
__add_project_setting("bugbot/reporting/jira/API_key", TYPE_STRING, BugbotServerJiraAPI.DEFAULT_API_KEY)
|
||||||
__add_project_setting("bugbot/reporting/jira/bug_issue_type", TYPE_STRING, "Bug")
|
__add_project_setting("bugbot/reporting/jira/bug_issue_type", TYPE_STRING, BugbotServerJiraAPI.DEFAULT_BUG_ISSUE_TYPE)
|
||||||
__add_project_setting("bugbot/reporting/jira/map_name_field", TYPE_STRING, "")
|
__add_project_setting("bugbot/reporting/jira/map_name_field", TYPE_STRING, BugbotServerJiraAPI.DEFAULT_MAP_NAME_FIELD)
|
||||||
__add_project_setting("bugbot/reporting/jira/marker_location_field", TYPE_STRING, "")
|
__add_project_setting("bugbot/reporting/jira/marker_location_field", TYPE_STRING, BugbotServerJiraAPI.DEFAULT_MARKER_LOCATION_FIELD)
|
||||||
__add_project_setting("bugbot/reporting/jira/optional_fields/department_field", TYPE_STRING, "")
|
__add_project_setting("bugbot/reporting/jira/optional_fields/department_field", TYPE_STRING, BugbotServerJiraAPI.DEFAULT_DEPARTMENT_FIELD)
|
||||||
__add_project_setting("bugbot/reporting/jira/optional_fields/severity_field", TYPE_STRING, "")
|
__add_project_setting("bugbot/reporting/jira/optional_fields/severity_field", TYPE_STRING, BugbotServerJiraAPI.DEFAULT_SEVERITY_FIELD)
|
||||||
__add_project_setting("bugbot/reporting/jira/optional_fields/platform_field", TYPE_STRING, "")
|
__add_project_setting("bugbot/reporting/jira/optional_fields/platform_field", TYPE_STRING, BugbotServerJiraAPI.DEFAULT_PLATFORM_FIELD)
|
||||||
__add_project_setting("bugbot/reporting/jira/optional_fields/version_field", TYPE_STRING, "")
|
__add_project_setting("bugbot/reporting/jira/optional_fields/version_field", TYPE_STRING, BugbotServerJiraAPI.DEFAULT_VERSION_FIELD)
|
||||||
#endregion
|
#endregion
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user