Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VRPose_h | 5 #ifndef VRPose_h |
| 6 #define VRPose_h | 6 #define VRPose_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
| 9 #include "core/dom/DOMTypedArray.h" | 9 #include "core/dom/DOMTypedArray.h" |
| 10 #include "device/vr/vr_service.mojom-blink.h" | 10 #include "device/vr/vr_service.mojom-blink.h" |
| 11 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
| 12 #include "wtf/Forward.h" | 12 #include "wtf/Forward.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 class VRPose final : public GarbageCollected<VRPose>, public ScriptWrappable { | 16 class VRPose final : public GarbageCollected<VRPose>, public ScriptWrappable { |
| 17 DEFINE_WRAPPERTYPEINFO(); | 17 DEFINE_WRAPPERTYPEINFO(); |
| 18 | 18 |
| 19 public: | 19 public: |
| 20 static VRPose* create() { return new VRPose(); } | 20 static VRPose* create() { return new VRPose(); } |
| 21 | 21 |
| 22 DOMFloat32Array* orientation() const { return m_orientation; } | 22 DOMFloat32Array* orientation() const { return m_orientation; } |
| 23 DOMFloat32Array* position() const { return m_position; } | 23 DOMFloat32Array* position() const { return m_position; } |
| 24 DOMFloat32Array* angularVelocity() const { return m_angularVelocity; } | 24 DOMFloat32Array* angularVelocity() const { return m_angularVelocity; } |
| 25 DOMFloat32Array* linearVelocity() const { return m_linearVelocity; } | 25 DOMFloat32Array* linearVelocity() const { return m_linearVelocity; } |
| 26 DOMFloat32Array* angularAcceleration() const { return m_angularAcceleration; } | 26 DOMFloat32Array* angularAcceleration() const { return m_angularAcceleration; } |
| 27 DOMFloat32Array* linearAcceleration() const { return m_linearAcceleration; } | 27 DOMFloat32Array* linearAcceleration() const { return m_linearAcceleration; } |
| 28 | 28 |
| 29 // TODO(klausw): expose timestamp and poseNum to JS? We have those in the | |
|
bajones
2016/10/04 06:33:57
timestamp is exposed in the VRFrameData object. I
klausw
2016/10/04 06:47:04
OK, I'll remove the comment. When you mentioned Oc
klausw
2016/10/04 17:52:47
Removed the comment.
| |
| 30 // underlying VRPosePtr, and they could be useful to scripts. If yes, | |
| 31 // they would need to be added to VRPose in the WebVR spec. | |
| 32 | |
| 29 void setPose(const device::blink::VRPosePtr&); | 33 void setPose(const device::blink::VRPosePtr&); |
| 30 | 34 |
| 31 DECLARE_VIRTUAL_TRACE(); | 35 DECLARE_VIRTUAL_TRACE(); |
| 32 | 36 |
| 33 private: | 37 private: |
| 34 VRPose(); | 38 VRPose(); |
| 35 | 39 |
| 36 Member<DOMFloat32Array> m_orientation; | 40 Member<DOMFloat32Array> m_orientation; |
| 37 Member<DOMFloat32Array> m_position; | 41 Member<DOMFloat32Array> m_position; |
| 38 Member<DOMFloat32Array> m_angularVelocity; | 42 Member<DOMFloat32Array> m_angularVelocity; |
| 39 Member<DOMFloat32Array> m_linearVelocity; | 43 Member<DOMFloat32Array> m_linearVelocity; |
| 40 Member<DOMFloat32Array> m_angularAcceleration; | 44 Member<DOMFloat32Array> m_angularAcceleration; |
| 41 Member<DOMFloat32Array> m_linearAcceleration; | 45 Member<DOMFloat32Array> m_linearAcceleration; |
| 42 }; | 46 }; |
| 43 | 47 |
| 44 } // namespace blink | 48 } // namespace blink |
| 45 | 49 |
| 46 #endif // VRPose_h | 50 #endif // VRPose_h |
| OLD | NEW |