Package gaiasky.util.camera
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 TypeMethodDescriptionvoidaddEntityHitCoordinate(int screenX, int screenY, int w, int h, int pixelDist, NaturalCamera camera, com.badlogic.gdx.utils.Array<com.badlogic.ashley.core.Entity> hits) voidaddEntityHitRay(Vector3d p0, Vector3d p1, NaturalCamera camera, com.badlogic.gdx.utils.Array<com.badlogic.ashley.core.Entity> hits) voidaddHitCoordinate(int screenX, int screenY, int w, int h, int pixelDist, 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.voidaddHitRay(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.floatGets the absolute magnitude.Returns the absolute position of this entity in the native coordinates (equatorial system).getAbsolutePosition(String name, Vector3b out) Returns the absolute position of the entity identified by name within this entity in the native reference system.doublegetAlpha()Returns the right ascension angle of this focus object.floatGets the apparent magnitude.longReturns the id of the focus candidate of this object.Returns the name of the focus candidate of this object.doubleReturns the candidate apparent view angle (view angle corrected with the field of view) of this entity, in radians.Same asIFocus.getAbsolutePosition(Vector3b).doubleSame asIFocus.getDistToCamera().Same asIFocus.getName().float[]getColor()Gets the color of this object.getCt()Returns the component types of this focus.doublegetDelta()Returns the declination angle of this focus object.doubleReturns the current distance to the camera in internal units.doublegetElevationAt(Vector3b camPos) Returns 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(Vector3b camPos, boolean useFuturePosition) Same asIFocus.getElevationAt(Vector3b)but with the option to use the future position of the body instead of the current one.doublegetElevationAt(Vector3b camPos, Vector3b nextPos) Same asIFocus.getElevationAt(Vector3b)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.Prepares the candidate with the given name.doubleReturns the height scale of this focus, or 0 if it has no height info.longgetId()Returns the unique id of this focus.Returns the localized name of this focus.getName()Returns the first name of this focus.String[]getNames()Returns all names of this focus.Gets the octant this focus belongs to, if any.Returns the orientation matrix of this focus.Returns the orientation quaternion of this focus.getPos()Returns the position.Gets the position in equatorial spherical coordinates.getPredictedPosition(Vector3b 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.doubleReturns the radius of this focus object in internal units.Returns the rotation component of this focus.intGets the depth of this focus object in the scene graph.doublegetSize()Returns the size (diameter) of this entity in internal units.doubleReturns the current view angle of this entity, in radians.doubleReturns the current apparent view angle (view angle corrected with the field of view) of this entity, in radians.booleanChecks whether the focus has the given name.booleanChecks whether the focus has the given name.booleanChecks whether this focus is within its valid time range, so that it can be used as a focus.booleanisCopy()Whether this is a copy or not.booleanisEmpty()Whether this focus object actually contains a focus.booleanReturns whether this focus object is active or not.booleanbooleanisForceLabel(String name) booleanisOther()booleanisStar()booleanbooleanbooleanisValid()Whether this contains a valid focus object.voidHook 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
public boolean isEmpty()Description copied from interface:IFocusWhether this focus object actually contains a focus. -
isValid
public boolean isValid()Description copied from interface:IFocusWhether 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
public long getId()Description copied from interface:IFocusReturns the unique id of this focus. -
getCandidateId
public long getCandidateId()Description copied from interface:IFocusReturns the id of the focus candidate of this object. Defaults toIFocus.getId().- Specified by:
getCandidateIdin interfaceIFocus- Returns:
- The id of the candidate.
-
getLocalizedName
Description copied from interface:IFocusReturns the localized name of this focus. If it has no localized name, it returns the default name.- Specified by:
getLocalizedNamein interfaceIFocus- Returns:
- The localized name.
-
getName
Description copied from interface:IFocusReturns the first name of this focus. -
getNames
Description copied from interface:IFocusReturns all names of this focus. -
hasName
Description copied from interface:IFocusChecks whether the focus has the given name. -
hasName
Description copied from interface:IFocusChecks whether the focus has the given name. -
getClosestName
Description copied from interface:IFocusSame asIFocus.getName().- Specified by:
getClosestNamein interfaceIFocus- Returns:
- The name.
-
getCandidateName
Description copied from interface:IFocusReturns the name of the focus candidate of this object. Defaults toIFocus.getName().- Specified by:
getCandidateNamein interfaceIFocus- Returns:
- The name of the candidate.
-
getCt
Description copied from interface:IFocusReturns the component types of this focus. -
isFocusActive
public boolean isFocusActive()Description copied from interface:IFocusReturns whether this focus object is active or not. The active status determines whether the object can be focussed or not.- Specified by:
isFocusActivein interfaceIFocus- Returns:
- The active status.
-
getPos
Description copied from interface:IFocusReturns the position. -
getFirstStarAncestorEntity
public com.badlogic.ashley.core.Entity getFirstStarAncestorEntity()Description copied from interface:IFocusGets the first ancestor of this node that is a star.- Specified by:
getFirstStarAncestorEntityin interfaceIFocus- Returns:
- The first star ancestor.
-
getFirstStarAncestor
- Specified by:
getFirstStarAncestorin interfaceIFocus
-
getAbsolutePosition
Description copied from interface:IFocusReturns the absolute position of this entity in the native coordinates (equatorial system).- Specified by:
getAbsolutePositionin interfaceIFocus- Parameters:
out- The out vector.- Returns:
- The absolute position, same as aux.
-
getAbsolutePosition
Description copied from interface:IFocusReturns the absolute position of the entity identified by name within this entity in the native reference system.- Specified by:
getAbsolutePositionin 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:IFocusSame asIFocus.getAbsolutePosition(Vector3b).- Specified by:
getClosestAbsolutePosin interfaceIFocus- Parameters:
out- Vector3d where to put the return value.- Returns:
- The absolute position, same as aux.
-
getPosSph
Description copied from interface:IFocusGets the position in equatorial spherical coordinates. -
getPredictedPosition
public Vector3b getPredictedPosition(Vector3b aux, ITimeFrameProvider time, ICamera camera, boolean force) Description copied from interface:IFocusGets 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:
getPredictedPositionin 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.
-
getDistToCamera
public double getDistToCamera()Description copied from interface:IFocusReturns the current distance to the camera in internal units.- Specified by:
getDistToCamerain interfaceIFocus- Returns:
- The current distance to the camera, in internal units.
-
getClosestDistToCamera
public double getClosestDistToCamera()Description copied from interface:IFocusSame asIFocus.getDistToCamera().- Specified by:
getClosestDistToCamerain interfaceIFocus- Returns:
- The distance to the camera in internal units.
-
getSolidAngle
public double getSolidAngle()Description copied from interface:IFocusReturns the current view angle of this entity, in radians.- Specified by:
getSolidAnglein interfaceIFocus- Returns:
- The view angle in radians.
-
getSolidAngleApparent
public double getSolidAngleApparent()Description copied from interface:IFocusReturns the current apparent view angle (view angle corrected with the field of view) of this entity, in radians.- Specified by:
getSolidAngleApparentin interfaceIFocus- Returns:
- The apparent view angle in radians.
-
getCandidateSolidAngleApparent
public double getCandidateSolidAngleApparent()Description copied from interface:IFocusReturns the candidate apparent view angle (view angle corrected with the field of view) of this entity, in radians.- Specified by:
getCandidateSolidAngleApparentin interfaceIFocus- Returns:
- The apparent view angle in radians.
-
getAlpha
public double getAlpha()Description copied from interface:IFocusReturns the right ascension angle of this focus object. -
getDelta
public double getDelta()Description copied from interface:IFocusReturns the declination angle of this focus object. -
getSize
public double getSize()Description copied from interface:IFocusReturns the size (diameter) of this entity in internal units. -
getRadius
public double getRadius()Description copied from interface:IFocusReturns the radius of this focus object in internal units. -
getElevationAt
Description copied from interface:IFocusReturns 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:
getElevationAtin interfaceIFocus- Parameters:
camPos- The camera position.- Returns:
- The height of the projected position of the current camera.
-
getElevationAt
Description copied from interface:IFocusSame asIFocus.getElevationAt(Vector3b)but with the option to use the future position of the body instead of the current one.- Specified by:
getElevationAtin 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:IFocusSame asIFocus.getElevationAt(Vector3b)but with the option to use the given future position of the body instead of the current one.- Specified by:
getElevationAtin 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:IFocusReturns the height scale of this focus, or 0 if it has no height info.- Specified by:
getHeightScalein interfaceIFocus- Returns:
- The height scale in internal units.
-
getAppmag
public float getAppmag()Description copied from interface:IFocusGets the apparent magnitude. -
getAbsmag
public float getAbsmag()Description copied from interface:IFocusGets the absolute magnitude. -
getOrientation
Description copied from interface:IFocusReturns the orientation matrix of this focus.- Specified by:
getOrientationin interfaceIFocus- Returns:
- The orientation matrix. Can be null.
-
getRotationComponent
Description copied from interface:IFocusReturns the rotation component of this focus.- Specified by:
getRotationComponentin interfaceIFocus- Returns:
- The rotation component. Can be null.
-
getOrientationQuaternion
Description copied from interface:IFocusReturns the orientation quaternion of this focus.- Specified by:
getOrientationQuaternionin 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:IFocusAdds this focus to the hits list if it is hit by the [screenX, screenY] position.- Specified by:
addHitCoordinatein 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:
addEntityHitCoordinatein interfaceIFocus
-
addHitRay
public void addHitRay(Vector3d p0, Vector3d p1, NaturalCamera camera, com.badlogic.gdx.utils.Array<IFocus> hits) Description copied from interface:IFocusAdds 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:
addEntityHitRayin interfaceIFocus
-
makeFocus
public void makeFocus()Description copied from interface:IFocusHook that runs when the candidate is actually made focus. -
getFocus
Description copied from interface:IFocusPrepares the candidate with the given name. -
isCoordinatesTimeOverflow
public boolean isCoordinatesTimeOverflow()Description copied from interface:IFocusChecks whether this focus is within its valid time range, so that it can be used as a focus.- Specified by:
isCoordinatesTimeOverflowin interfaceIFocus- Returns:
- Whether the focus object is within its valid time range.
-
getSceneGraphDepth
public int getSceneGraphDepth()Description copied from interface:IFocusGets the depth of this focus object in the scene graph.- Specified by:
getSceneGraphDepthin interfaceIFocus- Returns:
- The depth of the scene graph.
-
getOctant
Description copied from interface:IFocusGets the octant this focus belongs to, if any. This will return null if this focus is not part of an octree. -
isCopy
public boolean isCopy()Description copied from interface:IFocusWhether this is a copy or not. -
getColor
public float[] getColor()Description copied from interface:IFocusGets the color of this object. -
isForceLabel
public boolean isForceLabel()- Specified by:
isForceLabelin interfaceIFocus
-
isForceLabel
- Specified by:
isForceLabelin interfaceIFocus
-