Interface IFocus
- All Known Implementing Classes:
FocusView, Proximity.NearbyRecord
public interface IFocus
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddEntityHitCoordinate(int screenX, int screenY, int w, int h, int pixelDist, NaturalCamera camera, com.badlogic.gdx.utils.Array<com.badlogic.ashley.core.Entity> hits) Add this focus to the hits list if it is hit by the [screenX, screenY] position.voidaddEntityHitRay(Vector3D p0, Vector3D p1, NaturalCamera camera, com.badlogic.gdx.utils.Array<com.badlogic.ashley.core.Entity> hits) floatGet the absolute magnitude.Return the absolute position of this entity in the native coordinates (equatorial system).getAbsolutePosition(String name, Vector3Q out) Return the absolute position of the entity identified by name within this entity in the native reference system.doublegetAlpha()Return the right ascension angle of this focus object.floatGet the apparent magnitude.longReturn the id of the focus candidate of this object.Return the name of the focus candidate of this object.doubleReturn the candidate apparent view angle (view angle corrected with the field of view) of this entity, in radians.Same asgetAbsolutePosition(Vector3Q).doubleSame asgetDistToCamera().Gets the name of the closest object, localized.Same asgetName().float[]getColor()Gets the color of this object.getCt()Return the component types of this focus.doublegetDelta()Return the declination angle of this focus object.doubleReturn the current distance to the camera in internal units.doublegetElevationAt(Vector3Q camPos) Return the surface elevation 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).doublegetElevationAt(Vector3Q camPos, boolean useFuturePosition) Same asgetElevationAt(Vector3Q)but with the option to use the future position of the body instead of the current one.doublegetElevationAt(Vector3Q camPos, Vector3Q nextPos) Same asgetElevationAt(Vector3Q)but with the option to use the given future position of the body instead of the current one.com.badlogic.ashley.core.EntityGets the first ancestor of this node that is a star.Prepare the candidate with the given name.doubleReturn the height scale of this focus, or 0 if it has no height info.longgetId()Return the unique id of this focus.Return the localized name of this focus.getName()Return the first name of this focus.String[]getNames()Return all names of this focus.Get the octant this focus belongs to, if any.Return the orientation matrix of this focus.Return the orientation quaternion of this focus.getPos()Return the position.Gets the position in equatorial spherical coordinates.getPredictedPosition(Vector3Q aux, double deltaTime) Gets the position of this entity at the given delta time in the future in the internal reference system.getPredictedPosition(Vector3Q 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.doubleReturn the radius of this focus object in internal units.Return the rotation component of this focus.intGet the depth of this focus object in the scene graph.doublegetSize()Return the size (diameter) of this entity in internal units.doubleReturn the current view angle of this entity, in radians.doubleReturn the current apparent view angle (view angle corrected with the field of view) of this entity, in radians.doublegetTEff()Return the effective temperature.booleanhasId()Return whether the curent focus has a valid identifier number.booleanChecks whether the focus has the given name.booleanChecks whether the focus has the given name.booleanCheck whether this focus has camera collisions enabled.booleanCheck whether this focus is within its valid time range, so that it can be used as a focus.booleanisCopy()Check whether this is a copy or not.booleanisEmpty()Whether this focus object actually contains a focus.booleanCheck whether this focus is actually focusable.booleanReturn whether this focus object is active or not.booleanIs the label of the entity forced to display?booleanisForceLabel(String name) booleanIs the label of the entity rendered?booleanisRenderLabel(String name) booleanisValid()Whether this contains a valid focus object.voidHook that runs when the candidate is actually made focus.
-
Method Details
-
isEmpty
boolean isEmpty()Whether this focus object actually contains a focus.- Returns:
- True if the focus is not set, false otherwise.
-
isValid
boolean isValid()Whether this contains a valid focus object. This returns true in the case of focus views, and only when the focus view is correctly set up and initialized with a valid entity.- Returns:
- Whether this focus is valid or not.
-
getId
long getId()Return the unique id of this focus.- Returns:
- The id.
-
getCandidateId
long getCandidateId()Return the id of the focus candidate of this object. Defaults togetId().- Returns:
- The id of the candidate.
-
hasId
boolean hasId()Return whether the curent focus has a valid identifier number.- Returns:
- True if the ID is valid.
-
getLocalizedName
String getLocalizedName()Return the localized name of this focus. If it has no localized name, it returns the default name.- Returns:
- The localized name.
-
getName
-
getNames
-
hasName
Checks whether the focus has the given name.- Parameters:
name- The name.- Returns:
- True if there is a match.
-
hasName
Checks whether the focus has the given name.- Parameters:
name- The name.matchCase- Whether to match the case when comparing.- Returns:
- True if there is a match.
-
getClosestName
-
getClosestLocalizedName
String getClosestLocalizedName()Gets the name of the closest object, localized.- Returns:
- The localized name.
-
getCandidateName
-
getCt
-
isFocusActive
boolean isFocusActive()Return whether this focus object is active or not. The active status determines whether the object can be focussed or not.- Returns:
- The active status.
-
getPos
-
getFirstStarAncestorEntity
com.badlogic.ashley.core.Entity getFirstStarAncestorEntity()Gets the first ancestor of this node that is a star.- Returns:
- The first star ancestor.
-
getFirstStarAncestor
IFocus getFirstStarAncestor() -
getAbsolutePosition
-
getAbsolutePosition
Return 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
Same asgetAbsolutePosition(Vector3Q).- 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.
-
getPredictedPosition
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 stored.time- The time frame provider.camera- The camera.force- Whether to force the computation if time is off.- Returns:
- The aux vector for chaining.
-
getPredictedPosition
Gets the position of this entity at the given delta time in the future in the internal reference system.- Parameters:
aux- The out vector where the result will be stored.deltaTime- Delta time in seconds.- Returns:
- The aux vector for chaining.
-
getDistToCamera
double getDistToCamera()Return 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.
-
getSolidAngle
double getSolidAngle()Return the current view angle of this entity, in radians.- Returns:
- The view angle in radians.
-
getSolidAngleApparent
double getSolidAngleApparent()Return 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.
-
getCandidateSolidAngleApparent
double getCandidateSolidAngleApparent()Return 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()Return the right ascension angle of this focus object.- Returns:
- The right ascension angle in degrees.
-
getDelta
double getDelta()Return the declination angle of this focus object.- Returns:
- The declination angle in degrees.
-
getSize
double getSize()Return the size (diameter) of this entity in internal units.- Returns:
- The size in internal units.
-
getRadius
double getRadius()Return the radius of this focus object in internal units.- Returns:
- The radius of the focus, in internal units.
-
getTEff
double getTEff()Return the effective temperature.- Returns:
- The effective temperature of the object, in Kelvins.
-
getElevationAt
Return the surface elevation 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.
-
getElevationAt
Same asgetElevationAt(Vector3Q)but with the option to use the future position of the body instead of the current one.- Parameters:
camPos- The camera position.useFuturePosition- Whether to use the future position or the current one.- Returns:
- The height of the projected position of the current camera on the surface.
-
getElevationAt
Same asgetElevationAt(Vector3Q)but with the option to use the given future position of the body instead of the current one.- Parameters:
camPos- The camera position.nextPos- 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()Return the height scale of this focus, or 0 if it has no height info.- Returns:
- The height scale in internal units.
-
getAppmag
float getAppmag()Get the apparent magnitude.- Returns:
- The apparent magnitude.
-
getAbsmag
float getAbsmag()Get the absolute magnitude.- Returns:
- The absolute magnitude.
-
getOrientation
Matrix4D getOrientation()Return the orientation matrix of this focus.- Returns:
- The orientation matrix. Can be null.
-
getRotationComponent
RotationComponent getRotationComponent()Return the rotation component of this focus.- Returns:
- The rotation component. Can be null.
-
getOrientationQuaternion
QuaternionDouble getOrientationQuaternion()Return the orientation quaternion of this focus.- Returns:
- The orientation quaternion. Can be null.
-
addEntityHitCoordinate
void addEntityHitCoordinate(int screenX, int screenY, int w, int h, int pixelDist, NaturalCamera camera, com.badlogic.gdx.utils.Array<com.badlogic.ashley.core.Entity> hits) Add this focus to the hits list if it is hit by the [screenX, screenY] position.- Parameters:
screenX- The x position of the hit.screenY- The y position of the hit.w- The viewport width.h- The viewport height.pixelDist- The minimum pixel distance to consider as hit.camera- The camera.hits- The list where to add the element.
-
addEntityHitRay
void addEntityHitRay(Vector3D p0, Vector3D p1, NaturalCamera camera, com.badlogic.gdx.utils.Array<com.badlogic.ashley.core.Entity> hits) -
makeFocus
void makeFocus()Hook that runs when the candidate is actually made focus. -
getFocus
-
isCoordinatesTimeOverflow
boolean isCoordinatesTimeOverflow()Check whether this focus 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()Get the depth of this focus object in the scene graph.- Returns:
- The depth of the scene graph.
-
getOctant
OctreeNode getOctant()Get 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()Check whether this is a copy or not.- Returns:
- Whether the object is a copy or not.
-
isFocusable
boolean isFocusable()Check whether this focus is actually focusable. This checks the attribute 'focusable' of the Focus component.- Returns:
- Whether the focus is focusable.
-
isCameraCollision
boolean isCameraCollision()Check whether this focus has camera collisions enabled.- Returns:
- Whether the focus has camera collisions enabled.
-
getColor
float[] getColor()Gets the color of this object.- Returns:
- The color as an RGBA float array.
-
isForceLabel
boolean isForceLabel()Is the label of the entity forced to display?- Returns:
- The force label property.
-
isForceLabel
-
isRenderLabel
boolean isRenderLabel()Is the label of the entity rendered?- Returns:
- The render label property.
-
isRenderLabel
-