本文整理汇总了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);
}
示例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包/类
@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));
}
}
});
}
});
}
示例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;
}
示例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;
}