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
FieldsModifier and TypeFieldDescriptionForce, acceleration and velocitydoubleInstantaneous engine power, do not set manuallyintDirection and up vectorscom.badlogic.gdx.math.Vector3Float counterpartsdoubleResponsiveness in [0, 1]Force, acceleration and velocitydoubleSeconds to reach full powerbooleanThe current name of this spacecraftdoubleMass in kgdoubledoubledoubledoubleYaw, pitch and rolldoublecom.badlogic.gdx.math.Vector3Float counterpartscom.badlogic.gdx.math.QuaternionbooleandoubleResponsiveness in [Constants.MIN_SC_RESPONSIVENESS,Constants.MAX_SC_RESPONSIVENESS]doubledoubledoubledoubleYaw, pitch and rolldoublecom.badlogic.gdx.math.Matrix4Only the rotation matrixbooleanEngine thrust vectorstatic final doublestatic final double[]Factor (adapt to be able to navigate small and large scale structures)intIndex of the current engine power settingdoubleThis is the magnitude of the thrustDirection and up vectorscom.badlogic.gdx.math.Vector3Float counterpartsForce, acceleration and velocitydoubledoubledoubledoubleYaw, pitch and rolldouble -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccel()doublevoidcurrentEnginePower(double power) doubledrag()force()com.badlogic.ashley.core.ComponentgetCopy(com.badlogic.ashley.core.Engine engine) booleanleveling()doublemass()doublevoidsetCurrentEnginePower(double currentEnginePower) Sets the current engine powervoidsetMachines(Object[] machines) voidsetPitchPower(double pitchp) Sets the current pitch powervoidsetRollPower(double rollp) Sets the current roll powervoidsetYawPower(double yawp) Sets the current yaw powervoidbooleanstopping()thrust()double[]intdoubleup()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:
stopAllMovementin interfaceISpacecraft
-
force
- Specified by:
forcein interfaceISpacecraft
-
accel
- Specified by:
accelin interfaceISpacecraft
-
vel
- Specified by:
velin interfaceISpacecraft
-
direction
- Specified by:
directionin interfaceISpacecraft
-
up
- Specified by:
upin interfaceISpacecraft
-
thrust
- Specified by:
thrustin interfaceISpacecraft
-
currentEnginePower
public double currentEnginePower()- Specified by:
currentEnginePowerin interfaceISpacecraft
-
currentEnginePower
public void currentEnginePower(double power) - Specified by:
currentEnginePowerin interfaceISpacecraft
-
thrustMagnitude
public double thrustMagnitude()- Specified by:
thrustMagnitudein interfaceISpacecraft
-
thrustFactor
public double[] thrustFactor()- Specified by:
thrustFactorin interfaceISpacecraft
-
relativisticSpeedCap
public double relativisticSpeedCap()- Specified by:
relativisticSpeedCapin interfaceISpacecraft
-
drag
public double drag()- Specified by:
dragin interfaceISpacecraft
-
mass
public double mass()- Specified by:
massin interfaceISpacecraft
-
thrustFactorIndex
public int thrustFactorIndex()- Specified by:
thrustFactorIndexin interfaceISpacecraft
-
leveling
public boolean leveling()- Specified by:
levelingin interfaceISpacecraft
-
stopping
public boolean stopping()- Specified by:
stoppingin interfaceISpacecraft
-
getCopy
-