You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add basic reference frames. This is a complex one, and is depended on by a lot of other functionality. Instances of this class don't expose any RPCs to the client, but they do have an "internal api" that is used by other parts of space center (e.g. getting the position, or rotation of the frame relative to world space).
I've started looking into this. The implementation of KSP2 coordinates/transforms etc is very different to KSP1. Reference frames appear to be basically implemented in the KSP2 API, which might make our lives very simple implementing this.
For example some test RPCs I wrote:
/// <summary>/// Vessel position in vessel reference frame/// </summary>[KRPCProperty]publicTuple3VesselPositionVesselReferenceFrame{get{varpos=InternalVessel.SimulationObject.Position;varframe=InternalVessel.transform.bodyFrame;returnframe.ToLocalPosition(pos).ToTuple();}}/// <summary>/// Vessel position in celestial body reference frame/// </summary>[KRPCProperty]publicTuple3VesselPositionCelestialBodyReferenceFrame{get{varpos=InternalVessel.SimulationObject.Position;varframe=InternalVessel.mainBody.transform.bodyFrame;returnframe.ToLocalPosition(pos).ToTuple();}}/// <summary>/// Celestial body position in celestial body reference frame/// </summary>[KRPCProperty]publicTuple3CelestialBodyPositionCelestialBodyReferenceFrame{get{varpos=InternalVessel.mainBody.SimulationObject.Position;varframe=InternalVessel.mainBody.transform.bodyFrame;returnframe.ToLocalPosition(pos).ToTuple();}}/// <summary>/// Celestial body position in vessel reference frame/// </summary>[KRPCProperty]publicTuple3CelestialBodyPositionVesselReferenceFrame{get{varpos=InternalVessel.mainBody.SimulationObject.Position;varframe=InternalVessel.transform.bodyFrame;returnframe.ToLocalPosition(pos).ToTuple();}}
Add basic reference frames. This is a complex one, and is depended on by a lot of other functionality. Instances of this class don't expose any RPCs to the client, but they do have an "internal api" that is used by other parts of space center (e.g. getting the position, or rotation of the frame relative to world space).
See https://github.com/krpc/krpc/blob/main/service/SpaceCenter/src/Services/ReferenceFrame.cs
To start just add these three main ones:
With the following methods/properties:
The text was updated successfully, but these errors were encountered: