Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Outerra Tech Demo download. Help with graphics driver issues

Pages: [1] 2

Author Topic: speed vectors?  (Read 7651 times)

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
speed vectors?
« on: June 29, 2014, 08:21:16 am »

Is it possible to get the Vehicle's speed method to return individual xyz vectors instead of overall velocity?
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: speed vectors?
« Reply #1 on: June 29, 2014, 09:36:41 am »

We'll expose a velocity method that returns both the linear and angular vector speeds.
Logged

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: speed vectors?
« Reply #2 on: June 29, 2014, 10:09:25 am »

Thanks. Is there a timeline on that?
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: speed vectors?
« Reply #3 on: June 29, 2014, 10:12:00 am »

It will get into the next update which could be out soon, just some issues at exit need to be addressed.
Logged

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: speed vectors?
« Reply #4 on: June 29, 2014, 04:41:56 pm »

  • script: velocity method for getting speed vectors in vehicle physics
great! what's the syntax on that?

and videomaker.exe gives some errors on quitting although I'm not using it.
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: speed vectors?
« Reply #5 on: June 29, 2014, 05:11:57 pm »

I've added it to the wiki. Returns an object with linear and angular member variables in world space.
Logged

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: speed vectors?
« Reply #6 on: June 29, 2014, 06:08:44 pm »

I've added it to the wiki. Returns an object with linear and angular member variables in world space.

Could you give me an example line? I tried this (and variations)

this.velocity('angular').y

for pitch velocity but got nowhere.
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: speed vectors?
« Reply #7 on: June 29, 2014, 06:22:31 pm »

Try
var v=this.velocity();
v.angular.x ...
Logged

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: speed vectors?
« Reply #8 on: June 29, 2014, 07:09:51 pm »

I think the vectors might be relative to the world instead of the model. Asking it not to go over "50 velocity" limits its speed to numbers that don't match any units and change depending on the heading. Also if you turn the vehicle 180 degrees it does not change the velocity function's outputs.

edit: yeah, seems 250ish heading positive x, 160ish positive y.
« Last Edit: June 29, 2014, 07:29:04 pm by zzz »
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: speed vectors?
« Reply #9 on: June 30, 2014, 03:06:16 am »

Yes, they are in world space. Can be converted to model space via the quaternion, but there's no easily usable math lib in JS for it, so it will be probably better to provide transformation functions.
Logged

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: speed vectors?
« Reply #10 on: June 30, 2014, 04:37:20 pm »

so it will be probably better to provide transformation functions.

So the function won't get much use until those are created? I read up on quaternions and the maths is... dense.
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: speed vectors?
« Reply #11 on: July 01, 2014, 05:06:29 am »

Depends on how you mean to use it. You may want to implement a stabilizer that controls the vehicle in tangential plane, and for that you'll need world space vectors.

I have added a bool flag to instruct the method that you want model space vectors.
Logged

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: speed vectors?
« Reply #12 on: July 02, 2014, 04:38:38 am »

Thanks. The linear speeds work perfectly, but with angular is the conversion correct? After some bugs I logged the changing angular.z speed and it cycled between -8 to 8 as I was in an increasingly fast 360 degree spin along that axis.
Logged

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: speed vectors?
« Reply #13 on: July 03, 2014, 11:57:52 am »

Thanks. The linear speeds work perfectly, but with angular is the conversion correct? After some bugs I logged the changing angular.z speed and it cycled between -8 to 8 as I was in an increasingly fast 360 degree spin along that axis.

Was my interpretation of this correct?
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: speed vectors?
« Reply #14 on: July 03, 2014, 02:54:26 pm »

Hm I didn't notice any issues with the angular speed in local frame; it's used, for example, on boats for stabilization.
Logged
Pages: [1] 2