本文整理汇总了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);
}
示例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.");
}
示例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.");
}
示例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.");
}
示例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.");
}
示例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.");
}
示例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();
}
示例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);
}
示例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();
}
}
示例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.");
}
示例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);
}
示例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();
}
示例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 ) );
}
示例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));
}
}
});
}
});
}
示例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();
}
}