提交 28dce001 编写于 作者: D Diego Marcos

Adds scale factor to the HMD absolute positioning

上级 0b05efd5
......@@ -5,6 +5,8 @@
THREE.VRControls = function ( object, callback ) {
var scope = this;
var vrInput;
var onVRDevices = function ( devices ) {
......@@ -40,6 +42,11 @@ THREE.VRControls = function ( object, callback ) {
}
// the Rift SDK returns the position in meters
// this scale factor allows the user to define how meters
// are converted to scene units.
this.scale = 1;
this.update = function () {
if ( vrInput === undefined ) return;
......@@ -54,7 +61,7 @@ THREE.VRControls = function ( object, callback ) {
if ( state.position !== null ) {
object.position.copy( state.position );
object.position.copy( state.position ).multiplyScalar( scope.scale );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册