app/src/main/java/fi/finwe/orion360/sdk/pro/examples/widget/InteractiveHotspots.java
protected SelectablePointerIcon createStartHotSpot(float yawDeg, float pitchDeg, float rollDeg) {

        // Create a new hotspot as a selectable pointer icon widget.
        SelectablePointerIcon hotspot = new SelectablePointerIcon();

        // Set the location of the hotspot using Euler angles.
        hotspot.setLocationPolarZXYDeg(yawDeg, pitchDeg, rollDeg, HOTSPOT_LAYER_RADIUS);

        // Set the size of the hotspot as a scale factor relative to image asset size.
        hotspot.setScale(HOTSPOT_SCALE_FACTOR, HOTSPOT_SCALE_FOCUSED_MAX);

        // Set the icon for the hotspot as a PNG image. */
        hotspot.getIcon().bindTexture(OrionTexture.createTextureFromURI(this,
                getString(R.string.asset_hotspot_start)));

        // Adjust hotspot icon's alpha value to make it a little bit transparent.
        hotspot.getIcon().setAmpAlpha(0.90f);

        // Set the pie (selection) animation for the hotspot as a PNG image.
        // A pie animation image is drawn as a pie chart whose angle grows steadily, resulting
        // to a clock hand type movement that is suitable for illustrating timed triggering.
        hotspot.getPieSprite().bindTexture(OrionTexture.createTextureFromURI(this,
                getString(R.string.asset_hotspot_pie)));

        // Set the pointer i.e. scene item whose nearness to watch, typically the camera.
        // This way we know if user is looking at the hotspot.
        hotspot.setPointer(mCamera);

        // When hotspot is focused, we keep counting frames until a given frame count is reached
        // and it is time to trigger the hotspot action. Notice that if end-user looks away and
        // hotspot focus is lost, we do not immediately reset the count but start decreasing it
        // slowly so end-user can focus on the hotspot again if she accidentally moved away.
        // The rendering runs at 60 framer per second (FPS), if not limited by weak hardware.
        hotspot.setSelectionTriggerFrameCount(HOTSPOT_TRIGGER_DELAY_IN_FRAMES);

        // Create a listener so that we can respond to selection events.
        // Notice that these callbacks will be run on the UI thread, not on the GL thread whose
        // job is to keep rendering at constant pace (time critical).
        hotspot.setUiThreadListener(new SelectablePointerIcon.Listener() {

            @Override
            public void onSelectionTrigger() {
                Log.d(TAG, "Hotspot triggered!");
                start();
            }

            @Override
            public void onSelectionFocusLost() {
                Log.d(TAG, "Hotspot focus lost");
            }

            @Override
            public void onSelectionFocusGained() {
                Log.d(TAG, "Hotspot focus gained");
            }

        });

        return hotspot;
    }
/**
     * Creates a 'Start' hotspot at the direction given as Euler angles.
     *
     * @param yawDeg The yaw angle in degrees.
     * @param pitchDeg The pitch angle in degrees.
     * @param rollDeg The roll angle in degrees.
     */
Creates a 'Start' hotspot at the direction given as Euler angles.
@param yawDeg The yaw angle in degrees.
@param pitchDeg The pitch angle in degrees.
@param rollDeg The roll angle in degrees.
Creates a ' Start ' hotspot at the direction given as Euler angles . @param yawDeg The yaw angle in degrees . @param pitchDeg The pitch angle in degrees . @param rollDeg The roll angle in degrees .
protected SelectablePointerIcon createStartHotSpot(float yawDeg, float pitchDeg, float rollDeg) {
        SelectablePointerIcon hotspot = new SelectablePointerIcon();
        hotspot.setLocationPolarZXYDeg(yawDeg, pitchDeg, rollDeg, HOTSPOT_LAYER_RADIUS);
        hotspot.setScale(HOTSPOT_SCALE_FACTOR, HOTSPOT_SCALE_FOCUSED_MAX);
        hotspot.getIcon().bindTexture(OrionTexture.createTextureFromURI(this,
                getString(R.string.asset_hotspot_start)));
        hotspot.getIcon().setAmpAlpha(0.90f);
        hotspot.getPieSprite().bindTexture(OrionTexture.createTextureFromURI(this,
                getString(R.string.asset_hotspot_pie)));
        hotspot.setPointer(mCamera);
        hotspot.setSelectionTriggerFrameCount(HOTSPOT_TRIGGER_DELAY_IN_FRAMES);
        hotspot.setUiThreadListener(new SelectablePointerIcon.Listener() {
            @Override
            public void onSelectionTrigger() {
                Log.d(TAG, "Hotspot triggered!");
                start();
            }
            @Override
            public void onSelectionFocusLost() {
                Log.d(TAG, "Hotspot focus lost");
            }
            @Override
            public void onSelectionFocusGained() {
                Log.d(TAG, "Hotspot focus gained");
            }
        });
        return hotspot;
    }
protected SelectablePointerIcon createStartHotSpot ( float yawDeg , float pitchDeg , float rollDeg ) { SelectablePointerIcon hotspot = new SelectablePointerIcon ( ) ; hotspot . setLocationPolarZXYDeg ( yawDeg , pitchDeg , rollDeg , HOTSPOT_LAYER_RADIUS ) ; hotspot . setScale ( HOTSPOT_SCALE_FACTOR , HOTSPOT_SCALE_FOCUSED_MAX ) ; hotspot . getIcon ( ) . bindTexture ( OrionTexture . createTextureFromURI ( this , getString ( R . string . asset_hotspot_start ) ) ) ; hotspot . getIcon ( ) . setAmpAlpha ( 0.90f ) ; hotspot . getPieSprite ( ) . bindTexture ( OrionTexture . createTextureFromURI ( this , getString ( R . string . asset_hotspot_pie ) ) ) ; hotspot . setPointer ( mCamera ) ; hotspot . setSelectionTriggerFrameCount ( HOTSPOT_TRIGGER_DELAY_IN_FRAMES ) ; hotspot . setUiThreadListener ( new SelectablePointerIcon . Listener ( ) { @ Override public void onSelectionTrigger ( ) { Log . d ( TAG , "Hotspot triggered!" ) ; start ( ) ; } @ Override public void onSelectionFocusLost ( ) { Log . d ( TAG , "Hotspot focus lost" ) ; } @ Override public void onSelectionFocusGained ( ) { Log . d ( TAG , "Hotspot focus gained" ) ; } } ) ; return hotspot ; }
Creates a 'Start' hotspot at the direction given as Euler angles.
Creates a ' Start ' hotspot at the direction given as Euler angles .
// Create a new hotspot as a selectable pointer icon widget. // Set the location of the hotspot using Euler angles. // Set the size of the hotspot as a scale factor relative to image asset size. // Set the icon for the hotspot as a PNG image. */ // Adjust hotspot icon's alpha value to make it a little bit transparent. // Set the pie (selection) animation for the hotspot as a PNG image. // A pie animation image is drawn as a pie chart whose angle grows steadily, resulting // to a clock hand type movement that is suitable for illustrating timed triggering. // Set the pointer i.e. scene item whose nearness to watch, typically the camera. // This way we know if user is looking at the hotspot. // When hotspot is focused, we keep counting frames until a given frame count is reached // and it is time to trigger the hotspot action. Notice that if end-user looks away and // hotspot focus is lost, we do not immediately reset the count but start decreasing it // slowly so end-user can focus on the hotspot again if she accidentally moved away. // The rendering runs at 60 framer per second (FPS), if not limited by weak hardware. // Create a listener so that we can respond to selection events. // Notice that these callbacks will be run on the UI thread, not on the GL thread whose // job is to keep rendering at constant pace (time critical).