当前位置: 首页>>代码示例>>Java>>正文


Java CardboardView类代码示例

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


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


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