I have an ICameraSceneNode which I've parented to another ISceneNode. In the event receiver when the mouse is moved I take the move delta and apply that to the camera's X and Y rotation accordingly. Unfortunately since I've parented the camera using setRotation() has no effect until you call bindTargetAndRotation(true) however once you've called this function setRotation not only set's the rotation of the camera but also set's the target of the camera thus moving the camera effects the rotation due to it trying to constantly point at a specific target location.
Why can you not call setRotation on a camera which has been parented? Shouldn't calling setRotation set the camera's rotation regardless?
Thank you for your time.
SetRotation On A Parented Camera
SetRotation On A Parented Camera
Dream Big Or Go Home.
Help Me Help You.
Help Me Help You.
Re: SetRotation On A Parented Camera
Perhaps the call you're looking for is updateAbsolutePosition?
Re: SetRotation On A Parented Camera
Possibly, my only hitch here is that I've parented the camera to the node so there is no need to call any functions on the camera each frame as it's buried quite deep in a class hierarchy. I assumed setRotation would do as the name implies and set the rotation of the camera and hold that rotation until I set it again.
Dream Big Or Go Home.
Help Me Help You.
Help Me Help You.
Re: SetRotation On A Parented Camera
edit: It's a bit unclear what you're trying to do.
Do you want to point the camera to a constant direction? You must then set the target every time the camera moves. The target is constant, no matter whether set through setTarget or bound rotation + setRotation.
Do you want to point the camera to a constant direction? You must then set the target every time the camera moves. The target is constant, no matter whether set through setTarget or bound rotation + setRotation.
Re: SetRotation On A Parented Camera
I just assumed calling setRotation on the camera node would set the angle of the camera and that angle would stay constant regardless of if the camera's position changed however this is not the case. I'll rework the code to call setRotation each frame to try and keep the camera at a constant angle.
It would be nice if when bindTargetAndRotation(false) you were able to use setRotation and the camera's angle would stay until calling setRotation again even when the camera has been parented to another object.
It would be nice if when bindTargetAndRotation(false) you were able to use setRotation and the camera's angle would stay until calling setRotation again even when the camera has been parented to another object.
Dream Big Or Go Home.
Help Me Help You.
Help Me Help You.
Re: SetRotation On A Parented Camera
I think the point is that, you are setting the relative rotation of the camers, as it has been parented. updateAbsolutePosition has to be called to *calculate* the actual transformation, since you didn't do that yourself. Maybe you forgot that setRotation only sets the local (relative) rotation?