Search in sources :

Example 16 with IFocus

use of gaiasky.scenegraph.IFocus in project gaiasky by langurmonkey.

the class OpenVRListener method select.

/**
 * Selects the object pointed by the given device.
 *
 * @param device
 */
private void select(VRDevice device) {
    // Selection
    StubModel sm = vrDeviceToModel.get(device);
    if (sm != null) {
        p0.set(sm.getBeamP0());
        p1.set(sm.getBeamP1());
        IFocus hit = getBestHit(p0, p1);
        if (hit != null) {
            EventManager.publish(Event.FOCUS_CHANGE_CMD, this, hit);
            EventManager.publish(Event.CAMERA_MODE_CMD, this, CameraMode.FOCUS_MODE);
        }
    } else {
        logger.info("Model corresponding to device not found");
    }
}
Also used : StubModel(gaiasky.scenegraph.StubModel) IFocus(gaiasky.scenegraph.IFocus)

Aggregations

IFocus (gaiasky.scenegraph.IFocus)16 SceneGraphNode (gaiasky.scenegraph.SceneGraphNode)6 Array (com.badlogic.gdx.utils.Array)3 CameraMode (gaiasky.scenegraph.camera.CameraManager.CameraMode)3 Actor (com.badlogic.gdx.scenes.scene2d.Actor)2 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)2 ChangeEvent (com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.ChangeEvent)2 PointCloudData (gaiasky.data.util.PointCloudData)2 ParticleGroup (gaiasky.scenegraph.ParticleGroup)2 NaturalCamera (gaiasky.scenegraph.camera.NaturalCamera)2 LoggerLevel (gaiasky.util.Logger.LoggerLevel)2 PrintWriter (java.io.PrintWriter)2 StringWriter (java.io.StringWriter)2 com.badlogic.gdx.scenes.scene2d.ui (com.badlogic.gdx.scenes.scene2d.ui)1 StringBuilder (com.badlogic.gdx.utils.StringBuilder)1 BookmarkNode (gaiasky.interafce.BookmarksManager.BookmarkNode)1 NewBookmarkFolderDialog (gaiasky.interafce.NewBookmarkFolderDialog)1 Invisible (gaiasky.scenegraph.Invisible)1 StubModel (gaiasky.scenegraph.StubModel)1 CatalogInfo (gaiasky.util.CatalogInfo)1