diff --git a/NewHorizons/Utility/DebugUtilities/DebugPropPlacer.cs b/NewHorizons/Utility/DebugUtilities/DebugPropPlacer.cs index 70e85fcc..ff8f48a4 100644 --- a/NewHorizons/Utility/DebugUtilities/DebugPropPlacer.cs +++ b/NewHorizons/Utility/DebugUtilities/DebugPropPlacer.cs @@ -108,6 +108,28 @@ namespace NewHorizons.Utility.DebugUtilities DebugRaycastData data = _rc.Raycast(); PlaceObject(data, this.gameObject.transform.position); + //use DropItem logic to make props not clip through the ground when placed + +//public virtual void DropItem(Vector3 position, Vector3 normal, Transform parent, Sector sector, IItemDropTarget customDropTarget) +//{ +// base.transform.SetParent(parent); +// base.transform.localScale = Vector3.one; +// Quaternion quaternion = Quaternion.FromToRotation(base.transform.TransformDirection(_localDropNormal), normal); +// base.transform.rotation = quaternion * base.transform.rotation; +// base.transform.position = position + base.transform.TransformDirection(_localDropOffset); +// if (_parentFragment != null) +// { +// _parentFragment.OnChangeSector -= OnParentFragmentChangeSector; +// } +// _parentFragment = customDropTarget as DetachableFragment; +// if (_parentFragment != null) +// { +// _parentFragment.OnChangeSector += OnParentFragmentChangeSector; +// } +// SetSector(sector); +// SetColliderActivation(active: true); +//} + if (!hasAddedCurrentObjectToRecentsList) { hasAddedCurrentObjectToRecentsList = true; diff --git a/NewHorizons/Utility/DebugUtilities/DebugRaycaster.cs b/NewHorizons/Utility/DebugUtilities/DebugRaycaster.cs index 16f502e8..9813f78e 100644 --- a/NewHorizons/Utility/DebugUtilities/DebugRaycaster.cs +++ b/NewHorizons/Utility/DebugUtilities/DebugRaycaster.cs @@ -95,6 +95,10 @@ namespace NewHorizons.Utility.DebugUtilities _planeDownRightSphere.transform.localPosition = data.plane.origin + data.plane.u*1*planeSize + data.plane.v*-1*planeSize; Logger.Log($"Raycast hit \"position\": {posText}, \"normal\": {normText} on [{data.bodyName}] at [{data.bodyPath}]"); + var ppos = data.hitBodyGameObject.GetComponent().GetRootSector().transform.InverseTransformPoint(Locator.GetPlayerTransform().position); + posText = $"{{\"x\": {ppos.x}, \"y\": {ppos.y}, \"z\": {ppos.z}}}"; + Logger.Log($"Player, relative to raycasted sector \"position\": {posText} on [{data.bodyName}] at [{data.bodyPath}]"); + } internal DebugRaycastData Raycast() {