Class MotorEngine

java.lang.Object
gaiasky.scene.component.MotorEngine
All Implemented Interfaces:
com.badlogic.ashley.core.Component, ISpacecraft, ICopy

public class MotorEngine extends Object implements com.badlogic.ashley.core.Component, ISpacecraft, ICopy
  • Field Details

    • thrustFactor

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

      public static final double thrustBase
      See Also:
    • machineName

      public String machineName
      The current name of this spacecraft
    • 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
    • mass

      public double mass
      Mass in kg
    • responsiveness

      public double responsiveness
    • drag

      public double drag
      Responsiveness in [0, 1]
    • 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
    • qf

      public com.badlogic.gdx.math.Quaternion qf
    • currentMachine

      public int currentMachine
    • machines

      public MachineDefinition[] machines
    • render

      public boolean render
  • Constructor Details

    • MotorEngine

      public MotorEngine()
  • Method Details

    • setMachines

      public void setMachines(Object[] machines)
    • 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]
    • stopAllMovement

      public void stopAllMovement()
      Specified by:
      stopAllMovement in interface ISpacecraft
    • force

      public Vector3d force()
      Specified by:
      force in interface ISpacecraft
    • accel

      public Vector3d accel()
      Specified by:
      accel in interface ISpacecraft
    • vel

      public Vector3d vel()
      Specified by:
      vel in interface ISpacecraft
    • direction

      public Vector3d direction()
      Specified by:
      direction in interface ISpacecraft
    • up

      public Vector3d up()
      Specified by:
      up in interface ISpacecraft
    • thrust

      public Vector3d thrust()
      Specified by:
      thrust in interface ISpacecraft
    • currentEnginePower

      public double currentEnginePower()
      Specified by:
      currentEnginePower in interface ISpacecraft
    • currentEnginePower

      public void currentEnginePower(double power)
      Specified by:
      currentEnginePower in interface ISpacecraft
    • thrustMagnitude

      public double thrustMagnitude()
      Specified by:
      thrustMagnitude in interface ISpacecraft
    • thrustFactor

      public double[] thrustFactor()
      Specified by:
      thrustFactor in interface ISpacecraft
    • relativisticSpeedCap

      public double relativisticSpeedCap()
      Specified by:
      relativisticSpeedCap in interface ISpacecraft
    • drag

      public double drag()
      Specified by:
      drag in interface ISpacecraft
    • mass

      public double mass()
      Specified by:
      mass in interface ISpacecraft
    • thrustFactorIndex

      public int thrustFactorIndex()
      Specified by:
      thrustFactorIndex in interface ISpacecraft
    • leveling

      public boolean leveling()
      Specified by:
      leveling in interface ISpacecraft
    • stopping

      public boolean stopping()
      Specified by:
      stopping in interface ISpacecraft
    • getCopy

      public com.badlogic.ashley.core.Component getCopy(com.badlogic.ashley.core.Engine engine)
      Specified by:
      getCopy in interface ICopy