Class Proximity.NearbyRecord
java.lang.Object
gaiasky.util.camera.Proximity.NearbyRecord
- All Implemented Interfaces:
IFocus
- Enclosing class:
Proximity
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEntityHitCoordinate
(int screenX, int screenY, int w, int h, int pixelDist, NaturalCamera camera, com.badlogic.gdx.utils.Array<com.badlogic.ashley.core.Entity> hits) void
addEntityHitRay
(Vector3D p0, Vector3D p1, NaturalCamera camera, com.badlogic.gdx.utils.Array<com.badlogic.ashley.core.Entity> hits) void
addHitCoordinate
(int screenX, int screenY, int w, int h, int pixelDist, NaturalCamera camera, com.badlogic.gdx.utils.Array<IFocus> hits) Add this focus to the hits list if it is hit by the [screenX, screenY] position.void
addHitRay
(Vector3D p0, Vector3D p1, NaturalCamera camera, com.badlogic.gdx.utils.Array<IFocus> hits) Add this focus to the hits list if it is hit by the given ray.float
Get 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.double
getAlpha()
Return the right ascension angle of this focus object.float
Get the apparent magnitude.long
Return the id of the focus candidate of this object.Return the name of the focus candidate of this object.double
Return the candidate apparent view angle (view angle corrected with the field of view) of this entity, in radians.Same asIFocus.getAbsolutePosition(Vector3Q)
.double
Same asIFocus.getDistToCamera()
.Gets the name of the closest object, localized.Same asIFocus.getName()
.float[]
getColor()
Gets the color of this object.getCt()
Return the component types of this focus.double
getDelta()
Return the declination angle of this focus object.double
Return the current distance to the camera in internal units.double
getElevationAt
(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).double
getElevationAt
(Vector3Q camPos, boolean useFuturePosition) Same asIFocus.getElevationAt(Vector3Q)
but with the option to use the future position of the body instead of the current one.double
getElevationAt
(Vector3Q camPos, Vector3Q nextPos) Same asIFocus.getElevationAt(Vector3Q)
but with the option to use the given future position of the body instead of the current one.com.badlogic.ashley.core.Entity
Gets the first ancestor of this node that is a star.Prepare the candidate with the given name.double
Return the height scale of this focus, or 0 if it has no height info.long
getId()
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.double
Return the radius of this focus object in internal units.Return the rotation component of this focus.int
Get the depth of this focus object in the scene graph.double
getSize()
Return the size (diameter) of this entity in internal units.double
Return the current view angle of this entity, in radians.double
Return the current apparent view angle (view angle corrected with the field of view) of this entity, in radians.double
getTEff()
Return the effective temperature.boolean
Checks whether the focus has the given name.boolean
Checks whether the focus has the given name.boolean
Check whether this focus has camera collisions enabled.boolean
Check whether this focus is within its valid time range, so that it can be used as a focus.boolean
isCopy()
Check whether this is a copy or not.boolean
isEmpty()
Whether this focus object actually contains a focus.boolean
Check whether this focus is actually focusable.boolean
Return whether this focus object is active or not.boolean
boolean
isForceLabel
(String name) boolean
isOther()
boolean
isStar()
boolean
boolean
boolean
isValid()
Whether this contains a valid focus object.void
Hook that runs when the candidate is actually made focus.
-
Field Details
-
distToCamera
public double distToCamera -
size
public double size -
radius
public double radius -
pos
-
pm
-
absolutePos
-
col
public float[] col -
name
-
type
public byte type -
index
public int index
-
-
Constructor Details
-
NearbyRecord
public NearbyRecord()
-
-
Method Details
-
isStar
public boolean isStar() -
isStarGroup
public boolean isStarGroup() -
isOther
public boolean isOther() -
isUndefined
public boolean isUndefined() -
isEmpty
-
isValid
public boolean isValid()Description copied from interface:IFocus
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. -
getId
-
getCandidateId
public long getCandidateId()Description copied from interface:IFocus
Return the id of the focus candidate of this object. Defaults toIFocus.getId()
.- Specified by:
getCandidateId
in interfaceIFocus
- Returns:
- The id of the candidate.
-
getLocalizedName
Description copied from interface:IFocus
Return the localized name of this focus. If it has no localized name, it returns the default name.- Specified by:
getLocalizedName
in interfaceIFocus
- Returns:
- The localized name.
-
getName
-
getNames
-
hasName
-
hasName
Description copied from interface:IFocus
Checks whether the focus has the given name. -
getClosestName
Description copied from interface:IFocus
Same asIFocus.getName()
.- Specified by:
getClosestName
in interfaceIFocus
- Returns:
- The name.
-
getClosestLocalizedName
Description copied from interface:IFocus
Gets the name of the closest object, localized.- Specified by:
getClosestLocalizedName
in interfaceIFocus
- Returns:
- The localized name.
-
getCandidateName
Description copied from interface:IFocus
Return the name of the focus candidate of this object. Defaults toIFocus.getName()
.- Specified by:
getCandidateName
in interfaceIFocus
- Returns:
- The name of the candidate.
-
getCt
Description copied from interface:IFocus
Return the component types of this focus. -
isFocusActive
public boolean isFocusActive()Description copied from interface:IFocus
Return whether this focus object is active or not. The active status determines whether the object can be focussed or not.- Specified by:
isFocusActive
in interfaceIFocus
- Returns:
- The active status.
-
getPos
-
getFirstStarAncestorEntity
public com.badlogic.ashley.core.Entity getFirstStarAncestorEntity()Description copied from interface:IFocus
Gets the first ancestor of this node that is a star.- Specified by:
getFirstStarAncestorEntity
in interfaceIFocus
- Returns:
- The first star ancestor.
-
getFirstStarAncestor
- Specified by:
getFirstStarAncestor
in interfaceIFocus
-
getAbsolutePosition
Description copied from interface:IFocus
Return the absolute position of this entity in the native coordinates (equatorial system).- Specified by:
getAbsolutePosition
in interfaceIFocus
- Parameters:
out
- The out vector.- Returns:
- The absolute position, same as aux.
-
getAbsolutePosition
Description copied from interface:IFocus
Return the absolute position of the entity identified by name within this entity in the native reference system.- Specified by:
getAbsolutePosition
in interfaceIFocus
- 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
Description copied from interface:IFocus
Same asIFocus.getAbsolutePosition(Vector3Q)
.- Specified by:
getClosestAbsolutePos
in interfaceIFocus
- Parameters:
out
- Vector3d where to put the return value.- Returns:
- The absolute position, same as aux.
-
getPosSph
-
getPredictedPosition
public Vector3Q getPredictedPosition(Vector3Q aux, ITimeFrameProvider time, ICamera camera, boolean force) Description copied from interface:IFocus
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.- Specified by:
getPredictedPosition
in interfaceIFocus
- 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
Description copied from interface:IFocus
Gets the position of this entity at the given delta time in the future in the internal reference system.- Specified by:
getPredictedPosition
in interfaceIFocus
- Parameters:
aux
- The out vector where the result will be stored.deltaTime
- Delta time in seconds.- Returns:
- The aux vector for chaining.
-
getDistToCamera
public double getDistToCamera()Description copied from interface:IFocus
Return the current distance to the camera in internal units.- Specified by:
getDistToCamera
in interfaceIFocus
- Returns:
- The current distance to the camera, in internal units.
-
getClosestDistToCamera
public double getClosestDistToCamera()Description copied from interface:IFocus
Same asIFocus.getDistToCamera()
.- Specified by:
getClosestDistToCamera
in interfaceIFocus
- Returns:
- The distance to the camera in internal units.
-
getSolidAngle
public double getSolidAngle()Description copied from interface:IFocus
Return the current view angle of this entity, in radians.- Specified by:
getSolidAngle
in interfaceIFocus
- Returns:
- The view angle in radians.
-
getSolidAngleApparent
public double getSolidAngleApparent()Description copied from interface:IFocus
Return the current apparent view angle (view angle corrected with the field of view) of this entity, in radians.- Specified by:
getSolidAngleApparent
in interfaceIFocus
- Returns:
- The apparent view angle in radians.
-
getCandidateSolidAngleApparent
public double getCandidateSolidAngleApparent()Description copied from interface:IFocus
Return the candidate apparent view angle (view angle corrected with the field of view) of this entity, in radians.- Specified by:
getCandidateSolidAngleApparent
in interfaceIFocus
- Returns:
- The apparent view angle in radians.
-
getAlpha
-
getDelta
-
getSize
-
getRadius
-
getTEff
-
getElevationAt
Description copied from interface:IFocus
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).- Specified by:
getElevationAt
in interfaceIFocus
- Parameters:
camPos
- The camera position.- Returns:
- The height of the projected position of the current camera.
-
getElevationAt
Description copied from interface:IFocus
Same asIFocus.getElevationAt(Vector3Q)
but with the option to use the future position of the body instead of the current one.- Specified by:
getElevationAt
in interfaceIFocus
- 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
Description copied from interface:IFocus
Same asIFocus.getElevationAt(Vector3Q)
but with the option to use the given future position of the body instead of the current one.- Specified by:
getElevationAt
in interfaceIFocus
- 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
public double getHeightScale()Description copied from interface:IFocus
Return the height scale of this focus, or 0 if it has no height info.- Specified by:
getHeightScale
in interfaceIFocus
- Returns:
- The height scale in internal units.
-
getAppmag
-
getAbsmag
-
getOrientation
Description copied from interface:IFocus
Return the orientation matrix of this focus.- Specified by:
getOrientation
in interfaceIFocus
- Returns:
- The orientation matrix. Can be null.
-
getRotationComponent
Description copied from interface:IFocus
Return the rotation component of this focus.- Specified by:
getRotationComponent
in interfaceIFocus
- Returns:
- The rotation component. Can be null.
-
getOrientationQuaternion
Description copied from interface:IFocus
Return the orientation quaternion of this focus.- Specified by:
getOrientationQuaternion
in interfaceIFocus
- Returns:
- The orientation quaternion. Can be null.
-
addHitCoordinate
public void addHitCoordinate(int screenX, int screenY, int w, int h, int pixelDist, NaturalCamera camera, com.badlogic.gdx.utils.Array<IFocus> hits) Description copied from interface:IFocus
Add this focus to the hits list if it is hit by the [screenX, screenY] position.- Specified by:
addHitCoordinate
in interfaceIFocus
- 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.
-
addEntityHitCoordinate
public 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) - Specified by:
addEntityHitCoordinate
in interfaceIFocus
-
addHitRay
public void addHitRay(Vector3D p0, Vector3D p1, NaturalCamera camera, com.badlogic.gdx.utils.Array<IFocus> hits) Description copied from interface:IFocus
Add this focus to the hits list if it is hit by the given ray. -
addEntityHitRay
public void addEntityHitRay(Vector3D p0, Vector3D p1, NaturalCamera camera, com.badlogic.gdx.utils.Array<com.badlogic.ashley.core.Entity> hits) - Specified by:
addEntityHitRay
in interfaceIFocus
-
makeFocus
-
getFocus
-
isCoordinatesTimeOverflow
public boolean isCoordinatesTimeOverflow()Description copied from interface:IFocus
Check whether this focus is within its valid time range, so that it can be used as a focus.- Specified by:
isCoordinatesTimeOverflow
in interfaceIFocus
- Returns:
- Whether the focus object is within its valid time range.
-
getSceneGraphDepth
public int getSceneGraphDepth()Description copied from interface:IFocus
Get the depth of this focus object in the scene graph.- Specified by:
getSceneGraphDepth
in interfaceIFocus
- Returns:
- The depth of the scene graph.
-
getOctant
Description copied from interface:IFocus
Get the octant this focus belongs to, if any. This will return null if this focus is not part of an octree. -
isCopy
-
isFocusable
public boolean isFocusable()Description copied from interface:IFocus
Check whether this focus is actually focusable. This checks the attribute 'focusable' of the Focus component.- Specified by:
isFocusable
in interfaceIFocus
- Returns:
- Whether the focus is focusable.
-
isCameraCollision
public boolean isCameraCollision()Description copied from interface:IFocus
Check whether this focus has camera collisions enabled.- Specified by:
isCameraCollision
in interfaceIFocus
- Returns:
- Whether the focus has camera collisions enabled.
-
getColor
-
isForceLabel
public boolean isForceLabel()- Specified by:
isForceLabel
in interfaceIFocus
-
isForceLabel
- Specified by:
isForceLabel
in interfaceIFocus
-