added log for helping placing props floating in zero 0

This commit is contained in:
FreezeDriedMangoes 2022-11-14 21:43:51 -05:00
parent fc4ae7d3c7
commit 67a2200920
2 changed files with 26 additions and 0 deletions

View File

@ -108,6 +108,28 @@ namespace NewHorizons.Utility.DebugUtilities
DebugRaycastData data = _rc.Raycast(); DebugRaycastData data = _rc.Raycast();
PlaceObject(data, this.gameObject.transform.position); 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) if (!hasAddedCurrentObjectToRecentsList)
{ {
hasAddedCurrentObjectToRecentsList = true; hasAddedCurrentObjectToRecentsList = true;

View File

@ -95,6 +95,10 @@ namespace NewHorizons.Utility.DebugUtilities
_planeDownRightSphere.transform.localPosition = data.plane.origin + data.plane.u*1*planeSize + data.plane.v*-1*planeSize; _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}]"); Logger.Log($"Raycast hit \"position\": {posText}, \"normal\": {normText} on [{data.bodyName}] at [{data.bodyPath}]");
var ppos = data.hitBodyGameObject.GetComponent<AstroObject>().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() internal DebugRaycastData Raycast()
{ {