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);
}
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);
}
}
}
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;
}
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;
}
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;
}
Aggregations