bugfix: move camera only in world coordinates
This commit is contained in:
parent
186f2af440
commit
9fc7d3c6f6
|
@ -6,10 +6,10 @@ xrf.frag.pos = function(v, opts){
|
||||||
if( pos.x == undefined ){
|
if( pos.x == undefined ){
|
||||||
let obj = scene.getObjectByName(v.string)
|
let obj = scene.getObjectByName(v.string)
|
||||||
if( !obj ) return console.warn("#pos="+v.string+" not found")
|
if( !obj ) return console.warn("#pos="+v.string+" not found")
|
||||||
obj.add(camera)
|
let worldPos = obj.getWorldPosition( obj.position )
|
||||||
camera.position.set(0,0,0)
|
camera.position.copy( worldPos )
|
||||||
let c = camera.rotation
|
//let c = camera.rotation
|
||||||
c.set( c.x, obj.rotation.y, c.z )
|
//c.set( c.x, obj.rotation.y, c.z )
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
// spec: direct coordinate: https://xrfragment.org/#navigating%203D
|
// spec: direct coordinate: https://xrfragment.org/#navigating%203D
|
||||||
|
|
Loading…
Reference in New Issue