mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Allow computers to align to a given normal
This commit is contained in:
parent
c648fbe428
commit
09a24844e8
@ -161,6 +161,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
computerObject.transform.localPosition = info?.position ?? Vector3.zero;
|
computerObject.transform.localPosition = info?.position ?? Vector3.zero;
|
||||||
|
|
||||||
var up = computerObject.transform.position - go.transform.position;
|
var up = computerObject.transform.position - go.transform.position;
|
||||||
|
if (info.normal != null) up = go.transform.TransformDirection(info.normal);
|
||||||
computerObject.transform.rotation = Quaternion.FromToRotation(Vector3.up, up) * computerObject.transform.rotation;
|
computerObject.transform.rotation = Quaternion.FromToRotation(Vector3.up, up) * computerObject.transform.rotation;
|
||||||
|
|
||||||
var computer = computerObject.GetComponent<NomaiComputer>();
|
var computer = computerObject.GetComponent<NomaiComputer>();
|
||||||
|
|||||||
@ -936,7 +936,7 @@
|
|||||||
},
|
},
|
||||||
"normal": {
|
"normal": {
|
||||||
"$ref": "#/$defs/vector3",
|
"$ref": "#/$defs/vector3",
|
||||||
"description": "The normal vector for this object. Only used for writing on walls to orient it properly."
|
"description": "The normal vector for this object. Used for writing on walls and positioning computers."
|
||||||
},
|
},
|
||||||
"rotation": {
|
"rotation": {
|
||||||
"$ref": "#/$defs/vector3",
|
"$ref": "#/$defs/vector3",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user