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

Author Topic: Return camera offset?  (Read 5307 times)

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Return camera offset?
« on: November 14, 2014, 11:44:24 am »

Hello, is there a command that will return the current angle offset between the 3rd person camera and my model's orientation? i.e, if I'm looking directly at my model's right side I'd like to get the values 90, 0 , 0.
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Return camera offset?
« Reply #1 on: November 14, 2014, 12:04:31 pm »

No direct command, but it can be computed from camera direction and model base vectors. Doable from the console ... what do you need it for?
Logged

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: Return camera offset?
« Reply #2 on: November 14, 2014, 12:09:49 pm »

I was going to use it as a placeholder input for mouse cursor control (steering & turrets) so I'd need it to work within a vehicle's JS file.

While I've got you here is there a way to chain console commands together? Atm I have to enter each one individually and the standard ';' delimiter doesn't work.
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Return camera offset?
« Reply #3 on: November 15, 2014, 06:56:09 am »

I shall add the semicolon support, but in the meantime, there's a variable $con that represents the console interface itself, and it's got an exec method, so you can invoke console commands like
    $con.exec("..."); $con.exec("...");

Vehicle script currently doesn't have means to get the camera direction directly, it's doable only through the world interface (get_camera_dir).
Logged

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: Return camera offset?
« Reply #4 on: November 20, 2014, 05:08:55 pm »

I shall add the semicolon support, but in the meantime, there's a variable $con that represents the console interface itself, and it's got an exec method, so you can invoke console commands like
    $con.exec("..."); $con.exec("...");


.bind w world works with con.exec but I get "unexpected identifier" when I try to spawn something with "w.create_instance..." with it.
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Return camera offset?
« Reply #5 on: November 21, 2014, 01:18:27 am »

Please give me the whole line to check what's wrong.
Logged

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: Return camera offset?
« Reply #6 on: November 21, 2014, 05:41:38 am »

 $con.exec(".bind w world"); $con.exec("w.create_instance("Caldari/cca2/Wyvern", {x:6000000, y:6000000, z:0}, {x:0.4744431216, y:0.467604041, z: -0.528941154, w:0.5}, true)");
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6721
  • No sense of urgency.
    • outerra.com
Re: Return camera offset?
« Reply #7 on: November 21, 2014, 07:05:46 am »

You have nested quotes there, change the inner ones to apostrophes:

$con.exec(".bind w world"); $con.exec("w.create_instance('Caldari/cca2/Wyvern', {x:6000000, y:6000000, z:0}, {x:0.4744431216, y:0.467604041, z: -0.528941154, w:0.5}, true)");
Logged

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: Return camera offset?
« Reply #8 on: November 21, 2014, 09:00:28 am »

Thanks.
Logged