Struct VesselContext

Source
#[repr(C)]
pub struct VesselContext { /* private fields */ }
Expand description

Rust interface to the VESSELx abstract classes in Orbiter SDK

Implementations§

Source§

impl VesselContext

Source

pub fn Local2Rel(&self, local: &VECTOR3, rel: &mut VECTOR3)

Performs a transformation from local vessel coordinates to the ecliptic frame centered at the vessel’s reference body

Source§

impl VesselContext

Source

pub fn Global2Local(&self, global: &VECTOR3, local: &mut VECTOR3)

Performs a transformation from global (ecliptic) to local vessel coordinates

Source§

impl VesselContext

Source

pub fn Local2Global(&self, local: &VECTOR3, global: &mut VECTOR3)

Performs a transformation from local vessel to global (ecliptic) coordinates

Source§

impl VesselContext

Source

pub fn SetSize(&self, size: f64)

Set the vessel’s mean radius

The size should correspond to the vessel’s visual representation, for example the mesh used to show the vessel in the simulation window. The size parameter is used by Orbiter to determine the camera distance at which the vessel is within visual range of the observer camera. It is also used for calculating various physical parameters. If SetSize is not called during the vessel setup, the value from the Size entry in the vessel’s configuration file is used.

Source§

impl VesselContext

Source

pub fn SetPMI(&self, pmi: &VECTOR3)

Set the vessel’s mass-normalised principal moments of inertia (PMI)

Source§

impl VesselContext

Source

pub fn SetEmptyMass(&self, empty_mass: f64)

Set the vessel’s empty mass (excluding propellants)

Source§

impl VesselContext

Source

pub fn SetCameraOffset(&self, camera_offset: &VECTOR3)

Set the camera position for internal (cockpit) view.

§Arguments
  • camera_offset - Camera offset in vessel coordinates
Source§

impl VesselContext

Source

pub fn SetTouchdownPoints(&self, pt1: &VECTOR3, pt2: &VECTOR3, pt3: &VECTOR3)

Defines the three points defining the vessel’s ground contact plane

Source§

impl VesselContext

Source

pub fn SetThrusterDir(&self, th: THRUSTER_HANDLE, dir: &VECTOR3)

Reset the force direction of a thruster

Source§

impl VesselContext

Source

pub fn SetThrusterLevel(&self, th: THRUSTER_HANDLE, level: f64)

Set thrust level for a thruster

Source§

impl VesselContext

Source

pub fn SetThrusterLevel_SingleStep(&self, th: THRUSTER_HANDLE, level: f64)

Set the thrust level of a thruster for the current time step only

Source§

impl VesselContext

Source

pub fn AddMesh(&self, mesh_name: String)

Load a mesh definition for the vessel from a file

Source§

impl VesselContext

Source

pub fn AddMeshWithOffset(&self, mesh_name: String, ofs: &VECTOR3)

Load a mesh definition for the vessel from a file displaced by offset ofs

§Arguments
  • mesh_name - name of the mesh file (without extension)
  • ofs - a displacement vector which describes the offset of the mesh origin against the vessel origin
Source§

impl VesselContext

Source

pub fn AddExhaust(&self, th: THRUSTER_HANDLE, lscale: f64, wscale: f64) -> usize

Add an exhaust render definition for a thruster

Source§

impl VesselContext

Source

pub fn CreatePropellantResource(&self, mass: f64) -> PROPELLANT_HANDLE

Create a new propellant resource (“fuel tank”)

Propellant resources are a component of the vessel’s propulsion system. They can hold propellants and distribute them to connected engines to generate thrust

Source§

impl VesselContext

Source

pub fn CreateThruster( &self, pos: &VECTOR3, dir: &VECTOR3, maxth0: f64, ph: PROPELLANT_HANDLE, isp: f64, ) -> THRUSTER_HANDLE

Add a logical thruster definition for the vessel

Source§

impl VesselContext

Source

pub fn CreateThrusterGroup( &self, thrusters: &[THRUSTER_HANDLE], thgroup_type: THGROUP_TYPE, ) -> THGROUP_HANDLE

Combine thrusters into a logical thruster group

Source§

impl VesselContext

Source

pub fn ClearMeshes(&self)

Remove all mesh definitions for the vessel

Source§

impl VesselContext

Source

pub fn GetName(&self) -> &str

Returns the vessel’s name

Source§

impl VesselContext

Source

pub fn GetStatus(&self, status: &mut VESSELSTATUS)

Returns the vessel’s current status parameters in a [VesselStatus] structure

Source§

impl VesselContext

Source

pub fn GetPropellantMass(&self, ph: PROPELLANT_HANDLE) -> f64

Returns the current mass of a propellant resource specified by ph

Source§

impl VesselContext

Source

pub fn GetAngularVel(&self, a_vel: &mut VECTOR3)

Get angular velocity (in rad/s) of the spacecraft around its principal axes and store it in a_vel

Source§

impl VesselContext

Source

pub fn GetAirspeedVector( &self, ref_frame: REFFRAME, airspeed: &mut VECTOR3, ) -> bool

Returns the vessel’s true “airspeed” vector

This method returns the true airspeed vector in the requested frame of reference. The ground airvector is defined as the vessel’s velocity vector with respect to the surrounding freestream air flow. If the vessel is not within an a planetary atmosphere, the returned vector is equal to the groundspeed vector

Source§

impl VesselContext

Source

pub fn GetThrustVector(&self, thrust_vec: &mut VECTOR3) -> bool

Returns thrust force vector in local vessel coordinates

Source§

impl VesselContext

Source

pub fn GetTotalPropellantMass(&self) -> f64

Returns the vessel’s current total propellant mass

Source§

impl VesselContext

Source

pub fn GetThrusterGroupLevelByType(&self, thgroup_type: THGROUP_TYPE) -> f64

Returns the mean thrust level for a default thruster group type

Source§

impl VesselContext

Source

pub fn GetThrusterGroupLevel(&self, th: THGROUP_HANDLE) -> f64

Returns the mean thrust level for a default thruster group specified by th

Source§

impl VesselContext

Source

pub fn GroundContact(&self) -> bool

Returns a flag indicating contact with a planetary surface

Source§

impl VesselContext

Source

pub fn GetSurfaceRef(&self) -> OBJHANDLE

Returns a handle to the surface reference object (planet or moon)

Source§

impl VesselContext

Source

pub fn GetSurfaceElevation(&self) -> f64

Returns the elevation of the surface at the vessel’s current longitude/latitude above the reference radius

Source§

impl VesselContext

Source

pub fn GetAltitude(&self) -> f64

Returns altitude above mean ellipsoid

Source§

impl VesselContext

Source

pub fn GetRelativeVel(&self, href: OBJHANDLE, rel_vel: &mut VECTOR3)

Returns the vessel’s current velocity relative to another object

Results are returned in the ecliptic frame (ecliptic and equinox of J2000.0).

Source§

impl VesselContext

Source

pub unsafe fn ParseScenarioLineEx(&self, line: *mut c_char, status: *mut c_void)

Pass a line read from a scenario file to Orbiter for default processing

Trait Implementations§

Source§

impl Debug for VesselContext

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl ExternType for VesselContext

Source§

type Kind = Opaque

Source§

type Id

A type-level representation of the type’s C++ namespace and type name. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.