mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Add tidal lock and comet tail orientation parameters
This commit is contained in:
parent
5c23772ebb
commit
ace3755cc7
@ -19,10 +19,10 @@ namespace NewHorizons.Builder.Body
|
|||||||
cometTail.name = "CometTail";
|
cometTail.name = "CometTail";
|
||||||
cometTail.transform.localScale = Vector3.one * config.Base.SurfaceSize / 110;
|
cometTail.transform.localScale = Vector3.one * config.Base.SurfaceSize / 110;
|
||||||
|
|
||||||
Vector3 alignmentAxis = new Vector3(0, -1, 0);
|
Vector3 alignment = new Vector3(0, 270, 90);
|
||||||
if (config.Orbit.AlignmentAxis != null) alignmentAxis = config.Orbit.AlignmentAxis;
|
if (config.Base.CometTailRotation != null) alignment = config.Base.CometTailRotation;
|
||||||
|
|
||||||
cometTail.transform.localRotation = Quaternion.Euler(0, 270, 90) * Quaternion.FromToRotation(new Vector3(0, -1, 0), alignmentAxis);
|
cometTail.transform.rotation = Quaternion.Euler(alignment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,7 +49,7 @@ namespace NewHorizons.Builder.Updater
|
|||||||
var planetoid = new Planet.Plantoid(
|
var planetoid = new Planet.Plantoid(
|
||||||
original.size,
|
original.size,
|
||||||
original.gravity,
|
original.gravity,
|
||||||
go.transform.rotation,
|
mapping[heavenlyBody].state.orbit.orientation.rotation,
|
||||||
InitialMotionBuilder.SiderealPeriodToAngularSpeed(body.Config.Orbit.SiderealPeriod),
|
InitialMotionBuilder.SiderealPeriodToAngularSpeed(body.Config.Orbit.SiderealPeriod),
|
||||||
parent,
|
parent,
|
||||||
coords
|
coords
|
||||||
|
|||||||
1
NewHorizons/External/BaseModule.cs
vendored
1
NewHorizons/External/BaseModule.cs
vendored
@ -17,6 +17,7 @@ namespace NewHorizons.External
|
|||||||
public float SphereOfInfluence { get; set; }
|
public float SphereOfInfluence { get; set; }
|
||||||
public float GroundSize { get; set; }
|
public float GroundSize { get; set; }
|
||||||
public bool HasCometTail { get; set; }
|
public bool HasCometTail { get; set; }
|
||||||
|
public MVector3 CometTailRotation { get; set; }
|
||||||
public bool HasReferenceFrame { get; set; } = true;
|
public bool HasReferenceFrame { get; set; } = true;
|
||||||
public bool CenterOfSolarSystem { get; set; } = false;
|
public bool CenterOfSolarSystem { get; set; } = false;
|
||||||
public bool IsSatellite { get; set; }
|
public bool IsSatellite { get; set; }
|
||||||
|
|||||||
@ -172,6 +172,10 @@
|
|||||||
"default": false,
|
"default": false,
|
||||||
"description": "If you want the body to have a tail like the Interloper."
|
"description": "If you want the body to have a tail like the Interloper."
|
||||||
},
|
},
|
||||||
|
"cometTailRotation": {
|
||||||
|
"type": "#/$defs/vector3",
|
||||||
|
"description": "If it has a comet tail, it'll be oriented according to these Euler angles."
|
||||||
|
},
|
||||||
"hasReferenceFrame": {
|
"hasReferenceFrame": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true,
|
"default": true,
|
||||||
@ -317,6 +321,10 @@
|
|||||||
"default": false,
|
"default": false,
|
||||||
"description": "Should the body always have one side facing its primary?"
|
"description": "Should the body always have one side facing its primary?"
|
||||||
},
|
},
|
||||||
|
"alignmentAxis": {
|
||||||
|
"type": "#/$defs/vector3",
|
||||||
|
"description": "If it is tidally locked, this direction will face towards the primary. Ex) Interloper uses 0, -1, 0. Most planets will want something like -1, 0, 0."
|
||||||
|
},
|
||||||
"showOrbitLine": {
|
"showOrbitLine": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": false,
|
"default": false,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user