Class SpacecraftView

All Implemented Interfaces:
ISpacecraft

public class SpacecraftView extends BaseView implements ISpacecraft
  • Field Details

  • Constructor Details

    • SpacecraftView

      public SpacecraftView()
  • Method Details

    • entityCheck

      protected void entityCheck(com.badlogic.ashley.core.Entity entity)
      Description copied from class: AbstractView
      Checks whether the given entity is suitable for this view. This method should throw a RuntimeException if the entity is not suitable.
      Overrides:
      entityCheck in class BaseView
      Parameters:
      entity - The entity.
    • entityChanged

      protected void entityChanged()
      Description copied from class: AbstractView
      Contains actions to take after a new entity has been set. This method is typically used to initialize the view components.
      Overrides:
      entityChanged in class BaseView
    • entityCleared

      protected void entityCleared()
      Description copied from class: AbstractView
      This method is called when the entity of this view is cleared. It should set all component references to null.
      Overrides:
      entityCleared in class BaseView
    • isStopping

      public boolean isStopping()
    • isStabilising

      public boolean isStabilising()
    • getMachines

      public MachineDefinition[] getMachines()
    • getCurrentMachine

      public int getCurrentMachine()
    • force

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

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

      public Vector3b pos()
    • 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
    • size

      public float size()
    • getResponsiveness

      public double getResponsiveness()
    • getDrag

      public double getDrag()
    • 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
    • getRotationQuaternion

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

      public IBodyCoordinates getCoordinates()
    • getYawPower

      public double getYawPower()
    • getPitchPower

      public double getPitchPower()
    • getRollPower

      public double getRollPower()
    • 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
    • increaseThrustFactorIndex

      public void increaseThrustFactorIndex(boolean broadcast)
    • decreaseThrustFactorIndex

      public void decreaseThrustFactorIndex(boolean broadcast)
    • setThrustFactorIndex

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

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

      public void pollKeys(double dt)