• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CardboardView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.vrtoolkit.cardboard.CardboardView的典型用法代码示例。如果您正苦于以下问题:Java CardboardView类的具体用法?Java CardboardView怎么用?Java CardboardView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CardboardView类属于com.google.vrtoolkit.cardboard包,在下文中一共展示了CardboardView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.google.vrtoolkit.cardboard.CardboardView; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_NO_TITLE);

    setContentView(R.layout.main);

    view = (CardboardView)findViewById(R.id.map);
    mapController = new CardboardMapController(this, "vr_scene.yaml", view);

    view.setRenderer(mapController);

    HttpHandler handler = new HttpHandler();
    File cacheDir = getExternalCacheDir();
    if (cacheDir != null && cacheDir.exists()) {
        handler.setCache(new File(cacheDir, "tile_cache"), 30 * 1024 * 1024);
    }

    mapController.setHttpHandler(handler);

    setCardboardView(view);
    setConvertTapIntoTrigger(true);

    goToLocation(locationIndex);
}
 
开发者ID:tangrams,项目名称:tangram-cardboard,代码行数:27,代码来源:MainActivity.java


示例2: onCreate

import com.google.vrtoolkit.cardboard.CardboardView; //导入依赖的package包/类
/**
 * Sets the view to our CardboardView and initializes the transformation matrices we will use
 * to render our scene.
 */
@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  setContentView(R.layout.common_ui);
  CardboardView cardboardView = (CardboardView) findViewById(R.id.cardboard_view);
  cardboardView.setRestoreGLStateEnabled(false);
  cardboardView.setRenderer(this);
  setCardboardView(cardboardView);

  notes = new ConcurrentLinkedQueue<Note>();
  newNotes = new ConcurrentLinkedQueue<float[]>();
  camera = new float[16];
  view = new float[16];
  modelViewProjection = new float[16];
  modelView = new float[16];
  modelFloor = new float[16];
  headForward = new float[3];
  headView = new float[16];
  //vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);

  overlayView = (CardboardOverlayView) findViewById(R.id.overlay);
  //overlayView.show3DToast("Pull the magnet when you find an object.");
}
 
开发者ID:grahamrob,项目名称:note60,代码行数:29,代码来源:MainActivity.java


示例3: onCreate

import com.google.vrtoolkit.cardboard.CardboardView; //导入依赖的package包/类
/**
 * Sets the view to our CardboardView and initializes the transformation matrices we will use
 * to render our scene.
 */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.common_ui);
    CardboardView cardboardView = (CardboardView) findViewById(R.id.cardboard_view);
    cardboardView.setRenderer(this);
    setCardboardView(cardboardView);

    mModelCube = new float[16];
    mCamera = new float[16];
    mView = new float[16];
    mModelViewProjection = new float[16];
    mModelView = new float[16];
    mModelFloor = new float[16];
    mHeadView = new float[16];
    mVibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);


    mOverlayView = (CardboardOverlayView) findViewById(R.id.overlay);
    mOverlayView.show3DToast("Pull the magnet when you find an object.");
}
 
开发者ID:kothuri2,项目名称:MoleculeVR,代码行数:27,代码来源:MainActivity.java


示例4: onCreate

import com.google.vrtoolkit.cardboard.CardboardView; //导入依赖的package包/类
/**
 * Sets the view to our CardboardView and initializes the transformation matrices we will use
 * to render our scene.
 */
@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  setContentView(R.layout.common_ui);
  CardboardView cardboardView = (CardboardView) findViewById(R.id.cardboard_view);
  cardboardView.setRenderer(this);
  setCardboardView(cardboardView);

  modelCube = new float[16];
  camera = new float[16];
  view = new float[16];
  modelViewProjection = new float[16];
  modelView = new float[16];
  modelFloor = new float[16];
  headView = new float[16];
  vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);


  overlayView = (CardboardOverlayView) findViewById(R.id.overlay);
  overlayView.show3DToast("Pull the magnet when you find an object.");
}
 
开发者ID:ArcadiusK,项目名称:techcrunch-disrupt-esri-android,代码行数:27,代码来源:MainActivity.java


示例5: onCreate

import com.google.vrtoolkit.cardboard.CardboardView; //导入依赖的package包/类
/**
 * Sets the view to our CardboardView and initializes the transformation matrices we will use
 * to render our scene.
 */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);



    setContentView(R.layout.common_ui);
    CardboardView cardboardView = (CardboardView) findViewById(R.id.cardboard_view);

    cardboardView.setRenderer(this);
    setCardboardView(cardboardView);

    mModelCube = new float[16];
    mCamera = new float[16];
    mView = new float[16];
    mModelViewProjection = new float[16];
    mModelView = new float[16];
    mModelFloor = new float[16];
    mHeadView = new float[16];
    mVibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);

    mOverlayView = (CardboardOverlayView) findViewById(R.id.overlay);
    mOverlayView.show3DToast("Pull the magnet when you find an object.");

}
 
开发者ID:mkfuchs,项目名称:cardboardVideoSample,代码行数:30,代码来源:MainActivity.java


示例6: onCreate

import com.google.vrtoolkit.cardboard.CardboardView; //导入依赖的package包/类
/**
 * Sets the view to our CardboardView and initializes the transformation matrices we will use
 * to render our scene.
 */
@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  setContentView(R.layout.common_ui);
  CardboardView cardboardView = (CardboardView) findViewById(R.id.cardboard_view);
  cardboardView.setRestoreGLStateEnabled(false);
  cardboardView.setRenderer(this);
  setCardboardView(cardboardView);
    for (int i = 0; i < modelCubes.length; i++)
    {
      modelCubes[i] = new float[16];
    }
  camera = new float[16];
  view = new float[16];
  modelViewProjection = new float[16];
  modelView = new float[16];
  modelFloor = new float[16];
  headView = new float[16];
  vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);


  overlayView = (CardboardOverlayView) findViewById(R.id.overlay);
  overlayView.show3DToast("Pull the magnet on the left side to choose an option.");
}
 
开发者ID:Shounak,项目名称:InSight-HackHarvard,代码行数:30,代码来源:MainActivity.java


示例7: onCreate

import com.google.vrtoolkit.cardboard.CardboardView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	requestWindowFeature(Window.FEATURE_NO_TITLE);
	getWindow().setFlags(
		    WindowManager.LayoutParams.FLAG_FULLSCREEN,
		    WindowManager.LayoutParams.FLAG_FULLSCREEN);
	super.onCreate(savedInstanceState);
	
	LinearLayout ln = new LinearLayout(this);
	
	cbView = new CardboardView(this);
	
	cbView.setRenderer(this);
	cbView.setPreserveEGLContextOnPause(true);
	setContentView(cbView);
	
	cbView.setOnClickListener(new View.OnClickListener() {
		
		@Override
		public void onClick(View v) {
			onCardboardTrigger();
		}
	});
	mHideButtonsThread.start();
}
 
开发者ID:triforce930,项目名称:CardboardVideoPlayer,代码行数:26,代码来源:MainActivity.java


示例8: onCreate

import com.google.vrtoolkit.cardboard.CardboardView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_cardboardui);
    CardboardView cardboardView = (CardboardView) findViewById(R.id.cardboard_view);
    cardboardView.setRenderer(this);
    setCardboardView(cardboardView);
    setConvertTapIntoTrigger(true);
}
 
开发者ID:triforce930,项目名称:cardboard_ui_framework,代码行数:10,代码来源:CardboardUIActivity.java


示例9: onCreate

import com.google.vrtoolkit.cardboard.CardboardView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.viewer_layout);

    if (getIntent() != null && getIntent().getData() != null) {
        Uri uri = getIntent().getData();
        String type = getIntent().getType();
        if (type.contains("image")) {
            type = "Image";
            mRenderer = new ImageRenderer(this, uri);
        } else if (type.contains("video")) {
            type = "Video";
            mRenderer = new VideoRenderer(this, uri);
        } else {
            finish();
        }
        CardboardView cardboardView = (CardboardView) findViewById(R.id.cardboard_view);
        cardboardView.setSettingsButtonEnabled(false);
        cardboardView.setRestoreGLStateEnabled(false);
        cardboardView.setRenderer(mRenderer);
        setCardboardView(cardboardView);
        getCardboardView().setVRModeEnabled(false);
        openDialog(type);
    } else {
        finish();
    }
}
 
开发者ID:LGDeveloper,项目名称:FriendsCameraSDK-android,代码行数:29,代码来源:ViewerActivity.java


示例10: onCreate

import com.google.vrtoolkit.cardboard.CardboardView; //导入依赖的package包/类
/**
   * Sets the view to our CardboardView and initializes the transformation matrices we will use
   * to render our scene.
   */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.common_ui);
    CardboardView cardboardView = (CardboardView) findViewById(R.id.cardboard_view);
    cardboardView.setRestoreGLStateEnabled(false);
    cardboardView.setRenderer(this);
    setCardboardView(cardboardView);

    modelCube = new float[16];
    camera = new float[16];
    view = new float[16];
    modelViewProjection = new float[16];
    modelView = new float[16];
    modelFloor = new float[16];
    // Model first appears directly in front of user.
    modelPosition = new float[] {0.0f, 0.0f, -MAX_MODEL_DISTANCE / 2.0f};
    headRotation = new float[4];
    headView = new float[16];
    vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);

    overlayView = (CardboardOverlayView) findViewById(R.id.overlay);
//    overlayView.show3DToast("Pull the magnet when you find an object.");

  }
 
开发者ID:openforeveryone,项目名称:CardboardStereoVideo,代码行数:31,代码来源:MainActivity.java


示例11: onCreate

import com.google.vrtoolkit.cardboard.CardboardView; //导入依赖的package包/类
/**
 * Sets the view to our CardboardView and initializes the transformation matrices we will use
 * to render our scene.
 */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.common_ui);
    CardboardView cardboardView = (CardboardView) findViewById(R.id.cardboard_view);
    cardboardView.setRenderer(this);
    setCardboardView(cardboardView);

}
 
开发者ID:gkortsaridis,项目名称:GoogleCardboardPhotoSphere-VR-,代码行数:15,代码来源:MainActivity.java


示例12: onCreate

import com.google.vrtoolkit.cardboard.CardboardView; //导入依赖的package包/类
/**
 * Sets the view to our CardboardView and initializes the transformation matrices we will use
 * to render our scene.
 */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.common_ui);
    mCardboardView = (CardboardView) findViewById(R.id.cardboard_view);
    mCardboardView.setRenderer(this);
    setCardboardView(mCardboardView);

    playMusic();


}
 
开发者ID:pollux-,项目名称:GoogleCardBoardVr-360-PhotoSphere,代码行数:18,代码来源:MainActivity.java


示例13: onCreate

import com.google.vrtoolkit.cardboard.CardboardView; //导入依赖的package包/类
/**
 * Sets the view to our CardboardView and initializes the transformation matrices we will use
 * to render our scene.
 */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.common_ui);
    cardboardView = (CardboardView) findViewById(R.id.cardboard_view);
    setCardboardView(cardboardView);

    initGameEngine( getIntent().getBooleanExtra( "VRMODE", false ), getIntent().getBooleanExtra( "MULTIPLAYER", false ) );
}
 
开发者ID:TheFakeMontyOnTheRun,项目名称:droidhunterredux,代码行数:15,代码来源:PlayGameActivity.java


示例14: onCreate

import com.google.vrtoolkit.cardboard.CardboardView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.common_ui);
    CardboardView cardboardView = (CardboardView)findViewById(R.id.cardboard_view);
    cardboardView.setRenderer(this);
    setCardboardView(cardboardView);

    final ImageView imageView1 = (ImageView)findViewById(R.id.image_view1);
    final ImageView imageView2 = (ImageView)findViewById(R.id.image_view2);
    final TextView textView1 = (TextView)findViewById(R.id.text_view1);
    final TextView textView2 = (TextView)findViewById(R.id.text_view2);

    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE);

    sumoClient = new SumoClient(SUMO_ADDR, new SumoImageCallback() {
        @Override
        public void OnImage(final Bitmap bitmap) {
            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    imageView1.setImageBitmap(bitmap);
                    imageView2.setImageBitmap(bitmap);
                    if (sumoClient.session.batteryPercentage >= 0) {
                        textView1.setText(String.format("%d%%", sumoClient.session.batteryPercentage));
                        textView2.setText(String.format("%d%%", sumoClient.session.batteryPercentage));
                    }
                }
            });
        }
    });
}
 
开发者ID:psyark,项目名称:CardboardSumo,代码行数:34,代码来源:FullscreenActivity.java


示例15: enableRenderer

import com.google.vrtoolkit.cardboard.CardboardView; //导入依赖的package包/类
protected void enableRenderer(CardboardView.StereoRenderer stereoRenderer) {
    // Check OpenGL ES 2.0 support
    if (OpenGLCheck.hasOpenGLES20Support(this)) {
        if (stereoRenderer != null) {
            mVrView.setRenderer(stereoRenderer);
        }
    } else {
        Log.wtf(TAG, getString(R.string.noOpenGLSupport));
        finish();
    }
}
 
开发者ID:VirtualWalker,项目名称:RandCity,代码行数:12,代码来源:VRActivity.java


示例16: createCardBoardView

import com.google.vrtoolkit.cardboard.CardboardView; //导入依赖的package包/类
protected View createCardBoardView(AndroidApplicationBase application) {
   CardboardView cardboardView = new CardboardView(application.getContext());
   cardboardView.setRestoreGLStateEnabled(false);
   cardboardView.setRenderer(this);
   return cardboardView;
}
 
开发者ID:raphaelbruno,项目名称:ZombieInvadersVR,代码行数:7,代码来源:CardBoardGraphics.java


示例17: init

import com.google.vrtoolkit.cardboard.CardboardView; //导入依赖的package包/类
private void init (ApplicationListener listener, AndroidApplicationConfiguration config, boolean isForView) {
   if (this.getVersion() < MINIMUM_SDK) {
      throw new GdxRuntimeException("LibGDX requires Android API Level " + MINIMUM_SDK + " or later.");
   }
   graphics = new CardBoardGraphics(this, config, config.resolutionStrategy == null ? new FillResolutionStrategy()
      : config.resolutionStrategy);
   input = AndroidInputFactory.newAndroidInput(this, this, graphics.view, config);
   audio = new AndroidAudio(this, config);
   this.getFilesDir(); // workaround for Android bug #10515463
   files = new AndroidFiles(this.getAssets(), this.getFilesDir().getAbsolutePath());
   net = new AndroidNet(this);
   this.listener = listener;
   this.handler = new Handler();
   this.useImmersiveMode = config.useImmersiveMode;
   this.hideStatusBar = config.hideStatusBar;

   // Add a specialized audio lifecycle listener
   addLifecycleListener(new LifecycleListener() {

      @Override
      public void resume () {
         // No need to resume audio here
      }

      @Override
      public void pause () {
         audio.pause();
      }

      @Override
      public void dispose () {
         audio.dispose();
      }
   });

   Gdx.app = this;
   Gdx.input = this.getInput();
   Gdx.audio = this.getAudio();
   Gdx.files = this.getFiles();
   Gdx.graphics = this.getGraphics();
   Gdx.net = this.getNet();

   if (!isForView) {
      try {
         requestWindowFeature(Window.FEATURE_NO_TITLE);
      } catch (Exception ex) {
         log("AndroidApplication", "Content already displayed, cannot request FEATURE_NO_TITLE", ex);
      }
      getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
      getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
      setContentView(graphics.getView(), createLayoutParams());
      setCardboardView((CardboardView)graphics.getView());
   }

   createWakeLock(config.useWakelock);
   hideStatusBar(this.hideStatusBar);
   useImmersiveMode(this.useImmersiveMode);
   if (this.useImmersiveMode && getVersion() >= Build.VERSION_CODES.KITKAT) {
      try {
         Class<?> vlistener = Class.forName("com.badlogic.gdx.backends.android.AndroidVisibilityListener");
         Object o = vlistener.newInstance();
         Method method = vlistener.getDeclaredMethod("createListener", AndroidApplicationBase.class);
         method.invoke(o, this);
      } catch (Exception e) {
         log("AndroidApplication", "Failed to create AndroidVisibilityListener", e);
      }
   }
}
 
开发者ID:raphaelbruno,项目名称:ZombieInvadersVR,代码行数:69,代码来源:CardBoardAndroidApplication.java


示例18: CardboardMapController

import com.google.vrtoolkit.cardboard.CardboardView; //导入依赖的package包/类
public CardboardMapController(Context context, String sceneFilePath, CardboardView view) {
    super(context, sceneFilePath);
    mapView = view.getGLSurfaceView();
}
 
开发者ID:tangrams,项目名称:tangram-cardboard,代码行数:5,代码来源:CardboardMapController.java


示例19: getSurfaceView

import com.google.vrtoolkit.cardboard.CardboardView; //导入依赖的package包/类
public CardboardView getSurfaceView() {
    return mSurfaceView;
}
 
开发者ID:godstale,项目名称:VR-Defense-Game,代码行数:4,代码来源:VRActivity.java


示例20: layoutDisplay

import com.google.vrtoolkit.cardboard.CardboardView; //导入依赖的package包/类
public void layoutDisplay() {
    logger.log(Level.FINE, "Splash Screen Picture Resource ID: {0}", splashPicID);
    //view = (CardboardView) findViewById(com.mycompany.mygame.R.id.cardboard_view);
    setCardboardView((CardboardView) view);

    // store the glSurfaceView in JmeAndroidSystem for future use
    JmeAndroidCardboardSystem.setView(view);
    if (view == null) {
        logger.log(Level.FINE, "view is null!");
    }
    if (splashPicID != 0) {
        FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
                LayoutParams.MATCH_PARENT,
                LayoutParams.MATCH_PARENT,
                Gravity.CENTER);

        frameLayout = new FrameLayout(this);
        splashImageView = new ImageView(this);

        Drawable drawable = this.getResources().getDrawable(splashPicID);
        if (drawable instanceof NinePatchDrawable) {
            splashImageView.setBackgroundDrawable(drawable);
        } else {
            splashImageView.setImageResource(splashPicID);
        }

        if (view.getParent() != null) {
            ((ViewGroup) view.getParent()).removeView(view);
        }
        frameLayout.addView(view);

        if (splashImageView.getParent() != null) {
            ((ViewGroup) splashImageView.getParent()).removeView(splashImageView);
        }
        frameLayout.addView(splashImageView, lp);

        setContentView(frameLayout);
        logger.log(Level.FINE, "Splash Screen Created");
    } else {
        logger.log(Level.FINE, "Splash Screen Skipped.");
        setContentView(view);
    }
}
 
开发者ID:neph1,项目名称:jme-cardboard,代码行数:44,代码来源:CardboardHarness.java



注:本文中的com.google.vrtoolkit.cardboard.CardboardView类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Offer类代码示例发布时间:2022-05-21
下一篇:
Java RSAPrivateCrtKeyParameters类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap