Class Spacecraft

All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, IObserver, I3DTextRenderable, ILineRenderable, IModelRenderable, IQuadRenderable, IRenderable, IFocus, IStarContainer, IVisibilitySwitch, IPosition

public class Spacecraft extends GenericSpacecraft implements ILineRenderable, IObserver
The spacecraft
  • Field Details

    • thrustFactor

      public static final double[] thrustFactor
      Factor (adapt to be able to navigate small and large scale structures)
    • fullPowerTime

      public double fullPowerTime
      Seconds to reach full power
    • force

      public Vector3d force
      Force, acceleration and velocity
    • accel

      public Vector3d accel
      Force, acceleration and velocity
    • vel

      public Vector3d vel
      Force, acceleration and velocity
    • direction

      public Vector3d direction
      Direction and up vectors
    • up

      public Vector3d up
      Direction and up vectors
    • dirup

      public Pair<Vector3d,​Vector3d> dirup
    • posf

      public com.badlogic.gdx.math.Vector3 posf
      Float counterparts
    • directionf

      public com.badlogic.gdx.math.Vector3 directionf
      Float counterparts
    • upf

      public com.badlogic.gdx.math.Vector3 upf
      Float counterparts
    • currentEnginePower

      public double currentEnginePower
      Instantaneous engine power, do not set manually
    • thrust

      public Vector3d thrust
      Engine thrust vector
    • thrustMagnitude

      public double thrustMagnitude
      This is the magnitude of the thrust
    • rotationMatrix

      public com.badlogic.gdx.math.Matrix4 rotationMatrix
      Only the rotation matrix
    • thrustFactorIndex

      public int thrustFactorIndex
      Index of the current engine power setting
    • yawp

      public double yawp
      Yaw, pitch and roll
    • pitchp

      public double pitchp
      Yaw, pitch and roll
    • rollp

      public double rollp
      Yaw, pitch and roll
    • yawf

      public double yawf
    • pitchf

      public double pitchf
    • rollf

      public double rollf
    • yawa

      public double yawa
    • pitcha

      public double pitcha
    • rolla

      public double rolla
    • yawv

      public double yawv
    • pitchv

      public double pitchv
    • rollv

      public double rollv
    • yaw

      public double yaw
    • pitch

      public double pitch
    • roll

      public double roll
    • leveling

      public boolean leveling
    • stopping

      public boolean stopping
  • Constructor Details

    • Spacecraft

      public Spacecraft()
  • Method Details

    • initialize

      public void initialize()
      Overrides:
      initialize in class Satellite
    • doneLoading

      public void doneLoading(com.badlogic.gdx.assets.AssetManager manager)
      Overrides:
      doneLoading in class Satellite
    • notify

      public void notify(Events event, Object... data)
      Description copied from interface: IObserver
      Event notification call.
      Specified by:
      notify in interface IObserver
      Parameters:
      event - The event type.
      data - The data associated with this event.
    • updateLocal

      public void updateLocal(ITimeFrameProvider time, ICamera camera)
      Description copied from class: SceneGraphNode
      Updates the transform matrix with the transformations that will apply to the children and the local transform matrix with the transformations that will apply only to this object.
      Overrides:
      updateLocal in class ModelBody
    • updateLocalTransform

      protected void updateLocalTransform()
      Description copied from class: ModelBody
      Update the local transform with the transform and the rotations/scales necessary. Override if your model contains more than just the position and size.
      Overrides:
      updateLocalTransform in class Satellite
    • computePosition

      public Vector3b computePosition(double dt, IFocus closest, double currentEnginePower, Vector3d thrust, Vector3d direction, Vector3d force, Vector3d accel, Vector3d vel, Vector3b posb)
    • computeDirectionUp

      public double computeDirectionUp(double dt, Pair<Vector3d,​Vector3d> pair)
    • updateLocalValues

      public void updateLocalValues(ITimeFrameProvider time, ICamera camera)
      Description copied from class: SceneGraphNode
      This function updates all the local values before the localTransform is updated. Position, rotations and scale must be updated in here.
      Overrides:
      updateLocalValues in class Satellite
    • stopAllMovement

      public void stopAllMovement()
    • setCurrentEnginePower

      public void setCurrentEnginePower(double currentEnginePower)
      Sets the current engine power
      Parameters:
      currentEnginePower - The power in [-1..1]
    • setYawPower

      public void setYawPower(double yawp)
      Sets the current yaw power
      Parameters:
      yawp - The yaw power in [-1..1]
    • setPitchPower

      public void setPitchPower(double pitchp)
      Sets the current pitch power
      Parameters:
      pitchp - The pitch power in [-1..1]
    • setRollPower

      public void setRollPower(double rollp)
      Sets the current roll power
      Parameters:
      rollp - The roll power in [-1..1]
    • increaseThrustFactorIndex

      public void increaseThrustFactorIndex(boolean broadcast)
    • decreaseThrustFactorIndex

      public void decreaseThrustFactorIndex(boolean broadcast)
    • setThrustFactorIndex

      public void setThrustFactorIndex(int i, boolean broadcast)
    • addToRenderLists

      protected void addToRenderLists(ICamera camera)
      Adds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.
      Overrides:
      addToRenderLists in class GenericSpacecraft
    • setModel

      public void setModel(ModelComponent mc)
      Overrides:
      setModel in class ModelBody
    • setSize

      public void setSize(Double size)
      Sets the absolute size of this entity
      Overrides:
      setSize in class Satellite
      Parameters:
      size - The size in km
    • setSize

      public void setSize(Long size)
      Description copied from class: SceneGraphNode
      Sets the absolute size (diameter) of this entity
      Overrides:
      setSize in class Satellite
      Parameters:
      size - The diameter in internal units
    • setMass

      public void setMass(Double mass)
    • isStopping

      public boolean isStopping()
    • isStabilising

      public boolean isStabilising()
    • getDistToCamera

      public double getDistToCamera()
      Description copied from class: SceneGraphNode
      Returns the current distance to the camera in internal units.
      Specified by:
      getDistToCamera in interface IFocus
      Specified by:
      getDistToCamera in interface IRenderable
      Overrides:
      getDistToCamera in class SceneGraphNode
      Returns:
      The current distance to the camera, in internal units.
    • getRotationQuaternion

      public com.badlogic.gdx.math.Quaternion getRotationQuaternion()
    • hasAtmosphere

      public boolean hasAtmosphere()
      Specified by:
      hasAtmosphere in interface IModelRenderable
      Overrides:
      hasAtmosphere in class CelestialBody
    • dispose

      public void dispose()
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class ModelBody
    • render

      public void render(IntModelBatch modelBatch, float alpha, double t, RenderingContext rc, SceneGraphRenderer.RenderGroup group)
      Model rendering. SPACECRAFT_MODE in spacecraft mode is not affected by the relativistic aberration
      Specified by:
      render in interface IModelRenderable
      Overrides:
      render in class ModelBody
    • render

      public void render(IntModelBatch modelBatch, float alpha, double t, boolean shadowEnv)
      Default model rendering.
    • render

      public void render(LineRenderSystem renderer, ICamera camera, float alpha)
      Specified by:
      render in interface ILineRenderable
    • getSimpleCopy

      public <T extends SceneGraphNode> T getSimpleCopy()
      Description copied from class: SceneGraphNode
      Gets a copy of this object but does not copy its parent or children.
      Overrides:
      getSimpleCopy in class CelestialBody
      Returns:
      The copied object.
    • labelFactor

      protected float labelFactor()
      Overrides:
      labelFactor in class Satellite
    • mustUpdatePosition

      protected boolean mustUpdatePosition(ITimeFrameProvider time)
      Description copied from class: SceneGraphNode
      Whether position must be recomputed for this entity. By default, only when time is on
      Overrides:
      mustUpdatePosition in class SceneGraphNode
      Parameters:
      time - The current time
      Returns:
      True if position should be recomputed for this entity
    • getLineWidth

      public float getLineWidth()
      Specified by:
      getLineWidth in interface ILineRenderable
    • getGlPrimitive

      public int getGlPrimitive()
      Specified by:
      getGlPrimitive in interface ILineRenderable
    • getResponsiveness

      public double getResponsiveness()
    • getDrag

      public double getDrag()
    • getMachines

      public MachineDefinition[] getMachines()
    • setMachines

      public void setMachines(Object[] machines)
    • getCurrentMachine

      public int getCurrentMachine()