playMaker

Author Topic: mouseLook2_Reset  (Read 3981 times)

10Polarbears

  • Playmaker Newbie
  • *
  • Posts: 21
mouseLook2_Reset
« on: January 16, 2013, 04:48:17 AM »

I have mouseLook2 working to rotate a model. It works fine.

I also have a GUI slider that actives/deactivates further models.
When these new models are activated I have the camera animating back to its default position.
This also works fine.

However the problem I am having is that once the slider has done its job and the user wants to use mouseLook2 to rotate the model again. The rotation jumps back to where the mouseLook was last positioned.

Is there some way to reset the mouseLook back to zero?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: mouseLook2_Reset
« Reply #1 on: January 17, 2013, 01:47:17 AM »
Hi,

 do you have a package to share? cause it could have many many different ways to get solved. As is, I am not sure what I would suggest.

bye,

 Jean

10Polarbears

  • Playmaker Newbie
  • *
  • Posts: 21
Re: mouseLook2_Reset
« Reply #2 on: January 17, 2013, 06:38:22 PM »

Yes, I can see why that might be. ;D
I have uploaded a package with the following link.

[LINK REMOVED] don't include the playmaker folder when creating package, thanks :)

Once it is running in the editor:
- the slider at the bottom reveals the objects and the camera will animate to them in order
- when you have a few visible, left mouse down to rotate the scene
- then go back to the slider and add or remove objects – this will animate the camera
        to what will be a default position for that object
- here is where the issue is – when you next go to rotate the scene
        on the initial mouse down the scene will jump back to the last manual rotation

Every which way I call Reset Axis all it seems to do is force the user to left mouse down again to drop the rotate.

I have exposed rotationX and rotationY in the MouseLook2 action.
If when playing I go through the above steps but reset manually rotXY in the action editor the axis resets nicely and I get the behaviour I am after.

Apologies for the roughness of the set up I am just starting to get a grip on the proposed functionality with a ways to go yet.

Thank you Jean for any and all assistance.
10PB
« Last Edit: January 21, 2013, 12:55:48 AM by jeanfabre »

10Polarbears

  • Playmaker Newbie
  • *
  • Posts: 21
Re: mouseLook2_Reset
« Reply #3 on: January 20, 2013, 08:41:06 PM »

Jean.
Is there any likelihood of some suggestions?
Or am I stuck?

Thank you.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: mouseLook2_Reset
« Reply #4 on: January 21, 2013, 01:13:38 AM »
Hi,

note: don't include playmaker folder, especially the playmaker dll file, this is not allowed.

 I see the problem. MouseLook is something that I never use actually. I always roll my own camera viewer.

 So in your case. I would do so too to get exactly what you need.

-- the key is to rotate the camera using increments. so record the mouseposition and substract it with the previous mouse position ( that you save in a variable of course).

 use this "delta" value as the source to rotate your camera using the action "rotate"

Does that make sense?

Also, I think that a lot of unwanted behavior is happening. if mouselook is disable, the camera still behaves under mouse control ( in an odd way as well), is that by design or some left overs trials?

Bye,

 Jean

10Polarbears

  • Playmaker Newbie
  • *
  • Posts: 21
Re: mouseLook2_Reset
« Reply #5 on: January 21, 2013, 10:11:39 PM »

Thank you Jean.

note: don't include playmaker folder, especially the playmaker dll file, this is not allowed.
Ah ok.

Also, I think that a lot of unwanted behavior is happening. if mouselook is disable, the camera still behaves under mouse control ( in an odd way as well), is that by design or some left overs trials?
That would be left over trials.

-- the key is to rotate the camera using increments.

Not quite. I get the basics of what you are saying.
I imagine you mean for me to throw away the MouseLookAt.

Then drive rotation directly from mouseX. Then subtracting the result when returning to the slider's default position.

10Polarbears

  • Playmaker Newbie
  • *
  • Posts: 21
Re: mouseLook2_Reset_Solved
« Reply #6 on: January 21, 2013, 11:14:41 PM »


Hi Jean,

I have modified the mouseLookAt2 script further.
It took me a little while to understand what was staring me right in the face.

It is true that I could only expose to the Action the of two variables "rotationX" and "rotationY".
Allowing me see what numbers where being produced at runtime there was no way to extract them directly.

I just needed to create two FsmFloats within MouseLook2 "currentXRotation" and "currentYRotation"which gave me the ability to update "rotationX" and "rotationY" from another state. With the actual update occurring OnEnter before the "DoMouseLook ()" within MouseLook2.

It was right there all along.

Thank you yet again for your help Jean.
If only I could see with my eyes open.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: mouseLook2_Reset
« Reply #7 on: January 24, 2013, 09:13:43 AM »
Hi,

 Very good!

bye,

Jean