Google cardBoard Android API (一):CardboardActivity

20 篇文章 0 订阅
18 篇文章 0 订阅

public class CardboardActivity

Base activity that provides easy integration with Cardboard devices.

Exposes events to interact with Cardboards and handles many of the details commonly required when creating an Activity for VR rendering.

Public Constructors

Public Methods

CardboardView
synchronized boolean
void
void
setCardboardView( CardboardView cardboardView)
synchronized void
setConvertTapIntoTrigger(boolean enabled)

Protected Methods

Inherited Methods

Public Constructors

public CardboardActivity ()

Public Methods

public CardboardView getCardboardView ()

Returns the Cardboard view associated with this activity.

Returns
  • The CardboardView object associated with this activity. Can be null.
public synchronized boolean getConvertTapIntoTrigger ()

Returns whether single screen taps are converted to Cardboard trigger events.

Returns
  • whether single screen taps are converted to Cardboard trigger events.
public void onCardboardTrigger ()

Override to detect when the Cardboard trigger was pulled and released.

Provides click-like events when the device is inside a Cardboard.

public void setCardboardView (CardboardView cardboardView)

Associates a Cardboard view with this activity.

This method does not set or change the content view, but associates the activity with aCardboardView and ensures it receives any required activity lifecycle notifications.

This is automatically done if setContentView is used to directly set a CardboardViewobject. Should be called if the CardboardView is set in any other way (e.g. from a layout resource).

Parameters
cardboardView The Cardboard view to associate with. Can be null.
public synchronized void setConvertTapIntoTrigger (boolean enabled)

Sets whether single screen taps should be converted to Cardboard trigger events.

If this is true, a single tap on the phone screen will result in a call toonCardboardTrigger. This is enabled by default.

Parameters
enabled whether screen taps should be converted to Cardboard trigger events.

Protected Methods

protected void updateCardboardDeviceParams (CardboardDeviceParams newParams)

Requests an update of the parameters for the current Cardboard device.

Compares against existing configuration and updates if the new parameters differ.

This method requires a CardboardView to be already set. See setCardboardView.

Parameters
newParams New Cardboard device params to set.
  
  
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值