Package gaiasky.scene.view
Class SpacecraftView
java.lang.Object
gaiasky.scene.view.AbstractView
gaiasky.scene.view.BaseView
gaiasky.scene.view.SpacecraftView
- All Implemented Interfaces:
ISpacecraft
-
Field Summary
Fields inherited from class gaiasky.scene.view.AbstractView
entity
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaccel()
double
computeDirectionUp
(double dt, Pair<Vector3d, Vector3d> pair) double
void
currentEnginePower
(double power) void
decreaseThrustFactorIndex
(boolean broadcast) double
drag()
protected void
Contains actions to take after a new entity has been set.protected void
entityCheck
(com.badlogic.ashley.core.Entity entity) Checks whether the given entity is suitable for this view.protected void
This method is called when the entity of this view is cleared.force()
int
double
getDrag()
double
double
double
com.badlogic.gdx.math.Quaternion
double
void
increaseThrustFactorIndex
(boolean broadcast) boolean
boolean
boolean
leveling()
double
mass()
void
pollKeys
(double dt) pos()
double
void
setCurrentEnginePower
(double currentEnginePower) Sets the current engine powervoid
setPitchPower
(double pitchp) Sets the current pitch powervoid
setRollPower
(double rollp) Sets the current roll powervoid
setThrustFactorIndex
(int i, boolean broadcast) void
setYawPower
(double yawp) Sets the current yaw powerfloat
size()
void
boolean
stopping()
thrust()
double[]
int
double
up()
vel()
Methods inherited from class gaiasky.scene.view.BaseView
componentsCheck, getBase, getBody, getComponent, getOpacity, hasCt, isForceLabel, isVisible, isVisible, setColor, setForcelabel, setForceLabel, setVisible, setVisible
Methods inherited from class gaiasky.scene.view.AbstractView
check, clearEntity, getEntity, isEmpty, isValid, setEntity
-
Field Details
-
engine
-
coord
-
-
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 aRuntimeException
if the entity is not suitable.- Overrides:
entityCheck
in classBaseView
- 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 classBaseView
-
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 classBaseView
-
isStopping
public boolean isStopping() -
isStabilising
public boolean isStabilising() -
getMachines
-
getCurrentMachine
public int getCurrentMachine() -
force
- Specified by:
force
in interfaceISpacecraft
-
accel
- Specified by:
accel
in interfaceISpacecraft
-
pos
-
vel
- Specified by:
vel
in interfaceISpacecraft
-
direction
- Specified by:
direction
in interfaceISpacecraft
-
up
- Specified by:
up
in interfaceISpacecraft
-
thrust
- Specified by:
thrust
in interfaceISpacecraft
-
size
public float size() -
getResponsiveness
public double getResponsiveness() -
getDrag
public double getDrag() -
currentEnginePower
public double currentEnginePower()- Specified by:
currentEnginePower
in interfaceISpacecraft
-
currentEnginePower
public void currentEnginePower(double power) - Specified by:
currentEnginePower
in interfaceISpacecraft
-
thrustMagnitude
public double thrustMagnitude()- Specified by:
thrustMagnitude
in interfaceISpacecraft
-
thrustFactor
public double[] thrustFactor()- Specified by:
thrustFactor
in interfaceISpacecraft
-
relativisticSpeedCap
public double relativisticSpeedCap()- Specified by:
relativisticSpeedCap
in interfaceISpacecraft
-
drag
public double drag()- Specified by:
drag
in interfaceISpacecraft
-
mass
public double mass()- Specified by:
mass
in interfaceISpacecraft
-
thrustFactorIndex
public int thrustFactorIndex()- Specified by:
thrustFactorIndex
in interfaceISpacecraft
-
leveling
public boolean leveling()- Specified by:
leveling
in interfaceISpacecraft
-
stopping
public boolean stopping()- Specified by:
stopping
in interfaceISpacecraft
-
getRotationQuaternion
public com.badlogic.gdx.math.Quaternion getRotationQuaternion() -
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 interfaceISpacecraft
-
increaseThrustFactorIndex
public void increaseThrustFactorIndex(boolean broadcast) -
decreaseThrustFactorIndex
public void decreaseThrustFactorIndex(boolean broadcast) -
setThrustFactorIndex
public void setThrustFactorIndex(int i, boolean broadcast) -
computeDirectionUp
-
pollKeys
public void pollKeys(double dt)
-