Search in sources :

Example 1 with ICamera

use of gaiasky.scenegraph.camera.ICamera in project gaiasky by langurmonkey.

the class RelativisticEffectsManager method notify.

@Override
public void notify(final Event event, Object source, final Object... data) {
    if (event == Event.GRAV_WAVE_START) {
        int x = (Integer) data[0];
        int y = (Integer) data[1];
        ICamera cam = GaiaSky.instance.getICamera();
        screenCoords.set(x, y, 0.9f);
        cam.getCamera().unproject(screenCoords);
        screenCoords.nor();
        this.gw.set(screenCoords);
    }
}
Also used : ICamera(gaiasky.scenegraph.camera.ICamera)

Example 2 with ICamera

use of gaiasky.scenegraph.camera.ICamera in project gaiasky by langurmonkey.

the class MinimapWidget method update.

public void update() {
    ICamera cam = GaiaSky.instance.cameraManager;
    double distSun = cam.getPos().lend();
    for (IMinimapScale mms : scales) {
        if (mms.isActive(cam.getPos().tov3d(aux3d), distSun)) {
            mms.update();
            mms.renderSideProjection(sfb);
            mms.renderTopProjection(tfb);
            if (current == null || current != mms) {
                current = mms;
            }
            break;
        }
    }
}
Also used : ICamera(gaiasky.scenegraph.camera.ICamera)

Example 3 with ICamera

use of gaiasky.scenegraph.camera.ICamera in project gaiasky by langurmonkey.

the class ParticleGroup method getCandidateViewAngleApparent.

@Override
public double getCandidateViewAngleApparent() {
    if (candidateFocusIndex >= 0) {
        IParticleRecord candidate = pointData.get(candidateFocusIndex);
        Vector3d aux = candidate.pos(D31.get());
        ICamera camera = GaiaSky.instance.getICamera();
        return (float) ((size * .5e2f / aux.sub(camera.getPos()).len()) / camera.getFovFactor());
    } else {
        return -1;
    }
}
Also used : IParticleRecord(gaiasky.scenegraph.particle.IParticleRecord) ICamera(gaiasky.scenegraph.camera.ICamera)

Example 4 with ICamera

use of gaiasky.scenegraph.camera.ICamera in project gaiasky by langurmonkey.

the class Planet method renderClouds.

/**
 * Renders the clouds
 */
public void renderClouds(IntModelBatch modelBatch, float alpha, double t) {
    clc.touch();
    ICamera cam = GaiaSky.instance.getICamera();
    clc.mc.updateRelativisticEffects(cam);
    clc.mc.updateVelocityBufferUniforms(cam);
    clc.mc.setTransparency(alpha * opacity, GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_COLOR);
    modelBatch.render(clc.mc.instance, mc.env);
}
Also used : ICamera(gaiasky.scenegraph.camera.ICamera)

Example 5 with ICamera

use of gaiasky.scenegraph.camera.ICamera in project gaiasky by langurmonkey.

the class Planet method renderAtmosphere.

/**
 * Renders the atmosphere
 */
public void renderAtmosphere(IntModelBatch modelBatch, float alpha, RenderingContext rc) {
    // Atmosphere fades in between 1 and 2 degrees of view angle apparent
    ICamera cam = GaiaSky.instance.getICamera();
    float atmOpacity = (float) MathUtilsd.lint(viewAngle, 0.00745329f, 0.02490659f, 0f, 1f);
    if (atmOpacity > 0) {
        ac.updateAtmosphericScatteringParams(ac.mc.instance.materials.first(), alpha * atmOpacity, false, this, rc.vrOffset);
        ac.mc.updateRelativisticEffects(cam);
        modelBatch.render(ac.mc.instance, mc.env);
    }
}
Also used : ICamera(gaiasky.scenegraph.camera.ICamera)

Aggregations

ICamera (gaiasky.scenegraph.camera.ICamera)9 Camera (com.badlogic.gdx.graphics.Camera)2 Quaternion (com.badlogic.gdx.math.Quaternion)2 IParticleRecord (gaiasky.scenegraph.particle.IParticleRecord)2 Vector3d (gaiasky.util.math.Vector3d)1