Class ModelBody

    • Field Detail

      • TH_ANGLE_POINT

        protected static final double TH_ANGLE_POINT
      • wikiname

        public java.lang.String wikiname
        NAME FOR WIKIPEDIA
      • transformations

        public ITransform[] transformations
        TRANSFORMATIONS - are applied each cycle
      • locVaMultiplier

        public float locVaMultiplier
        Multiplier for Loc view angle
      • locThOverFactor

        public float locThOverFactor
        ThOverFactor for Locs
      • sizeScaleFactor

        public float sizeScaleFactor
        Size factor, which can be set to scale model objects up or down
      • fadeOpacity

        protected float fadeOpacity
        Fade opacity, special to model bodies
      • shadow

        public int shadow
        State flag; whether to render the shadow (number of times left)
      • refPlane

        public java.lang.String refPlane
        Name of the reference plane for this object. Defaults to equator
      • refPlaneTransform

        public java.lang.String refPlaneTransform
        Name of the transformation to the reference plane
      • inverseRefPlaneTransform

        public java.lang.String inverseRefPlaneTransform
      • shadowMapValues

        public double[] shadowMapValues
        Array with shadow camera distance, cam near and cam far as a function of the radius of the object
    • Constructor Detail

      • ModelBody

        public ModelBody()
    • Method Detail

      • THRESHOLD_POINT

        public double THRESHOLD_POINT()
        Angle limit for rendering as point. If angle is any bigger, we render with shader.
        Specified by:
        THRESHOLD_POINT in class CelestialBody
      • updateLocalTransform

        protected void updateLocalTransform()
        Update the local transform with the transform and the rotations/scales necessary. Override if your model contains more than just the position and size.
      • setToLocalTransform

        public void setToLocalTransform​(float sizeFactor,
                                        com.badlogic.gdx.math.Matrix4 localTransform,
                                        boolean forceUpdate)
      • setToLocalTransform

        public void setToLocalTransform​(float size,
                                        float sizeFactor,
                                        com.badlogic.gdx.math.Matrix4 localTransform,
                                        boolean forceUpdate)
      • renderTessellated

        public boolean renderTessellated()
      • dispose

        public void dispose()
        Specified by:
        dispose in interface com.badlogic.gdx.utils.Disposable
        Overrides:
        dispose in class SceneGraphNode
      • render

        public void render​(IntModelBatch modelBatch,
                           float alpha,
                           double t,
                           boolean shadowEnv)
        Model opaque rendering. Disable shadow mapping
      • withinMagLimit

        public boolean withinMagLimit()
        Description copied from interface: IFocus
        Returns true if the focus is within the magnitude limit defined in GlobalConf
        Specified by:
        withinMagLimit in interface IFocus
        Overrides:
        withinMagLimit in class CelestialBody
        Returns:
        True if focus within magnitude limit
      • getWikiname

        public java.lang.String getWikiname()
      • setWikiname

        public void setWikiname​(java.lang.String wikiname)
      • setLocvamultiplier

        public void setLocvamultiplier​(java.lang.Double val)
      • setLocthoverfactor

        public void setLocthoverfactor​(java.lang.Double val)
      • setTransformations

        public void setTransformations​(java.lang.Object[] transformations)
      • getPositionAboveSurface

        public Vector3d getPositionAboveSurface​(double longitude,
                                                double latitude,
                                                double distance,
                                                Vector3d out)
        Returns the cartesian position in the internal reference system above the surface at the given longitude and latitude and distance.
        Parameters:
        longitude - The longitude in deg
        latitude - The latitude in deg
        distance - The distance in km
        out - The vector to store the result
        Returns:
        The cartesian position above the surface of this body
      • getHeight

        public double getHeight​(Vector3d 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
        Overrides:
        getHeight in class AbstractPositionEntity
        Parameters:
        camPos - The camera position
        Returns:
        The height of the projected position of the current camera
      • getHeight

        public double getHeight​(Vector3d camPos,
                                boolean useFuturePosition)
        Description copied from interface: IFocus
        Same as IFocus.getHeight(Vector3d) but with the option to use the future position of the body instead of the current one.
        Specified by:
        getHeight in interface IFocus
        Overrides:
        getHeight in class AbstractPositionEntity
        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​(Vector3d camPos,
                                Vector3d nextPos)
        Description copied from interface: IFocus
        Same as IFocus.getHeight(Vector3d) but with the option to use the given future position of the body instead of the current one.
        Specified by:
        getHeight in interface IFocus
        Overrides:
        getHeight in class AbstractPositionEntity
        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
        Overrides:
        getHeightScale in class AbstractPositionEntity
        Returns:
        The height scale in internal units
      • prepareShadowEnvironment

        protected void prepareShadowEnvironment()
        Sets the shadow environment
      • addHit

        public void addHit​(int screenX,
                           int screenY,
                           int w,
                           int h,
                           int minPixDist,
                           NaturalCamera camera,
                           com.badlogic.gdx.utils.Array<IFocus> hits)
        If we render the model, we set up a sphere at the object's position with its radius and check for intersections with the ray
        Specified by:
        addHit in interface IFocus
        Overrides:
        addHit in class CelestialBody
        Parameters:
        screenX - The x position of the hit
        screenY - The y position of the hit
        w - The viewport width
        h - The viewport height
        minPixDist - 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
        Overrides:
        addHit in class CelestialBody
        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
      • isShadow

        public boolean isShadow()
        Whether shadows should be rendered for this object
        Returns:
        Whether shadows should be rendered for this object
      • setShadowvalues

        public void setShadowvalues​(double[] shadowMapValues)
        Sets the shadow mapping values for this object
        Parameters:
        shadowMapValues - The values
      • setSizescalefactor

        public void setSizescalefactor​(java.lang.Double sizescalefactor)
      • setRefplane

        public void setRefplane​(java.lang.String refplane)