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


Java CardboardView.setRenderer方法代码示例

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


在下文中一共展示了CardboardView.setRenderer方法的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包/类
@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

示例14: 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

示例15: createView

import com.google.vrtoolkit.cardboard.CardboardView; //导入方法依赖的package包/类
@Override
    public GLSurfaceView createView(Context context) {
        // NOTE: We assume all ICS devices have OpenGL ES 2.0.
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
            // below 4.0, check OpenGL ES 2.0 support.
            ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
            ConfigurationInfo info = am.getDeviceConfigurationInfo();
            if (info.reqGlEsVersion < 0x20000) {
                throw new UnsupportedOperationException("OpenGL ES 2.0 is not supported on this device");
            }
        } else if (Build.VERSION.SDK_INT < 9){
            throw new UnsupportedOperationException("jME3 requires Android 2.3 or later");
        }
//        if(mParams == null){
//            mParams = new CardboardDeviceParams();
//            mParams.setInterLensDistance(0.45f);
//            mParams.setScreenToLensDistance(0.045f);
//        }
//        
//        mHMDManager = new HeadMountedDisplayManager(context);
//        mHMDManager.getHeadMountedDisplay().setCardboardDeviceParams(mParams);
        // Start to set up the view
        mView = new CardboardView(context);
        if (androidInput == null) {
            if (Build.VERSION.SDK_INT >= 14) {
                androidInput = new AndroidInputHandler14();
            } else if (Build.VERSION.SDK_INT >= 9){
                androidInput = new AndroidInputHandler();
            }
        }
        androidInput.setView(mView);
        androidInput.loadSettings(settings);

	mView.setFocusable(true);

//        int curAlphaBits = settings.getAlphaBits();
//        logger.log(Level.FINE, "curAlphaBits: {0}", curAlphaBits);
//        if (curAlphaBits >= 8) {
//            logger.log(Level.FINE, "Pixel Format: TRANSLUCENT");
//            mView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
//            mView.setZOrderOnTop(true);
//        } else if (curAlphaBits >= 1) {
//            logger.log(Level.FINE, "Pixel Format: TRANSPARENT");
//            mView.getHolder().setFormat(PixelFormat.TRANSPARENT);
//        } else {
//            logger.log(Level.FINE, "Pixel Format: OPAQUE");
//            mView.getHolder().setFormat(PixelFormat.OPAQUE);
//        }

        AndroidConfigChooser configChooser = new AndroidConfigChooser(settings);
        mView.setEGLConfigChooser(configChooser);
        mView.setRenderer((Renderer)this);
        
        if (Build.VERSION.SDK_INT >= 11) {
            mView.setPreserveEGLContextOnPause(true);
        }
        logger.log(Level.INFO, "Cardboard view created ");
        return mView;
    }
 
开发者ID:neph1,项目名称:jme-cardboard,代码行数:60,代码来源:CardboardContext.java


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