Documentation ¶
Overview ¶
Package webvr is for accessing virtual reality (VR) devices, including sensors and head-mounted displays on the Web.
NOTE: Development of the WebVR API has halted in favor of being replaced the WebXR Device API. Several browsers will continue to support this version of the API in the meantime.
Index ¶
- type Display
- func (_this *Display) CancelAnimationFrame(handle int)
- func (_this *Display) Capabilities() *DisplayCapabilities
- func (_this *Display) DepthFar() float64
- func (_this *Display) DepthNear() float64
- func (_this *Display) DisplayId() uint
- func (_this *Display) DisplayName() string
- func (_this *Display) ExitPresent() (_result *javascript.PromiseVoid)
- func (_this *Display) GetEyeParameters(whichEye Eye) (_result *EyeParameters)
- func (_this *Display) GetFrameData(frameData *FrameData) (_result bool)
- func (_this *Display) GetLayers() (_result []*LayerInit)
- func (_this *Display) GetPose() (_result *Pose)
- func (_this *Display) IsConnected() bool
- func (_this *Display) IsPresenting() bool
- func (_this *Display) RequestAnimationFrame(callback *htmlcommon.FrameRequestCallback) (_result int)
- func (_this *Display) RequestPresent(layers []*LayerInit) (_result *javascript.PromiseVoid)
- func (_this *Display) ResetPose()
- func (_this *Display) SetDepthFar(value float64)
- func (_this *Display) SetDepthNear(value float64)
- func (_this *Display) StageParameters() *StageParameters
- func (_this *Display) SubmitFrame()
- type DisplayCapabilities
- func (_this *DisplayCapabilities) CanPresent() bool
- func (_this *DisplayCapabilities) HasExternalDisplay() bool
- func (_this *DisplayCapabilities) HasOrientation() bool
- func (_this *DisplayCapabilities) HasPosition() bool
- func (_this *DisplayCapabilities) JSValue() js.Value
- func (_this *DisplayCapabilities) MaxLayers() uint
- type DisplayEvent
- type DisplayEventInit
- type DisplayEventReason
- type Eye
- type EyeParameters
- type FieldOfView
- type FrameData
- func (_this *FrameData) JSValue() js.Value
- func (_this *FrameData) LeftProjectionMatrix() *javascript.Float32Array
- func (_this *FrameData) LeftViewMatrix() *javascript.Float32Array
- func (_this *FrameData) Pose() *Pose
- func (_this *FrameData) RightProjectionMatrix() *javascript.Float32Array
- func (_this *FrameData) RightViewMatrix() *javascript.Float32Array
- func (_this *FrameData) Timestamp() float64
- type LayerInit
- type Pose
- func (_this *Pose) AngularAcceleration() *javascript.Float32Array
- func (_this *Pose) AngularVelocity() *javascript.Float32Array
- func (_this *Pose) JSValue() js.Value
- func (_this *Pose) LinearAcceleration() *javascript.Float32Array
- func (_this *Pose) LinearVelocity() *javascript.Float32Array
- func (_this *Pose) Orientation() *javascript.Float32Array
- func (_this *Pose) Position() *javascript.Float32Array
- type PromiseSequenceDisplay
- func (_this *PromiseSequenceDisplay) Catch(onRejected *PromiseSequenceDisplayOnRejected) (_result *PromiseSequenceDisplay)
- func (_this *PromiseSequenceDisplay) Finally(onFinally *javascript.PromiseFinally) (_result *PromiseSequenceDisplay)
- func (_this *PromiseSequenceDisplay) JSValue() js.Value
- func (_this *PromiseSequenceDisplay) Then(onFulfilled *PromiseSequenceDisplayOnFulfilled, ...) (_result *PromiseSequenceDisplay)
- type PromiseSequenceDisplayOnFulfilled
- type PromiseSequenceDisplayOnFulfilledFunc
- type PromiseSequenceDisplayOnRejected
- type PromiseSequenceDisplayOnRejectedFunc
- type StageParameters
- type Union
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Display ¶
type Display struct {
domcore.EventTarget
}
class: VRDisplay
func DisplayFromJS ¶
DisplayFromJS is casting a js.Wrapper into Display.
func (*Display) CancelAnimationFrame ¶
func (*Display) Capabilities ¶
func (_this *Display) Capabilities() *DisplayCapabilities
Capabilities returning attribute 'capabilities' with type DisplayCapabilities (idl: VRDisplayCapabilities).
func (*Display) DepthNear ¶
DepthNear returning attribute 'depthNear' with type float64 (idl: double).
func (*Display) DisplayId ¶
DisplayId returning attribute 'displayId' with type uint (idl: unsigned long).
func (*Display) DisplayName ¶
DisplayName returning attribute 'displayName' with type string (idl: DOMString).
func (*Display) ExitPresent ¶
func (_this *Display) ExitPresent() (_result *javascript.PromiseVoid)
func (*Display) GetEyeParameters ¶
func (_this *Display) GetEyeParameters(whichEye Eye) (_result *EyeParameters)
func (*Display) GetFrameData ¶
func (*Display) IsConnected ¶
IsConnected returning attribute 'isConnected' with type bool (idl: boolean).
func (*Display) IsPresenting ¶
IsPresenting returning attribute 'isPresenting' with type bool (idl: boolean).
func (*Display) RequestAnimationFrame ¶
func (_this *Display) RequestAnimationFrame(callback *htmlcommon.FrameRequestCallback) (_result int)
func (*Display) RequestPresent ¶
func (_this *Display) RequestPresent(layers []*LayerInit) (_result *javascript.PromiseVoid)
func (*Display) SetDepthFar ¶
SetDepthFar setting attribute 'depthFar' with type float64 (idl: double).
func (*Display) SetDepthNear ¶
SetDepthNear setting attribute 'depthNear' with type float64 (idl: double).
func (*Display) StageParameters ¶
func (_this *Display) StageParameters() *StageParameters
StageParameters returning attribute 'stageParameters' with type StageParameters (idl: VRStageParameters).
func (*Display) SubmitFrame ¶
func (_this *Display) SubmitFrame()
type DisplayCapabilities ¶
type DisplayCapabilities struct { // Value_JS holds a reference to a javascript value Value_JS js.Value }
class: VRDisplayCapabilities
func DisplayCapabilitiesFromJS ¶
func DisplayCapabilitiesFromJS(value js.Wrapper) *DisplayCapabilities
DisplayCapabilitiesFromJS is casting a js.Wrapper into DisplayCapabilities.
func (*DisplayCapabilities) CanPresent ¶
func (_this *DisplayCapabilities) CanPresent() bool
CanPresent returning attribute 'canPresent' with type bool (idl: boolean).
func (*DisplayCapabilities) HasExternalDisplay ¶
func (_this *DisplayCapabilities) HasExternalDisplay() bool
HasExternalDisplay returning attribute 'hasExternalDisplay' with type bool (idl: boolean).
func (*DisplayCapabilities) HasOrientation ¶
func (_this *DisplayCapabilities) HasOrientation() bool
HasOrientation returning attribute 'hasOrientation' with type bool (idl: boolean).
func (*DisplayCapabilities) HasPosition ¶
func (_this *DisplayCapabilities) HasPosition() bool
HasPosition returning attribute 'hasPosition' with type bool (idl: boolean).
func (*DisplayCapabilities) JSValue ¶
func (_this *DisplayCapabilities) JSValue() js.Value
func (*DisplayCapabilities) MaxLayers ¶
func (_this *DisplayCapabilities) MaxLayers() uint
MaxLayers returning attribute 'maxLayers' with type uint (idl: unsigned long).
type DisplayEvent ¶
class: VRDisplayEvent
func DisplayEventFromJS ¶
func DisplayEventFromJS(value js.Wrapper) *DisplayEvent
DisplayEventFromJS is casting a js.Wrapper into DisplayEvent.
func NewVRDisplayEvent ¶
func NewVRDisplayEvent(_type string, eventInitDict *DisplayEventInit) (_result *DisplayEvent)
func (*DisplayEvent) Display ¶
func (_this *DisplayEvent) Display() *Display
Display returning attribute 'display' with type Display (idl: VRDisplay).
func (*DisplayEvent) Reason ¶
func (_this *DisplayEvent) Reason() *DisplayEventReason
Reason returning attribute 'reason' with type DisplayEventReason (idl: VRDisplayEventReason).
type DisplayEventInit ¶
type DisplayEventInit struct { Bubbles bool Cancelable bool Composed bool Display *Display Reason DisplayEventReason }
dictionary: VRDisplayEventInit
func DisplayEventInitFromJS ¶
func DisplayEventInitFromJS(value js.Wrapper) *DisplayEventInit
DisplayEventInitFromJS is allocating a new DisplayEventInit object and copy all values from input javascript object
func (*DisplayEventInit) JSValue ¶
func (_this *DisplayEventInit) JSValue() js.Value
JSValue is allocating a new javasript object and copy all values
type DisplayEventReason ¶
type DisplayEventReason int
enum: VRDisplayEventReason
const ( Mounted DisplayEventReason = iota Requested Unmounted )
func DisplayEventReasonFromJS ¶
func DisplayEventReasonFromJS(value js.Value) DisplayEventReason
DisplayEventReasonFromJS is converting a javascript value into a DisplayEventReason enum value.
func (*DisplayEventReason) JSValue ¶
func (this *DisplayEventReason) JSValue() js.Value
JSValue is converting this enum into a javascript object
func (DisplayEventReason) Value ¶
func (this DisplayEventReason) Value() string
Value is converting this into javascript defined string value
type Eye ¶
type Eye int
enum: VREye
type EyeParameters ¶
class: VREyeParameters
func EyeParametersFromJS ¶
func EyeParametersFromJS(value js.Wrapper) *EyeParameters
EyeParametersFromJS is casting a js.Wrapper into EyeParameters.
func (*EyeParameters) FieldOfView ¶
func (_this *EyeParameters) FieldOfView() *FieldOfView
FieldOfView returning attribute 'fieldOfView' with type FieldOfView (idl: VRFieldOfView).
func (*EyeParameters) JSValue ¶
func (_this *EyeParameters) JSValue() js.Value
func (*EyeParameters) Offset ¶
func (_this *EyeParameters) Offset() *javascript.Float32Array
Offset returning attribute 'offset' with type javascript.Float32Array (idl: Float32Array).
func (*EyeParameters) RenderHeight ¶
func (_this *EyeParameters) RenderHeight() uint
RenderHeight returning attribute 'renderHeight' with type uint (idl: unsigned long).
func (*EyeParameters) RenderWidth ¶
func (_this *EyeParameters) RenderWidth() uint
RenderWidth returning attribute 'renderWidth' with type uint (idl: unsigned long).
type FieldOfView ¶
class: VRFieldOfView
func FieldOfViewFromJS ¶
func FieldOfViewFromJS(value js.Wrapper) *FieldOfView
FieldOfViewFromJS is casting a js.Wrapper into FieldOfView.
func (*FieldOfView) DownDegrees ¶
func (_this *FieldOfView) DownDegrees() float64
DownDegrees returning attribute 'downDegrees' with type float64 (idl: double).
func (*FieldOfView) JSValue ¶
func (_this *FieldOfView) JSValue() js.Value
func (*FieldOfView) LeftDegrees ¶
func (_this *FieldOfView) LeftDegrees() float64
LeftDegrees returning attribute 'leftDegrees' with type float64 (idl: double).
func (*FieldOfView) RightDegrees ¶
func (_this *FieldOfView) RightDegrees() float64
RightDegrees returning attribute 'rightDegrees' with type float64 (idl: double).
func (*FieldOfView) UpDegrees ¶
func (_this *FieldOfView) UpDegrees() float64
UpDegrees returning attribute 'upDegrees' with type float64 (idl: double).
type FrameData ¶
class: VRFrameData
func FrameDataFromJS ¶
FrameDataFromJS is casting a js.Wrapper into FrameData.
func NewVRFrameData ¶
func NewVRFrameData() (_result *FrameData)
func (*FrameData) LeftProjectionMatrix ¶
func (_this *FrameData) LeftProjectionMatrix() *javascript.Float32Array
LeftProjectionMatrix returning attribute 'leftProjectionMatrix' with type javascript.Float32Array (idl: Float32Array).
func (*FrameData) LeftViewMatrix ¶
func (_this *FrameData) LeftViewMatrix() *javascript.Float32Array
LeftViewMatrix returning attribute 'leftViewMatrix' with type javascript.Float32Array (idl: Float32Array).
func (*FrameData) RightProjectionMatrix ¶
func (_this *FrameData) RightProjectionMatrix() *javascript.Float32Array
RightProjectionMatrix returning attribute 'rightProjectionMatrix' with type javascript.Float32Array (idl: Float32Array).
func (*FrameData) RightViewMatrix ¶
func (_this *FrameData) RightViewMatrix() *javascript.Float32Array
RightViewMatrix returning attribute 'rightViewMatrix' with type javascript.Float32Array (idl: Float32Array).
type LayerInit ¶
dictionary: VRLayerInit
func LayerInitFromJS ¶
LayerInitFromJS is allocating a new LayerInit object and copy all values from input javascript object
type Pose ¶
class: VRPose
func PoseFromJS ¶
PoseFromJS is casting a js.Wrapper into Pose.
func (*Pose) AngularAcceleration ¶
func (_this *Pose) AngularAcceleration() *javascript.Float32Array
AngularAcceleration returning attribute 'angularAcceleration' with type javascript.Float32Array (idl: Float32Array).
func (*Pose) AngularVelocity ¶
func (_this *Pose) AngularVelocity() *javascript.Float32Array
AngularVelocity returning attribute 'angularVelocity' with type javascript.Float32Array (idl: Float32Array).
func (*Pose) LinearAcceleration ¶
func (_this *Pose) LinearAcceleration() *javascript.Float32Array
LinearAcceleration returning attribute 'linearAcceleration' with type javascript.Float32Array (idl: Float32Array).
func (*Pose) LinearVelocity ¶
func (_this *Pose) LinearVelocity() *javascript.Float32Array
LinearVelocity returning attribute 'linearVelocity' with type javascript.Float32Array (idl: Float32Array).
func (*Pose) Orientation ¶
func (_this *Pose) Orientation() *javascript.Float32Array
Orientation returning attribute 'orientation' with type javascript.Float32Array (idl: Float32Array).
func (*Pose) Position ¶
func (_this *Pose) Position() *javascript.Float32Array
Position returning attribute 'position' with type javascript.Float32Array (idl: Float32Array).
type PromiseSequenceDisplay ¶
type PromiseSequenceDisplay struct { // Value_JS holds a reference to a javascript value Value_JS js.Value }
class: Promise
func PromiseSequenceDisplayFromJS ¶
func PromiseSequenceDisplayFromJS(value js.Wrapper) *PromiseSequenceDisplay
PromiseSequenceDisplayFromJS is casting a js.Wrapper into PromiseSequenceDisplay.
func (*PromiseSequenceDisplay) Catch ¶
func (_this *PromiseSequenceDisplay) Catch(onRejected *PromiseSequenceDisplayOnRejected) (_result *PromiseSequenceDisplay)
func (*PromiseSequenceDisplay) Finally ¶
func (_this *PromiseSequenceDisplay) Finally(onFinally *javascript.PromiseFinally) (_result *PromiseSequenceDisplay)
func (*PromiseSequenceDisplay) JSValue ¶
func (_this *PromiseSequenceDisplay) JSValue() js.Value
func (*PromiseSequenceDisplay) Then ¶
func (_this *PromiseSequenceDisplay) Then(onFulfilled *PromiseSequenceDisplayOnFulfilled, onRejected *PromiseSequenceDisplayOnRejected) (_result *PromiseSequenceDisplay)
type PromiseSequenceDisplayOnFulfilled ¶
PromiseSequenceDisplayOnFulfilled is a javascript function type.
Call Release() when done to release resouces allocated to this type.
func PromiseSequenceDisplayOnFulfilledToJS ¶
func PromiseSequenceDisplayOnFulfilledToJS(callback PromiseSequenceDisplayOnFulfilledFunc) *PromiseSequenceDisplayOnFulfilled
type PromiseSequenceDisplayOnFulfilledFunc ¶
type PromiseSequenceDisplayOnFulfilledFunc func(value []*Display)
callback: PromiseTemplateOnFulfilled
func PromiseSequenceDisplayOnFulfilledFromJS ¶
func PromiseSequenceDisplayOnFulfilledFromJS(_value js.Value) PromiseSequenceDisplayOnFulfilledFunc
type PromiseSequenceDisplayOnRejected ¶
PromiseSequenceDisplayOnRejected is a javascript function type.
Call Release() when done to release resouces allocated to this type.
func PromiseSequenceDisplayOnRejectedToJS ¶
func PromiseSequenceDisplayOnRejectedToJS(callback PromiseSequenceDisplayOnRejectedFunc) *PromiseSequenceDisplayOnRejected
type PromiseSequenceDisplayOnRejectedFunc ¶
callback: PromiseTemplateOnRejected
func PromiseSequenceDisplayOnRejectedFromJS ¶
func PromiseSequenceDisplayOnRejectedFromJS(_value js.Value) PromiseSequenceDisplayOnRejectedFunc
type StageParameters ¶
type StageParameters struct { // Value_JS holds a reference to a javascript value Value_JS js.Value }
class: VRStageParameters
func StageParametersFromJS ¶
func StageParametersFromJS(value js.Wrapper) *StageParameters
StageParametersFromJS is casting a js.Wrapper into StageParameters.
func (*StageParameters) JSValue ¶
func (_this *StageParameters) JSValue() js.Value
func (*StageParameters) SittingToStandingTransform ¶
func (_this *StageParameters) SittingToStandingTransform() *javascript.Float32Array
SittingToStandingTransform returning attribute 'sittingToStandingTransform' with type javascript.Float32Array (idl: Float32Array).
func (*StageParameters) SizeX ¶
func (_this *StageParameters) SizeX() float32
SizeX returning attribute 'sizeX' with type float32 (idl: float).
func (*StageParameters) SizeZ ¶
func (_this *StageParameters) SizeZ() float32
SizeZ returning attribute 'sizeZ' with type float32 (idl: float).