using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography.X509Certificates; using System.Text; using VRageMath; namespace Sandbox.ModAPI.Ingame { public struct MyShipMass { /// /// Gets the base mass of the ship. /// public readonly int BaseMass; /// /// Gets the total mass of the ship, including cargo. /// public readonly int TotalMass; public MyShipMass(int mass, int totalMass) : this() { BaseMass = mass; TotalMass = totalMass; } } /// /// Describes what detail level to retrieve the planet elevation for. /// public enum MyPlanetElevation { /// /// Only return the distance to the planetary sealevel. /// Sealevel, /// /// Return the distance to the closest point of the planet. This is the same value /// displayed in the HUD. /// Surface } public struct MyShipVelocities { /// /// Gets the ship's linear velocity (motion). /// public readonly Vector3D LinearVelocity; /// /// Gets the ship's angular velocity (rotation). /// public readonly Vector3D AngularVelocity; public MyShipVelocities(Vector3D linearVelocity, Vector3D angularVelocity) : this() { LinearVelocity = linearVelocity; AngularVelocity = angularVelocity; } } public interface IMyShipController : IMyTerminalBlock { /// /// Indicates whether a block is locally or remotely controlled. /// bool IsUnderControl { get; } /// /// Indicates whether wheels are being controlled by this controller. /// bool ControlWheels { get; } /// /// Indicates whether thrusters are being controlled by this controller. /// bool ControlThrusters { get; } /// /// Indicates the current state of the handbrake. /// bool HandBrake { get; } /// /// Indicates whether dampeners are currently enabled. /// bool DampenersOverride { get; } /// /// Gets the detected natural gravity vector and power at the current location. /// /// Vector3D GetNaturalGravity(); /// /// Gets the detected artificial gravity vector and power at the current location. /// /// Vector3D GetArtificialGravity(); /// /// Gets the total accumulated gravity vector and power at the current location, /// taking both natural and artificial gravity into account. /// /// Vector3D GetTotalGravity(); /// /// Gets the basic ship speed in meters per second, for when you just need to know how fast you're going. /// /// double GetShipSpeed(); /// /// Determines the linear velocities in meters per second and angular velocities in radians per second. /// Provides a more accurate representation of the directions and axis speeds. /// MyShipVelocities GetShipVelocities(); /// /// Gets information about the current mass of the ship. /// /// MyShipMass CalculateShipMass(); /// /// Attempts to get the world position of the nearest planet. This method is only available when a ship is /// within the gravity well of a planet. /// /// /// bool TryGetPlanetPosition(out Vector3D position); /// /// Attempts to get the elevation of the ship in relation to the nearest planet. This method is only available /// when a ship is within the gravity well of a planet. /// /// /// /// bool TryGetPlanetElevation(MyPlanetElevation detail, out double elevation); /// /// Directional input from user/autopilot. Values can be very large with high controller sensitivity /// Vector3 MoveIndicator { get; } /// /// Pitch, yaw input from user/autopilot. Values can be very large with high controller sensitivity /// Vector2 RotationIndicator { get; } /// /// Roll input from user/autopilot. Values can be very large with high controller sensitivity /// float RollIndicator { get; } } }