Package gaiasky.util.camera
Class Proximity.NearbyRecord
java.lang.Object
gaiasky.util.camera.Proximity.NearbyRecord
- All Implemented Interfaces:
IFocus
- Enclosing class:
- Proximity
public class Proximity.NearbyRecord extends java.lang.Object implements IFocus
-
Field Summary
-
Constructor Summary
Constructors Constructor Description NearbyRecord() -
Method Summary
Modifier and Type Method Description voidaddHit(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] positionvoidaddHit(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 rayfloatgetAbsmag()Gets the absolute magnitudeVector3bgetAbsolutePosition(Vector3b out)Returns the absolute position of this entity in the native coordinates (equatorial system)Vector3bgetAbsolutePosition(java.lang.String name, Vector3b out)Returns the absolute position of the entity identified by name within this entity in the native reference systemdoublegetAlpha()Returns the right ascension angle of this focus objectfloatgetAppmag()Gets the apparent magnitudelonggetCandidateId()Returns the id of the focus candidate of this object.java.lang.StringgetCandidateName()Returns the name of the focus candidate of this object.doublegetCandidateViewAngleApparent()Returns the candidate apparent view angle (view angle corrected with the field of view) of this entity, in radiansVector3bgetClosestAbsolutePos(Vector3b out)doublegetClosestDistToCamera()Same asIFocus.getDistToCamera()java.lang.StringgetClosestName()Same asIFocus.getName()float[]getColor()Gets the color of this objectComponentTypesgetCt()Returns the component types of this focusdoublegetDelta()Returns the declination angle of this focus objectdoublegetDistToCamera()Returns the current distance to the camera in internal unitsSceneGraphNodegetFirstStarAncestor()Gets the first ancestor of this node that is of typeStarIFocusgetFocus(java.lang.String name)Prepares the candidate with the given namedoublegetHeight(Vector3b 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)doublegetHeight(Vector3b camPos, boolean useFuturePosition)Same asIFocus.getHeight(Vector3b)but with the option to use the future position of the body instead of the current one.doublegetHeight(Vector3b camPos, Vector3b nextPos)Same asIFocus.getHeight(Vector3b)but with the option to use the given future position of the body instead of the current one.doublegetHeightScale()Returns the height scale of this focus, or 0 if it has no height infolonggetId()Returns the unique id of this focusjava.lang.StringgetName()Returns the first name of this focusjava.lang.String[]getNames()Returns all names of this focusIFocusgetNext(ITimeFrameProvider time, ICamera camera, boolean force)OctreeNodegetOctant()Gets the octant this focus belongs to, if any.Matrix4dgetOrientation()Returns the orientation matrix of this focusQuaterniondgetOrientationQuaternion()Returns the orientation quaternion of this focusVector3bgetPos()Returns the positionVector2dgetPosSph()Gets the position in equatorial spherical coordinatesVector3bgetPredictedPosition(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 cameradoublegetRadius()Returns the radius of this focus object in internal unitsRotationComponentgetRotationComponent()Returns the rotation component of this focusintgetSceneGraphDepth()Gets the depth of this focus object in the scene graphdoublegetSize()Returns the size (diameter) of this entity in internal unitsdoublegetViewAngle()Returns the current view angle of this entity, in radiansdoublegetViewAngleApparent()Returns the current apparent view angle (view angle corrected with the field of view) of this entity, in radiansbooleanhasName(java.lang.String name)Checks whether the focus has the given namebooleanhasName(java.lang.String name, boolean matchCase)Checks whether the focus has the given namebooleanisActive()Returns whether this focus object is active or not.booleanisCoordinatesTimeOverflow()Checks whether this foucs is within its valid time range, so that it can be used as a focusbooleanisCopy()Whether this is a copy or notbooleanisOther()booleanisStar()booleanisStarGroup()booleanisUndefined()voidmakeFocus()Hook that runs when the candidate is actually made focusMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
distToCamera
public double distToCamera -
size
public double size -
radius
public double radius -
pos
-
pm
-
absolutePos
-
col
public float[] col -
name
public java.lang.String name -
type
public byte type
-
-
Constructor Details
-
NearbyRecord
public NearbyRecord()
-
-
Method Details
-
isStar
public boolean isStar() -
isStarGroup
public boolean isStarGroup() -
isOther
public boolean isOther() -
isUndefined
public boolean isUndefined() -
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
-
getName
public java.lang.String getName()Description copied from interface:IFocusReturns the first name of this focus -
getNames
public java.lang.String[] getNames()Description copied from interface:IFocusReturns all names of this focus -
hasName
public boolean hasName(java.lang.String name)Description copied from interface:IFocusChecks whether the focus has the given name -
hasName
public boolean hasName(java.lang.String name, boolean matchCase)Description copied from interface:IFocusChecks whether the focus has the given name -
getClosestName
public java.lang.String getClosestName()Description copied from interface:IFocusSame asIFocus.getName()- Specified by:
getClosestNamein interfaceIFocus- Returns:
- The name
-
getCandidateName
public java.lang.String 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 -
isActive
public boolean isActive()Description copied from interface:IFocusReturns whether this focus object is active or not. Useful for particle groups -
getPos
Description copied from interface:IFocusReturns the position -
getFirstStarAncestor
Description copied from interface:IFocusGets the first ancestor of this node that is of typeStar- Specified by:
getFirstStarAncestorin interfaceIFocus- Returns:
- The first ancestor of type
Star
-
getAbsolutePosition
Description copied from interface:IFocusReturns the absolute position of this entity in the native coordinates (equatorial system)- Specified by:
getAbsolutePositionin interfaceIFocus- Parameters:
out- Vector3d where to put the return value- 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:IFocus- 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 -
getNext
-
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 storedtime- The time frame providercamera- The cameraforce- 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
-
getViewAngle
public double getViewAngle()Description copied from interface:IFocusReturns the current view angle of this entity, in radians- Specified by:
getViewAnglein interfaceIFocus- Returns:
- The view angle in radians
-
getViewAngleApparent
public double getViewAngleApparent()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:
getViewAngleApparentin interfaceIFocus- Returns:
- The apparent view angle in radians
-
getCandidateViewAngleApparent
public double getCandidateViewAngleApparent()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:
getCandidateViewAngleApparentin 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 -
getHeight
Description copied from interface:IFocusReturns 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) -
getHeight
Description copied from interface:IFocusSame asIFocus.getHeight(Vector3b)but with the option to use the future position of the body instead of the current one. -
getHeight
Description copied from interface:IFocusSame asIFocus.getHeight(Vector3b)but with the option to use the given future position of the body instead of the current one. -
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
-
addHit
public void addHit(int screenX, int screenY, int w, int h, int pxdist, 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 -
addHit
public void addHit(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 -
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 foucs 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
-