Search in sources :

Example 6 with Vector3d

use of gaiasky.util.math.Vector3d in project gaiasky by langurmonkey.

the class Loc method render.

/**
 * Label rendering.
 */
@Override
public void render(ExtSpriteBatch batch, ExtShaderProgram shader, FontRenderSystem sys, RenderingContext rc, ICamera camera) {
    Vector3d pos = D31.get();
    textPosition(camera, pos);
    shader.setUniformf("u_viewAngle", forceLabel ? 2f : (float) (viewAngleApparent * ((ModelBody) parent).locVaMultiplier * Constants.U_TO_KM));
    shader.setUniformf("u_viewAnglePow", 1f);
    shader.setUniformf("u_thOverFactor", forceLabel ? 1f : ((ModelBody) parent).locThOverFactor / (float) Constants.DISTANCE_SCALE_FACTOR);
    shader.setUniformf("u_thOverFactorScl", 1f);
    render3DLabel(batch, shader, sys.fontDistanceField, camera, rc, text(), pos, distToCamera, textScale() * camera.getFovFactor(), textSize() * camera.getFovFactor(), this.forceLabel);
}
Also used : Vector3d(gaiasky.util.math.Vector3d)

Example 7 with Vector3d

use of gaiasky.util.math.Vector3d in project gaiasky by langurmonkey.

the class Loc method updateLocal.

@Override
public void updateLocal(ITimeFrameProvider time, ICamera camera) {
    if (parent.viewAngle > ((ModelBody) parent).THRESHOLD_QUAD() * 30f || camera.isFocus(this)) {
        updateLocalValues(time, camera);
        this.translation.add(pos);
        this.opacity = this.getVisibilityOpacityFactor();
        Vector3d aux = D31.get();
        this.distToCamera = (float) translation.put(aux).len();
        this.viewAngle = (float) FastMath.atan(size / distToCamera);
        this.viewAngleApparent = this.viewAngle / camera.getFovFactor();
        if (!copy) {
            addToRenderLists(camera);
        }
    }
}
Also used : Vector3d(gaiasky.util.math.Vector3d)

Example 8 with Vector3d

use of gaiasky.util.math.Vector3d in project gaiasky by langurmonkey.

the class ParticleRecord method beta.

/**
 * Ecliptic latitude in degrees.
 *
 * @return The ecliptic latitude, in degrees
 */
@Override
public double beta() {
    Vector3d cartEclPos = pos(aux3d1.get()).mul(Coordinates.eqToEcl());
    Vector3d sphPos = Coordinates.cartesianToSpherical(cartEclPos, aux3d2.get());
    return MathUtilsd.radDeg * sphPos.y;
}
Also used : Vector3d(gaiasky.util.math.Vector3d)

Example 9 with Vector3d

use of gaiasky.util.math.Vector3d in project gaiasky by langurmonkey.

the class ParticleRecord method lambda.

/**
 * Ecliptic longitude in degrees.
 *
 * @return The ecliptic longitude, in degrees
 */
@Override
public double lambda() {
    Vector3d cartEclPos = pos(aux3d1.get()).mul(Coordinates.eqToEcl());
    Vector3d sphPos = Coordinates.cartesianToSpherical(cartEclPos, aux3d2.get());
    return MathUtilsd.radDeg * sphPos.x;
}
Also used : Vector3d(gaiasky.util.math.Vector3d)

Example 10 with Vector3d

use of gaiasky.util.math.Vector3d in project gaiasky by langurmonkey.

the class SolarNeighbourhoodMinimapScale method position.

public float[] position(Vector3d pos, float[] out) {
    Vector3d p = aux3d1.set(pos).mul(trans);
    Vector2d pos2d = aux2d1;
    pos2d.set(p.z, p.y).scl(from);
    float cx = u2Px(pos2d.x, side2);
    float cy = u2Px(pos2d.y, sideshort2);
    out[0] = cx;
    out[1] = cy;
    pos2d.set(-p.x, p.z).scl(from);
    cx = u2Px(pos2d.x, side2);
    cy = u2Px(pos2d.y, side2);
    out[2] = cx;
    out[3] = cy;
    return out;
}
Also used : Vector2d(gaiasky.util.math.Vector2d) Vector3d(gaiasky.util.math.Vector3d)

Aggregations

Vector3d (gaiasky.util.math.Vector3d)120 IParticleRecord (gaiasky.scenegraph.particle.IParticleRecord)11 Array (com.badlogic.gdx.utils.Array)10 Vector3 (com.badlogic.gdx.math.Vector3)8 Vector3b (gaiasky.util.math.Vector3b)8 PointCloudData (gaiasky.data.util.PointCloudData)7 Keyframe (gaiasky.desktop.util.camera.Keyframe)5 Matrix4d (gaiasky.util.math.Matrix4d)5 Quaterniond (gaiasky.util.math.Quaterniond)5 ArrayList (java.util.ArrayList)5 BufferedReader (java.io.BufferedReader)4 InputStreamReader (java.io.InputStreamReader)4 PerspectiveCamera (com.badlogic.gdx.graphics.PerspectiveCamera)3 ChangeEvent (com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.ChangeEvent)3 Vector2d (gaiasky.util.math.Vector2d)3 Path (java.nio.file.Path)3 Date (java.util.Date)3 Matrix4 (com.badlogic.gdx.math.Matrix4)2 OrbitComponent (gaiasky.scenegraph.component.OrbitComponent)2 ParticleRecord (gaiasky.scenegraph.particle.ParticleRecord)2