playMaker

Author Topic: Get GameObject Rotation Speed and Rotation Vector (no physics)[SOLVED]  (Read 2924 times)

Kubold

  • Full Member
  • ***
  • Posts: 100
    • View Profile
Hey!

Is it possible to do a Get Rotation Speed and Rotation Vector Action for non-rigid bodies, similar to GetGameObjectSpeed.cs:

http://hutonggames.com/playmakerforum/index.php?topic=1182.msg4961#msg4961

I need it to transfer the motion from non-rigid body to rigid body. In plain words, I want to be able to throw a rigid-body. The above action works great for adding Force, but I wan't to get the angular speed and vector to also add Torque.

And if there is some another way of doing that please let me know :)

Kuba
« Last Edit: November 21, 2017, 11:24:00 PM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13137
  • Official Playmaker Support
    • View Profile
Re: Get GameObject Rotation Speed and Rotation Vector (no physics)
« Reply #1 on: December 11, 2013, 12:58:01 PM »
Hi,

 You would get the delta quaternion between each frame. So each frame, you record the current rotation, and substract from the previous ( and straight after that, you set the previous rotation to the current one). Then you have your rotationnal speed.

I have a package to work with quaternions:
https://hutonggames.fogbugz.com/default.asp?W967

Bye,

 Jean

Kubold

  • Full Member
  • ***
  • Posts: 100
    • View Profile
Re: Get GameObject Rotation Speed and Rotation Vector (no physics)
« Reply #2 on: December 11, 2013, 03:10:38 PM »
I'll try that, thanks!

gregacuna

  • Junior Playmaker
  • **
  • Posts: 83
    • View Profile
Re: Get GameObject Rotation Speed and Rotation Vector (no physics)
« Reply #3 on: November 22, 2016, 08:34:06 PM »
Jean...can you tell me which of the Quaternion options in your package would allow me to calculate the Delta and then the speed of rotation?

gregacuna

  • Junior Playmaker
  • **
  • Posts: 83
    • View Profile
Re: Get GameObject Rotation Speed and Rotation Vector (no physics)
« Reply #4 on: November 23, 2016, 01:53:35 AM »
I think I figured it out just using the Get Rotation and then comparing to calculate speed. It was my first big FSM, but seems to be working fine.

Still curious to know whether there is something in that Quaternion package which would make it easier.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13137
  • Official Playmaker Support
    • View Profile
Re: Get GameObject Rotation Speed and Rotation Vector (no physics)
« Reply #5 on: November 23, 2016, 11:38:51 PM »
Hi,

 yes, you only need to compare two rotations against time to know the speed.

 Bye,

 Jean

utopien

  • Playmaker Newbie
  • *
  • Posts: 37
    • View Profile
Re: Get GameObject Rotation Speed and Rotation Vector (no physics)
« Reply #6 on: November 18, 2017, 06:17:36 AM »
hello plz with What do you compare the rotation  with the get rotation Node ? do know a step by step tutorial ? thanks for any help i am designer not a programmer ^     
« Last Edit: November 18, 2017, 06:19:10 AM by utopien »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 3250
    • View Profile
    • jinxtergames
Re: Get GameObject Rotation Speed and Rotation Vector (no physics)
« Reply #7 on: November 18, 2017, 08:20:39 AM »
Hi,
@utopien you can better post a new question as it differs from this topic.
Can you give some more information of what you are trying to do.
I did a quick search on get rotation node but i did not find much.

utopien

  • Playmaker Newbie
  • *
  • Posts: 37
    • View Profile
Re: Get GameObject Rotation Speed and Rotation Vector (no physics)
« Reply #8 on: November 18, 2017, 09:47:02 AM »
@djaydino hello and thanks i am trying to get my character controller speed rotation as a float   so i can use it the animator by set animator float

and sorry but i thougnt that was topic i will repost if nessesary sorry for my english i am french

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 3250
    • View Profile
    • jinxtergames
Re: Get GameObject Rotation Speed and Rotation Vector (no physics)
« Reply #9 on: November 18, 2017, 10:23:35 AM »
Hi,
There is an action on the Ecosystem called "Angular Velocity" maybe that one can help.