diff --git a/NewHorizons/Builder/Body/Geometry/CubeSphere.cs b/NewHorizons/Builder/Body/Geometry/CubeSphere.cs index 922ae552..75d4ebc0 100644 --- a/NewHorizons/Builder/Body/Geometry/CubeSphere.cs +++ b/NewHorizons/Builder/Body/Geometry/CubeSphere.cs @@ -9,22 +9,6 @@ namespace NewHorizons.Builder.Body.Geometry Mesh mesh = new Mesh(); mesh.name = "CubeSphere"; - float max = 1; - if (stretch.x > stretch.y && stretch.x > stretch.z) - max = stretch.x; - else if (stretch.y > stretch.x && stretch.y > stretch.z) - max = stretch.y; - else if (stretch.z > stretch.x && stretch.z > stretch.y) - max = stretch.z; - else if (stretch.y == stretch.z && stretch.x > stretch.y) - max = stretch.x; - else if (stretch.x == stretch.z && stretch.y > stretch.x) - max = stretch.y; - else if (stretch.x == stretch.y && stretch.z > stretch.x) - max = stretch.z; - minHeight /= max; - maxHeight /= max; - CreateVertices(mesh, resolution, heightMap, minHeight, maxHeight); StretchVertices(mesh, stretch); CreateTriangles(mesh, resolution); diff --git a/NewHorizons/Components/AddPhysics.cs b/NewHorizons/Components/AddPhysics.cs index 7cbc20cb..6f987255 100644 --- a/NewHorizons/Components/AddPhysics.cs +++ b/NewHorizons/Components/AddPhysics.cs @@ -46,7 +46,8 @@ public class AddPhysics : MonoBehaviour bodyGo.AddComponent().radius = Radius; var shape = bodyGo.AddComponent(); shape._collisionMode = Shape.CollisionMode.Detector; - shape.radius = Radius; + shape._layerMask = (int)(Shape.Layer.Default | Shape.Layer.Gravity); + shape._radius = Radius; bodyGo.AddComponent(); var fluidDetector = bodyGo.AddComponent(); fluidDetector._buoyancy = Locator.GetProbe().GetOWRigidbody()._attachedFluidDetector._buoyancy; diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index bc36264e..1b431a0e 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -189,6 +189,8 @@ namespace NewHorizons { // Patches Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly()); + // the campfire on the title screen calls this from RegisterShape before it gets patched, so we have to call it again. lol + ShapeManager.Initialize(); SceneManager.sceneLoaded += OnSceneLoaded; SceneManager.sceneUnloaded += OnSceneUnloaded; diff --git a/NewHorizons/Patches/ShapeManagerPatches.cs b/NewHorizons/Patches/ShapeManagerPatches.cs index ea6a6190..c44c94db 100644 --- a/NewHorizons/Patches/ShapeManagerPatches.cs +++ b/NewHorizons/Patches/ShapeManagerPatches.cs @@ -12,13 +12,13 @@ namespace NewHorizons.Patches { ShapeManager._exists = true; - ShapeManager._detectors = new ShapeManager.Layer(256); - for (int index = 0; index < 256; ++index) + ShapeManager._detectors = new ShapeManager.Layer(256 * 4); + for (int index = 0; index < 256 * 4; ++index) ShapeManager._detectors[index].contacts = new List(64); ShapeManager._volumes = new ShapeManager.Layer[4]; for (int index = 0; index < 4; ++index) - ShapeManager._volumes[index] = new ShapeManager.Layer(2048); + ShapeManager._volumes[index] = new ShapeManager.Layer(1024 * 2); ShapeManager._locked = false; ShapeManager._frameFlag = false;