Class Proximity.NearbyRecord

java.lang.Object
gaiasky.util.camera.Proximity.NearbyRecord
All Implemented Interfaces:
IFocus
Enclosing class:
Proximity

public class Proximity.NearbyRecord extends Object implements IFocus
  • Field Details

    • distToCamera

      public double distToCamera
    • size

      public double size
    • radius

      public double radius
    • pos

      public Vector3d pos
    • pm

      public Vector3d pm
    • absolutePos

      public Vector3d absolutePos
    • col

      public float[] col
    • name

      public String 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()
    • getId

      public long getId()
      Description copied from interface: IFocus
      Returns the unique id of this focus.
      Specified by:
      getId in interface IFocus
      Returns:
      The id.
    • getCandidateId

      public long getCandidateId()
      Description copied from interface: IFocus
      Returns the id of the focus candidate of this object. Defaults to IFocus.getId().
      Specified by:
      getCandidateId in interface IFocus
      Returns:
      The id of the candidate.
    • getLocalizedName

      public String getLocalizedName()
      Description copied from interface: IFocus
      Returns the localized name of this focus. If it has no localized name, it returns the default name.
      Specified by:
      getLocalizedName in interface IFocus
      Returns:
      The localized name.
    • getName

      public String getName()
      Description copied from interface: IFocus
      Returns the first name of this focus.
      Specified by:
      getName in interface IFocus
      Returns:
      The first name.
    • getNames

      public String[] getNames()
      Description copied from interface: IFocus
      Returns all names of this focus.
      Specified by:
      getNames in interface IFocus
      Returns:
      All names of this focus.
    • hasName

      public boolean hasName(String name)
      Description copied from interface: IFocus
      Checks whether the focus has the given name.
      Specified by:
      hasName in interface IFocus
      Parameters:
      name - The name.
      Returns:
      True if there is a match.
    • hasName

      public boolean hasName(String name, boolean matchCase)
      Description copied from interface: IFocus
      Checks whether the focus has the given name.
      Specified by:
      hasName in interface IFocus
      Parameters:
      name - The name.
      matchCase - Whether to match the case when comparing.
      Returns:
      True if there is a match.
    • getClosestName

      public String getClosestName()
      Description copied from interface: IFocus
      Specified by:
      getClosestName in interface IFocus
      Returns:
      The name.
    • getCandidateName

      public String getCandidateName()
      Description copied from interface: IFocus
      Returns the name of the focus candidate of this object. Defaults to IFocus.getName().
      Specified by:
      getCandidateName in interface IFocus
      Returns:
      The name of the candidate.
    • getCt

      public ComponentTypes getCt()
      Description copied from interface: IFocus
      Returns the component types of this focus.
      Specified by:
      getCt in interface IFocus
      Returns:
      The component types.
    • isActive

      public boolean isActive()
      Description copied from interface: IFocus
      Returns whether this focus object is active or not. Useful for particle groups.
      Specified by:
      isActive in interface IFocus
      Returns:
      The active status.
    • getPos

      public Vector3b getPos()
      Description copied from interface: IFocus
      Returns the position.
      Specified by:
      getPos in interface IFocus
      Returns:
      The position.
    • getFirstStarAncestor

      public SceneGraphNode getFirstStarAncestor()
      Description copied from interface: IFocus
      Gets the first ancestor of this node that is of type Star.
      Specified by:
      getFirstStarAncestor in interface IFocus
      Returns:
      The first ancestor of type Star.
    • getAbsolutePosition

      public Vector3b getAbsolutePosition(Vector3b out)
      Description copied from interface: IFocus
      Returns the absolute position of this entity in the native coordinates (equatorial system).
      Specified by:
      getAbsolutePosition in interface IFocus
      Parameters:
      out - Vector3d where to put the return value.
      Returns:
      The absolute position, same as aux.
    • getAbsolutePosition

      public Vector3b getAbsolutePosition(String name, Vector3b out)
      Description copied from interface: IFocus
      Returns the absolute position of the entity identified by name within this entity in the native reference system.
      Specified by:
      getAbsolutePosition in interface IFocus
      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

      public Vector3b getClosestAbsolutePos(Vector3b out)
      Description copied from interface: IFocus
      Specified by:
      getClosestAbsolutePos in interface IFocus
      Parameters:
      out - Vector3d where to put the return value.
      Returns:
      The absolute position, same as aux.
    • getPosSph

      public Vector2d getPosSph()
      Description copied from interface: IFocus
      Gets the position in equatorial spherical coordinates.
      Specified by:
      getPosSph in interface IFocus
      Returns:
      The position in alpha, delta.
    • getNext

      public IFocus getNext(ITimeFrameProvider time, ICamera camera, boolean force)
      Specified by:
      getNext in interface IFocus
    • getPredictedPosition

      public Vector3b getPredictedPosition(Vector3b 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 interface IFocus
      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: IFocus
      Returns the current distance to the camera in internal units.
      Specified by:
      getDistToCamera in interface IFocus
      Returns:
      The current distance to the camera, in internal units.
    • getClosestDistToCamera

      public double getClosestDistToCamera()
      Description copied from interface: IFocus
      Specified by:
      getClosestDistToCamera in interface IFocus
      Returns:
      The distance to the camera in internal units.
    • getViewAngle

      public double getViewAngle()
      Description copied from interface: IFocus
      Returns the current view angle of this entity, in radians.
      Specified by:
      getViewAngle in interface IFocus
      Returns:
      The view angle in radians.
    • getViewAngleApparent

      public double getViewAngleApparent()
      Description copied from interface: IFocus
      Returns the current apparent view angle (view angle corrected with the field of view) of this entity, in radians.
      Specified by:
      getViewAngleApparent in interface IFocus
      Returns:
      The apparent view angle in radians.
    • getCandidateViewAngleApparent

      public double getCandidateViewAngleApparent()
      Description copied from interface: IFocus
      Returns the candidate apparent view angle (view angle corrected with the field of view) of this entity, in radians.
      Specified by:
      getCandidateViewAngleApparent in interface IFocus
      Returns:
      The apparent view angle in radians.
    • getAlpha

      public double getAlpha()
      Description copied from interface: IFocus
      Returns the right ascension angle of this focus object.
      Specified by:
      getAlpha in interface IFocus
      Returns:
      The right ascension angle in degrees.
    • getDelta

      public double getDelta()
      Description copied from interface: IFocus
      Returns the declination angle of this focus object.
      Specified by:
      getDelta in interface IFocus
      Returns:
      The declination angle in degrees.
    • getSize

      public double getSize()
      Description copied from interface: IFocus
      Returns the size (diameter) of this entity in internal units.
      Specified by:
      getSize in interface IFocus
      Returns:
      The size in internal units.
    • getRadius

      public double getRadius()
      Description copied from interface: IFocus
      Returns the radius of this focus object in internal units.
      Specified by:
      getRadius in interface IFocus
      Returns:
      The radius of the focus, in internal units.
    • getHeight

      public double getHeight(Vector3b camPos)
      Description copied from interface: IFocus
      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).
      Specified by:
      getHeight in interface IFocus
      Parameters:
      camPos - The camera position.
      Returns:
      The height of the projected position of the current camera.
    • getHeight

      public double getHeight(Vector3b camPos, boolean useFuturePosition)
      Description copied from interface: IFocus
      Same as IFocus.getHeight(Vector3b) but with the option to use the future position of the body instead of the current one.
      Specified by:
      getHeight in interface IFocus
      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.
    • getHeight

      public double getHeight(Vector3b camPos, Vector3b nextPos)
      Description copied from interface: IFocus
      Same as IFocus.getHeight(Vector3b) but with the option to use the given future position of the body instead of the current one.
      Specified by:
      getHeight in interface IFocus
      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
      Returns the height scale of this focus, or 0 if it has no height info.
      Specified by:
      getHeightScale in interface IFocus
      Returns:
      The height scale in internal units.
    • getAppmag

      public float getAppmag()
      Description copied from interface: IFocus
      Gets the apparent magnitude.
      Specified by:
      getAppmag in interface IFocus
      Returns:
      The apparent magnitude.
    • getAbsmag

      public float getAbsmag()
      Description copied from interface: IFocus
      Gets the absolute magnitude.
      Specified by:
      getAbsmag in interface IFocus
      Returns:
      The absolute magnitude.
    • getOrientation

      public Matrix4d getOrientation()
      Description copied from interface: IFocus
      Returns the orientation matrix of this focus.
      Specified by:
      getOrientation in interface IFocus
      Returns:
      The orientation matrix. Can be null.
    • getRotationComponent

      public RotationComponent getRotationComponent()
      Description copied from interface: IFocus
      Returns the rotation component of this focus.
      Specified by:
      getRotationComponent in interface IFocus
      Returns:
      The rotation component. Can be null.
    • getOrientationQuaternion

      public Quaterniond getOrientationQuaternion()
      Description copied from interface: IFocus
      Returns the orientation quaternion of this focus.
      Specified by:
      getOrientationQuaternion in interface IFocus
      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: IFocus
      Adds this focus to the hits list if it is hit by the [screenX, screenY] position.
      Specified by:
      addHit in interface IFocus
      Parameters:
      screenX - The x position of the hit.
      screenY - The y position of the hit.
      w - The viewport width.
      h - The viewport height.
      pxdist - The minimum pixel distance to consider as hit.
      camera - The camera.
      hits - The list where to add the element.
    • addHit

      public void addHit(Vector3d p0, Vector3d p1, NaturalCamera camera, com.badlogic.gdx.utils.Array<IFocus> hits)
      Description copied from interface: IFocus
      Adds this focus to the hits list if it is hit by the given ray.
      Specified by:
      addHit in interface IFocus
      Parameters:
      p0 - Start point of the ray.
      p1 - End point of the ray.
      camera - The camera.
      hits - The list where the focus is to be added.
    • makeFocus

      public void makeFocus()
      Description copied from interface: IFocus
      Hook that runs when the candidate is actually made focus.
      Specified by:
      makeFocus in interface IFocus
    • getFocus

      public IFocus getFocus(String name)
      Description copied from interface: IFocus
      Prepares the candidate with the given name.
      Specified by:
      getFocus in interface IFocus
      Parameters:
      name - The name in lower case.
    • isCoordinatesTimeOverflow

      public boolean isCoordinatesTimeOverflow()
      Description copied from interface: IFocus
      Checks whether this foucs is within its valid time range, so that it can be used as a focus.
      Specified by:
      isCoordinatesTimeOverflow in interface IFocus
      Returns:
      Whether the focus object is within its valid time range.
    • getSceneGraphDepth

      public int getSceneGraphDepth()
      Description copied from interface: IFocus
      Gets the depth of this focus object in the scene graph.
      Specified by:
      getSceneGraphDepth in interface IFocus
      Returns:
      The depth of the scene graph.
    • getOctant

      public OctreeNode getOctant()
      Description copied from interface: IFocus
      Gets the octant this focus belongs to, if any. This will return null if this focus is not part of an octree.
      Specified by:
      getOctant in interface IFocus
      Returns:
      The octant this focus belongs to. Null if it is not part of an octree.
    • isCopy

      public boolean isCopy()
      Description copied from interface: IFocus
      Whether this is a copy or not.
      Specified by:
      isCopy in interface IFocus
      Returns:
      Whether the object is a copy or not.
    • getColor

      public float[] getColor()
      Description copied from interface: IFocus
      Gets the color of this object.
      Specified by:
      getColor in interface IFocus
      Returns:
      The color as an RGBA float array.