Package gaiasky.scene.component
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 Summary
Modifier and TypeFieldDescriptionForce, acceleration and velocitydouble
Instantaneous engine power, do not set manuallyint
Direction and up vectorscom.badlogic.gdx.math.Vector3
Float counterpartsdouble
Responsiveness in [0, 1]Force, acceleration and velocitydouble
Seconds to reach full powerboolean
The current name of this spacecraftdouble
Mass in kgdouble
double
double
double
Yaw, pitch and rolldouble
com.badlogic.gdx.math.Vector3
Float counterpartscom.badlogic.gdx.math.Quaternion
boolean
double
Responsiveness in [Constants.MIN_SC_RESPONSIVENESS
,Constants.MAX_SC_RESPONSIVENESS
]double
double
double
double
Yaw, pitch and rolldouble
com.badlogic.gdx.math.Matrix4
Only the rotation matrixboolean
Engine thrust vectorstatic final double
static final double[]
Factor (adapt to be able to navigate small and large scale structures)int
Index of the current engine power settingdouble
This is the magnitude of the thrustDirection and up vectorscom.badlogic.gdx.math.Vector3
Float counterpartsForce, acceleration and velocitydouble
double
double
double
Yaw, pitch and rolldouble
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaccel()
double
void
currentEnginePower
(double power) double
drag()
force()
com.badlogic.ashley.core.Component
getCopy
(com.badlogic.ashley.core.Engine engine) boolean
leveling()
double
mass()
double
void
setCurrentEnginePower
(double currentEnginePower) Sets the current engine powervoid
setMachines
(Object[] machines) void
setPitchPower
(double pitchp) Sets the current pitch powervoid
setRollPower
(double rollp) Sets the current roll powervoid
setYawPower
(double yawp) Sets the current yaw powervoid
boolean
stopping()
thrust()
double[]
int
double
up()
vel()
-
Field Details
-
thrustFactor
public static final double[] thrustFactorFactor (adapt to be able to navigate small and large scale structures) -
thrustBase
public static final double thrustBase- See Also:
-
machineName
The current name of this spacecraft -
fullPowerTime
public double fullPowerTimeSeconds to reach full power -
force
Force, acceleration and velocity -
accel
Force, acceleration and velocity -
vel
Force, acceleration and velocity -
direction
Direction and up vectors -
up
Direction and up vectors -
dirup
-
posf
public com.badlogic.gdx.math.Vector3 posfFloat counterparts -
directionf
public com.badlogic.gdx.math.Vector3 directionfFloat counterparts -
upf
public com.badlogic.gdx.math.Vector3 upfFloat counterparts -
currentEnginePower
public double currentEnginePowerInstantaneous engine power, do not set manually -
thrust
Engine thrust vector -
thrustMagnitude
public double thrustMagnitudeThis is the magnitude of the thrust -
mass
public double massMass in kg -
responsiveness
public double responsivenessResponsiveness in [Constants.MIN_SC_RESPONSIVENESS
,Constants.MAX_SC_RESPONSIVENESS
] -
drag
public double dragResponsiveness in [0, 1] -
rotationMatrix
public com.badlogic.gdx.math.Matrix4 rotationMatrixOnly the rotation matrix -
thrustFactorIndex
public int thrustFactorIndexIndex of the current engine power setting -
yawp
public double yawpYaw, pitch and roll -
pitchp
public double pitchpYaw, pitch and roll -
rollp
public double rollpYaw, 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
-
render
public boolean render
-
-
Constructor Details
-
MotorEngine
public MotorEngine()
-
-
Method Details
-
setMachines
-
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
-
force
- Specified by:
force
in interfaceISpacecraft
-
accel
- Specified by:
accel
in interfaceISpacecraft
-
vel
- Specified by:
vel
in interfaceISpacecraft
-
direction
- Specified by:
direction
in interfaceISpacecraft
-
up
- Specified by:
up
in interfaceISpacecraft
-
thrust
- Specified by:
thrust
in interfaceISpacecraft
-
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
-
getCopy
public com.badlogic.ashley.core.Component getCopy(com.badlogic.ashley.core.Engine engine)
-