## Improvements
- Renamed `addPhysics` to `pushable` really quick before anyone could
use it.
This commit is contained in:
Will Corby 2023-08-11 15:56:33 -07:00 committed by GitHub
commit c9511a1841
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 9 additions and 13 deletions

View File

@ -33,18 +33,16 @@ namespace NewHorizons.Builder.General
owRigidBody.EnableKinematicSimulation(); owRigidBody.EnableKinematicSimulation();
rigidBody.mass = 10000; rigidBody.mass = 10000;
if (config.Base.addPhysics) if (config.Base.pushable)
{ {
// hack: make all mesh colliders convex // hack: make all mesh colliders convex
// triggers are already convex // triggers are already convex
// prints errors for non readable meshes but whatever // doesnt work for some non readable meshes but whatever
foreach (var meshCollider in body.GetComponentsInChildren<MeshCollider>(true)) foreach (var meshCollider in body.GetComponentsInChildren<MeshCollider>(true))
meshCollider.convex = true; meshCollider.convex = true;
var shape = body.AddComponent<SphereShape>(); // backup collider in case of no convex colliders
shape._collisionMode = Shape.CollisionMode.Detector; body.AddComponent<SphereCollider>().radius = config.Base.surfaceSize;
shape._layerMask = (int)(Shape.Layer.Default | Shape.Layer.Gravity);
shape._radius = config.Base.surfaceSize;
var impactSensor = body.AddComponent<ImpactSensor>(); var impactSensor = body.AddComponent<ImpactSensor>();
var audioSource = body.AddComponent<AudioSource>(); var audioSource = body.AddComponent<AudioSource>();

View File

@ -84,7 +84,7 @@ namespace NewHorizons.Builder.Orbital
Delay.FireOnNextUpdate(orbitLine.InitializeLineRenderer); Delay.FireOnNextUpdate(orbitLine.InitializeLineRenderer);
// If the planet has physics and a regular orbit line, make sure that when it's bumped into the old orbit line vanishes // If the planet has physics and a regular orbit line, make sure that when it's bumped into the old orbit line vanishes
if (config.Base.addPhysics && !config.Orbit.trackingOrbitLine) if (config.Base.pushable && !config.Orbit.trackingOrbitLine)
{ {
var impactSensor = planetGO.GetComponent<ImpactSensor>(); var impactSensor = planetGO.GetComponent<ImpactSensor>();
impactSensor.OnImpact += (ImpactData _) => impactSensor.OnImpact += (ImpactData _) =>

View File

@ -34,7 +34,7 @@ public class AddPhysics : MonoBehaviour
// hack: make all mesh colliders convex // hack: make all mesh colliders convex
// triggers are already convex // triggers are already convex
// prints errors for non readable meshes but whatever // doesnt work for some non readable meshes but whatever
foreach (var meshCollider in GetComponentsInChildren<MeshCollider>(true)) foreach (var meshCollider in GetComponentsInChildren<MeshCollider>(true))
meshCollider.convex = true; meshCollider.convex = true;

View File

@ -77,7 +77,7 @@ namespace NewHorizons.External.Modules
/// This is meant for stuff like satellites which are relatively simple and can be de-orbited. /// This is meant for stuff like satellites which are relatively simple and can be de-orbited.
/// If you are using an orbit line but a tracking line, it will be removed when the planet is bumped in to. /// If you are using an orbit line but a tracking line, it will be removed when the planet is bumped in to.
/// </summary> /// </summary>
public bool addPhysics; public bool pushable;
#region Obsolete #region Obsolete

View File

@ -622,8 +622,6 @@ namespace NewHorizons
{ {
try try
{ {
if (mod.ModHelper.Manifest.Filename.Contains("Extinction")) return;
if (_firstLoad) if (_firstLoad)
{ {
MountedAddons.Add(mod); MountedAddons.Add(mod);

View File

@ -574,7 +574,7 @@
"format": "int32", "format": "int32",
"default": 0 "default": 0
}, },
"addPhysics": { "pushable": {
"type": "boolean", "type": "boolean",
"description": "Apply physics to this planet when you bump into it. Will have a spherical collider the size of surfaceSize. \nFor custom colliders they have to all be convex and you can leave surface size as 0.\nThis is meant for stuff like satellites which are relatively simple and can be de-orbited.\nIf you are using an orbit line but a tracking line, it will be removed when the planet is bumped in to." "description": "Apply physics to this planet when you bump into it. Will have a spherical collider the size of surfaceSize. \nFor custom colliders they have to all be convex and you can leave surface size as 0.\nThis is meant for stuff like satellites which are relatively simple and can be de-orbited.\nIf you are using an orbit line but a tracking line, it will be removed when the planet is bumped in to."
} }

View File

@ -4,7 +4,7 @@
"author": "xen, Bwc9876, clay, MegaPiggy, John, Trifid, Hawkbar, Book", "author": "xen, Bwc9876, clay, MegaPiggy, John, Trifid, Hawkbar, Book",
"name": "New Horizons", "name": "New Horizons",
"uniqueName": "xen.NewHorizons", "uniqueName": "xen.NewHorizons",
"version": "1.14.1", "version": "1.14.2",
"owmlVersion": "2.9.3", "owmlVersion": "2.9.3",
"dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ], "dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ],
"conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_CommonResources" ], "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_CommonResources" ],