Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG, v0.6.2] Camera positioned on an animated Node doesn't move. #415

Open
trusktr opened this issue Jul 11, 2015 · 4 comments
Open

[BUG, v0.6.2] Camera positioned on an animated Node doesn't move. #415

trusktr opened this issue Jul 11, 2015 · 4 comments

Comments

@trusktr
Copy link
Contributor

trusktr commented Jul 11, 2015

In 0.5.2, I was able to put a Camera on a Node, then move the Node around to change the view. In 0.6.2, this broke, and although the Node moves, the view doesn't change. I haven't tested in 0.7 yet. I'll be back to post a test case...

@michaelobriena
Copy link
Member

@trusktr do you have an example of this?

@steveblue
Copy link

Every time I try to attach a camera to a Node and then setPosition onUpdate of a component on the same Node, the camera doesn't move in 0.7.0.

@trusktr
Copy link
Contributor Author

trusktr commented Aug 11, 2015

@michaelobriena It should be reproducible by doing something like this:

let cameraNode = someNode.addChild()
let camera = new Camera(cameraNode)
camera.setDepth(1000)

// animate the camera.
let camPositionZ = new Transitionable(0)
~function loop() {
    camPositionZ.to(6000, 'easeInOut', 6000).to(0, 'easeInOut', 6000, loop)
}()

let cameraAnimation = cameraNode.addComponent({
    onUpdate: function() {
        cameraNode.setPosition(camPositionZ.get()/3, 0,camPositionZ.get())
        cameraNode.requestUpdateOnNextTick(cameraAnimation)
    }
})
cameraNode.requestUpdateOnNextTick(cameraAnimation)

The camera should move back and forth, but you'll notice it won't.

@trusktr
Copy link
Contributor Author

trusktr commented Sep 2, 2015

PR #488

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants