Interface IFocus
-
- All Known Subinterfaces:
IStarFocus
- All Known Implementing Classes:
Billboard
,BillboardGalaxy
,CelestialBody
,Gaia
,GenericSpacecraft
,Invisible
,LightBeam
,ModelBody
,NBGalaxy
,Particle
,ParticleGroup
,Planet
,Satellite
,Spacecraft
,Star
,StarCluster
,StarGroup
public interface IFocus
Contract that all focus objects must implement
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addHit(int screenX, int screenY, int w, int h, int pxdist, NaturalCamera camera, com.badlogic.gdx.utils.Array<IFocus> hits)
Adds this focus to the hits list if it is hit by the [screenX, screenY] positionvoid
addHit(Vector3d p0, Vector3d p1, NaturalCamera camera, com.badlogic.gdx.utils.Array<IFocus> hits)
Adds this focus to the hits list if it is hit by the given rayfloat
getAbsmag()
Gets the absolute magnitudeVector3d
getAbsolutePosition(Vector3d out)
Returns the absolute position of this entity in the native coordinates (equatorial system)Vector3d
getAbsolutePosition(java.lang.String name, Vector3d out)
Returns the absolute position of the entity identified by name within this entity in the native reference systemdouble
getAlpha()
Returns the right ascension angle of this focus objectfloat
getAppmag()
Gets the apparent magnitudelong
getCandidateId()
Returns the id of the focus candidate of this object.java.lang.String
getCandidateName()
Returns the name of the focus candidate of this object.double
getCandidateViewAngleApparent()
Returns the candidate apparent view angle (view angle corrected with the field of view) of this entity, in radiansVector3d
getClosestAbsolutePos(Vector3d out)
Same asgetAbsolutePosition(Vector3d)
double
getClosestDistToCamera()
Same asgetDistToCamera()
java.lang.String
getClosestName()
Same asgetName()
ComponentTypes
getCt()
Returns the component types of this focusdouble
getDelta()
Returns the declination angle of this focus objectdouble
getDistToCamera()
Returns the current distance to the camera in internal unitsSceneGraphNode
getFirstStarAncestor()
Gets the first ancestor of this node that is of typeStar
IFocus
getFocus(java.lang.String name)
Prepares the candidate with the given namedouble
getHeight(Vector3d camPos)
Returns the height of the projected position of the current camera on this focus object, which is usually the radius plus a value lookup in the height texture (if exists)double
getHeight(Vector3d camPos, boolean useFuturePosition)
Same asgetHeight(Vector3d)
but with the option to use the future position of the body instead of the current one.double
getHeight(Vector3d camPos, Vector3d nextPos)
Same asgetHeight(Vector3d)
but with the option to use the given future position of the body instead of the current one.double
getHeightScale()
Returns the height scale of this focus, or 0 if it has no height infolong
getId()
Returns the unique id of this focusjava.lang.String
getName()
Returns the name of this focusIFocus
getNext(ITimeFrameProvider time, ICamera camera, boolean force)
OctreeNode
getOctant()
Gets the octant this focus belongs to, if any.Matrix4d
getOrientation()
Returns the orientation matrix of this focusQuaterniond
getOrientationQuaternion()
Returns the orientation quaternion of this focusVector3d
getPos()
Returns the positionVector2d
getPosSph()
Gets the position in equatorial spherical coordinatesVector3d
getPredictedPosition(Vector3d aux, ITimeFrameProvider time, ICamera camera, boolean force)
Gets the position of this entity in the next time step in the internal reference system using the given time provider and the given cameradouble
getRadius()
Returns the radius of this focus object in internal unitsRotationComponent
getRotationComponent()
Returns the rotation component of this focusint
getSceneGraphDepth()
Gets the depth of this focus object in the scene graphdouble
getSize()
Returns the size (diameter) of this entity in internal unitsdouble
getViewAngle()
Returns the current view angle of this entity, in radiansdouble
getViewAngleApparent()
Returns the current apparent view angle (view angle corrected with the field of view) of this entity, in radiansboolean
isActive()
Returns whether this focus object is active or not.boolean
isCoordinatesTimeOverflow()
Checks whether this foucs is within its valid time range, so that it can be used as a focusboolean
isCopy()
Whether this is a copy or notvoid
makeFocus()
Hook that runs when the candidate is actually made focusboolean
withinMagLimit()
Returns true if the focus is within the magnitude limit defined inGlobalConf
-
-
-
Method Detail
-
getId
long getId()
Returns the unique id of this focus- Returns:
- The id
-
getCandidateId
long getCandidateId()
Returns the id of the focus candidate of this object. Defaults togetId()
- Returns:
- The id of the candidate
-
getName
java.lang.String getName()
Returns the name of this focus- Returns:
- The name
-
getClosestName
java.lang.String getClosestName()
Same asgetName()
- Returns:
- The name
-
getCandidateName
java.lang.String getCandidateName()
Returns the name of the focus candidate of this object. Defaults togetName()
- Returns:
- The name of the candidate
-
getCt
ComponentTypes getCt()
Returns the component types of this focus- Returns:
- The component types
-
isActive
boolean isActive()
Returns whether this focus object is active or not. Useful for particle groups- Returns:
- The active status
-
withinMagLimit
boolean withinMagLimit()
Returns true if the focus is within the magnitude limit defined inGlobalConf
- Returns:
- True if focus within magnitude limit
-
getPos
Vector3d getPos()
Returns the position- Returns:
- The position
-
getFirstStarAncestor
SceneGraphNode getFirstStarAncestor()
Gets the first ancestor of this node that is of typeStar
- Returns:
- The first ancestor of type
Star
-
getAbsolutePosition
Vector3d getAbsolutePosition(Vector3d out)
Returns the absolute position of this entity in the native coordinates (equatorial system)- Parameters:
out
- Vector3d where to put the return value- Returns:
- The absolute position, same as aux
-
getAbsolutePosition
Vector3d getAbsolutePosition(java.lang.String name, Vector3d out)
Returns the absolute position of the entity identified by name within this entity in the native reference system- Parameters:
name
- The name (lowercase) of the entity to get the position from (useful in case of star groups)out
- Vector3d to put the return value- Returns:
- The absolute position of the entity if it exists, null otherwise
-
getClosestAbsolutePos
Vector3d getClosestAbsolutePos(Vector3d out)
Same asgetAbsolutePosition(Vector3d)
- Parameters:
out
- Vector3d where to put the return value- Returns:
- The absolute position, same as aux
-
getPosSph
Vector2d getPosSph()
Gets the position in equatorial spherical coordinates- Returns:
- The position in alpha, delta
-
getNext
IFocus getNext(ITimeFrameProvider time, ICamera camera, boolean force)
-
getPredictedPosition
Vector3d getPredictedPosition(Vector3d aux, ITimeFrameProvider time, ICamera camera, boolean force)
Gets the position of this entity in the next time step in the internal reference system using the given time provider and the given camera- Parameters:
aux
- The out vector where the result will be storedtime
- The time frame providercamera
- The cameraforce
- Whether to force the computation if time is off- Returns:
- The aux vector for chaining
-
getDistToCamera
double getDistToCamera()
Returns the current distance to the camera in internal units- Returns:
- The current distance to the camera, in internal units
-
getClosestDistToCamera
double getClosestDistToCamera()
Same asgetDistToCamera()
- Returns:
- The distance to the camera in internal units
-
getViewAngle
double getViewAngle()
Returns the current view angle of this entity, in radians- Returns:
- The view angle in radians
-
getViewAngleApparent
double getViewAngleApparent()
Returns the current apparent view angle (view angle corrected with the field of view) of this entity, in radians- Returns:
- The apparent view angle in radians
-
getCandidateViewAngleApparent
double getCandidateViewAngleApparent()
Returns the candidate apparent view angle (view angle corrected with the field of view) of this entity, in radians- Returns:
- The apparent view angle in radians
-
getAlpha
double getAlpha()
Returns the right ascension angle of this focus object- Returns:
- The right ascension angle in degrees
-
getDelta
double getDelta()
Returns the declination angle of this focus object- Returns:
- The declination angle in degrees
-
getSize
double getSize()
Returns the size (diameter) of this entity in internal units- Returns:
- The size in internal units
-
getRadius
double getRadius()
Returns the radius of this focus object in internal units- Returns:
- The radius of the focus, in internal units
-
getHeight
double getHeight(Vector3d camPos)
Returns the height of the projected position of the current camera on this focus object, which is usually the radius plus a value lookup in the height texture (if exists)- Parameters:
camPos
- The camera position- Returns:
- The height of the projected position of the current camera
-
getHeight
double getHeight(Vector3d camPos, boolean useFuturePosition)
Same asgetHeight(Vector3d)
but with the option to use the future position of the body instead of the current one.- Parameters:
camPos
- The camera positionuseFuturePosition
- Whether to use the future position or the current one- Returns:
- The height of the projected position of the current camera on the surface
-
getHeight
double getHeight(Vector3d camPos, Vector3d nextPos)
Same asgetHeight(Vector3d)
but with the option to use the given future position of the body instead of the current one.- Parameters:
camPos
- The camera positionnextPos
- The future position of this body to use- Returns:
- The height of the projected position of the current camera on the surface
-
getHeightScale
double getHeightScale()
Returns the height scale of this focus, or 0 if it has no height info- Returns:
- The height scale in internal units
-
getAppmag
float getAppmag()
Gets the apparent magnitude- Returns:
- The apparent magnitude
-
getAbsmag
float getAbsmag()
Gets the absolute magnitude- Returns:
- The absolute magnitude
-
getOrientation
Matrix4d getOrientation()
Returns the orientation matrix of this focus- Returns:
- The orientation matrix. Can be null
-
getRotationComponent
RotationComponent getRotationComponent()
Returns the rotation component of this focus- Returns:
- The rotation component. Can be null
-
getOrientationQuaternion
Quaterniond getOrientationQuaternion()
Returns the orientation quaternion of this focus- Returns:
- The orientation quaternion. Can be null
-
addHit
void addHit(int screenX, int screenY, int w, int h, int pxdist, NaturalCamera camera, com.badlogic.gdx.utils.Array<IFocus> hits)
Adds this focus to the hits list if it is hit by the [screenX, screenY] position- Parameters:
screenX
- The x position of the hitscreenY
- The y position of the hitw
- The viewport widthh
- The viewport heightpxdist
- The minimum pixel distance to consider as hitcamera
- The camerahits
- The list where to add the element
-
addHit
void addHit(Vector3d p0, Vector3d p1, NaturalCamera camera, com.badlogic.gdx.utils.Array<IFocus> hits)
Adds this focus to the hits list if it is hit by the given ray- Parameters:
p0
- Start point of the rayp1
- End point of the raycamera
- The camerahits
- The list where the focus is to be added
-
makeFocus
void makeFocus()
Hook that runs when the candidate is actually made focus
-
getFocus
IFocus getFocus(java.lang.String name)
Prepares the candidate with the given name- Parameters:
name
- The name in lower case
-
isCoordinatesTimeOverflow
boolean isCoordinatesTimeOverflow()
Checks whether this foucs is within its valid time range, so that it can be used as a focus- Returns:
- Whether the focus object is within its valid time range
-
getSceneGraphDepth
int getSceneGraphDepth()
Gets the depth of this focus object in the scene graph- Returns:
- The depth of the scene graph
-
getOctant
OctreeNode getOctant()
Gets the octant this focus belongs to, if any. This will return null if this focus is not part of an octree- Returns:
- The octant this focus belongs to. Null if it is not part of an octree
-
isCopy
boolean isCopy()
Whether this is a copy or not- Returns:
-
-