Package gaiasky.scenegraph
Class Spacecraft
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,IObserver
,I3DTextRenderable
,ILineRenderable
,IModelRenderable
,IQuadRenderable
,IRenderable
,IFocus
,IStarContainer
,IVisibilitySwitch
,IPosition
The spacecraft
-
Field Summary
FieldsModifier and TypeFieldDescriptionForce, acceleration and velocitydouble
Instantaneous engine power, do not set manuallyDirection and up vectorscom.badlogic.gdx.math.Vector3
Float counterpartsForce, acceleration and velocitydouble
Seconds to reach full powerboolean
double
double
double
double
Yaw, pitch and rolldouble
com.badlogic.gdx.math.Vector3
Float counterpartsdouble
double
double
double
Yaw, pitch and rolldouble
com.badlogic.gdx.math.Matrix4
Only the rotation matrixboolean
Engine thrust vectorstatic 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
Fields inherited from class gaiasky.scenegraph.GenericSpacecraft
renderQuad
Fields inherited from class gaiasky.scenegraph.Satellite
hidden, orientationf, parentOrientation, parentrc
Fields inherited from class gaiasky.scenegraph.ModelBody
fadeOpacity, inverseRefPlaneTransform, locThresholdLabel, locVaMultiplier, mc, randomize, refPlane, refPlaneTransform, seed, shadow, shadowMapValues, sizeScaleFactor, transformations
Fields inherited from class gaiasky.scenegraph.CelestialBody
absmag, appmag, ccPale, colorbv, compalpha, coordinatesTimeOverflow, labelFactor, labelMax, primitiveRenderScale, rc, textScale, thresholdLabel, thresholdNone, thresholdPoint, thresholdQuad, wikiname
Fields inherited from class gaiasky.scenegraph.SceneGraphNode
B31, B32, B33, B34, cc, children, computed, coordinates, copy, ct, D31, D32, D33, D34, distToCamera, F31, F32, F33, F34, forceLabel, id, labelcolor, lastStateChangeTimeMs, localizedNameIndex, localTransform, names, numChildren, octant, octantId, opacity, orientation, parent, parentName, pos, posSph, ROOT_NAME, size, translation, viewAngle, viewAngleApparent, visible
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addToRenderLists
(ICamera camera) Adds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.double
computeDirectionUp
(double dt, Pair<Vector3d, Vector3d> pair) computePosition
(double dt, IFocus closest, double currentEnginePower, Vector3d thrust, Vector3d direction, Vector3d force, Vector3d accel, Vector3d vel, Vector3b posb) void
decreaseThrustFactorIndex
(boolean broadcast) void
dispose()
void
doneLoading
(com.badlogic.gdx.assets.AssetManager manager) int
double
Returns the current distance to the camera in internal units.double
getDrag()
int
float
double
com.badlogic.gdx.math.Quaternion
<T extends SceneGraphNode>
TGets a copy of this object but does not copy its parent or children.boolean
void
increaseThrustFactorIndex
(boolean broadcast) void
boolean
boolean
protected boolean
Whether position must be recomputed for this entity.void
Event notification call.void
render
(LineRenderSystem renderer, ICamera camera, float alpha) void
render
(IntModelBatch modelBatch, float alpha, double t, boolean shadowEnv) Default model rendering.void
render
(IntModelBatch modelBatch, float alpha, double t, RenderingContext rc, SceneGraphRenderer.RenderGroup group) Model rendering.void
setCurrentEnginePower
(double currentEnginePower) Sets the current engine powervoid
setMachines
(Object[] machines) void
void
void
setPitchPower
(double pitchp) Sets the current pitch powervoid
setRollPower
(double rollp) Sets the current roll powervoid
Sets the absolute size of this entityvoid
Sets the absolute size (diameter) of this entityvoid
setThrustFactorIndex
(int i, boolean broadcast) void
setYawPower
(double yawp) Sets the current yaw powervoid
void
updateLocal
(ITimeFrameProvider time, ICamera camera) Updates the transform matrix with the transformations that will apply to the children and the local transform matrix with the transformations that will apply only to this object.protected void
Update the local transform with the transform and the rotations/scales necessary.void
updateLocalValues
(ITimeFrameProvider time, ICamera camera) This function updates all the local values before the localTransform is updated.Methods inherited from class gaiasky.scenegraph.GenericSpacecraft
setRenderquad, setRenderquad
Methods inherited from class gaiasky.scenegraph.Satellite
forceUpdatePosition, getFuzzyRenderSize, getRotationComponent, getThOverFactorScl, getViewAnglePow, renderText, setHidden, setParentorientation, setToLocalTransform
Methods inherited from class gaiasky.scenegraph.ModelBody
addHit, addHit, getHeight, getHeight, getHeight, getHeightScale, getInnerRad, getMaterialComponent, getModelComponent, getPositionAboveSurface, getRadius, getSeed, getSize, isRandomizeAtmosphere, isRandomizeCloud, isRandomizeModel, isShadow, labelSizeConcrete, prepareShadowEnvironment, render, render, renderTessellated, setLocthoverfactor, setLocThresholdLabel, setLocvamultiplier, setLocViewAngleMultiplier, setRandomize, setRandomize, setRefplane, setSeed, setSeed, setShadowvalues, setSizescalefactor, setToLocalTransform, setTransformations, textScale
Methods inherited from class gaiasky.scenegraph.CelestialBody
addFocusableObjects, checkClickDistance, checkHitCondition, computeViewAngle, getAbsmag, getAppmag, getCandidateId, getCandidateName, getCandidateViewAngleApparent, getClosestAbsolutePos, getClosestDistToCamera, getClosestName, getFocus, getOrientationQuaternion, getPmX, getPmY, getPmZ, getTextOpacity, getViewAngle, getWikiname, isActive, isCoordinatesTimeOverflow, isLabel, isStar, isValidPosition, makeFocus, render, setAbsmag, setAltname, setAppmag, setColor2Data, setColorbv, setLabelFactor, setLabelMax, setMag, setPrimitiveRenderScale, setRotation, setTextScale, setThresholdNone, setThresholdPoint, setThresholdQuad, setWikiname, text, textColour, textDepthBuffer, textPosition, textSize
Methods inherited from class gaiasky.scenegraph.SceneGraphNode
add, add, addChild, addChild, addName, addNodes, addToIndex, addToRender, computeFuturePosition, getAbsoluteOrientation, getAbsolutePosition, getAbsolutePosition, getAggregatedChildren, getAlpha, getChildByName, getChildByNameAndType, getChildrenByComponentType, getChildrenByType, getColor, getComponentType, getCoordinates, getCt, getDelta, getDescription, getFirstStarAncestor, getId, getLabelcolor, getLineCopy, getLocalizedName, getName, getNames, getNext, getNode, getNode, getOctant, getOpacity, getOrientation, getPos, getPosition, getPosition, getPosSph, getPredictedPosition, getRoot, getSceneGraphDepth, getStarCount, getUnrotatedPos, getVelocity, getViewAngleApparent, getVisibilityOpacityFactor, hasCt, hasName, hasName, insert, isCopy, isForceLabel, isForceLabel, isInRender, isInRender, isVisibilityOn, isVisible, isVisible, isVisible, isVisibleGroup, isVisibleGroup, msSinceStateChange, mustAddToIndex, namesConcat, removeChild, removeFromIndex, removeFromRender, render2DLabel, render2DLabel, render2DLabel, render2DLabel, render3DLabel, render3DLabel, returnToPool, setColor, setColor, setComputedFlag, setCoordinates, setCt, setCt, setDescription, setForcelabel, setForceLabel, setForceLabel, setId, setLabelcolor, setLabelcolor, setLabelcolor, setName, setName, setNames, setParent, setPos, setUp, setVisible, setVisible, setVisibleGroup, shouldRender, toString, update, update, updateLocalizedName, updateLocalizedNameRecursive
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface gaiasky.scenegraph.IFocus
getAbsolutePosition, getAbsolutePosition, getAlpha, getColor, getCt, getDelta, getFirstStarAncestor, getId, getLocalizedName, getName, getNames, getNext, getOctant, getOrientation, getPos, getPosSph, getPredictedPosition, getSceneGraphDepth, getViewAngleApparent, hasName, hasName, isCopy
Methods inherited from interface gaiasky.render.IRenderable
getComponentType, getOpacity
-
Field Details
-
thrustFactor
public static final double[] thrustFactorFactor (adapt to be able to navigate small and large scale structures) -
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 -
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
-
-
Constructor Details
-
Spacecraft
public Spacecraft()
-
-
Method Details
-
initialize
public void initialize()- Overrides:
initialize
in classSatellite
-
doneLoading
public void doneLoading(com.badlogic.gdx.assets.AssetManager manager) - Overrides:
doneLoading
in classSatellite
-
notify
Description copied from interface:IObserver
Event notification call. -
updateLocal
Description copied from class:SceneGraphNode
Updates the transform matrix with the transformations that will apply to the children and the local transform matrix with the transformations that will apply only to this object.- Overrides:
updateLocal
in classModelBody
-
updateLocalTransform
protected void updateLocalTransform()Description copied from class:ModelBody
Update the local transform with the transform and the rotations/scales necessary. Override if your model contains more than just the position and size.- Overrides:
updateLocalTransform
in classSatellite
-
computePosition
-
computeDirectionUp
-
updateLocalValues
Description copied from class:SceneGraphNode
This function updates all the local values before the localTransform is updated. Position, rotations and scale must be updated in here.- Overrides:
updateLocalValues
in classSatellite
-
stopAllMovement
public void stopAllMovement() -
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]
-
increaseThrustFactorIndex
public void increaseThrustFactorIndex(boolean broadcast) -
decreaseThrustFactorIndex
public void decreaseThrustFactorIndex(boolean broadcast) -
setThrustFactorIndex
public void setThrustFactorIndex(int i, boolean broadcast) -
addToRenderLists
Adds this entity to the necessary render lists after the distance to the camera and the view angle have been determined.- Overrides:
addToRenderLists
in classGenericSpacecraft
-
setModel
-
setSize
Sets the absolute size of this entity -
setSize
Description copied from class:SceneGraphNode
Sets the absolute size (diameter) of this entity -
setMass
-
isStopping
public boolean isStopping() -
isStabilising
public boolean isStabilising() -
getDistToCamera
public double getDistToCamera()Description copied from class:SceneGraphNode
Returns the current distance to the camera in internal units.- Specified by:
getDistToCamera
in interfaceIFocus
- Specified by:
getDistToCamera
in interfaceIRenderable
- Overrides:
getDistToCamera
in classSceneGraphNode
- Returns:
- The current distance to the camera, in internal units.
-
getRotationQuaternion
public com.badlogic.gdx.math.Quaternion getRotationQuaternion() -
hasAtmosphere
public boolean hasAtmosphere()- Specified by:
hasAtmosphere
in interfaceIModelRenderable
- Overrides:
hasAtmosphere
in classCelestialBody
-
dispose
public void dispose() -
render
public void render(IntModelBatch modelBatch, float alpha, double t, RenderingContext rc, SceneGraphRenderer.RenderGroup group) Model rendering. SPACECRAFT_MODE in spacecraft mode is not affected by the relativistic aberration- Specified by:
render
in interfaceIModelRenderable
- Overrides:
render
in classModelBody
-
render
Default model rendering. -
render
- Specified by:
render
in interfaceILineRenderable
-
getSimpleCopy
Description copied from class:SceneGraphNode
Gets a copy of this object but does not copy its parent or children.- Overrides:
getSimpleCopy
in classCelestialBody
- Returns:
- The copied object.
-
mustUpdatePosition
Description copied from class:SceneGraphNode
Whether position must be recomputed for this entity. By default, only when time is on- Overrides:
mustUpdatePosition
in classSceneGraphNode
- Parameters:
time
- The current time- Returns:
- True if position should be recomputed for this entity
-
getLineWidth
public float getLineWidth()- Specified by:
getLineWidth
in interfaceILineRenderable
-
getGlPrimitive
public int getGlPrimitive()- Specified by:
getGlPrimitive
in interfaceILineRenderable
-
getResponsiveness
public double getResponsiveness() -
getDrag
public double getDrag() -
getMachines
-
setMachines
-
getCurrentMachine
public int getCurrentMachine()
-