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 [3]

Author Topic: List of all the debug/monitoring tools  (Read 18586 times)

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6618
  • Pegs is clever, but tae hain’t a touch sentimental
    • outerra.com
Re: List of all the debug/monitoring tools
« Reply #30 on: September 09, 2014, 02:08:07 pm »

When I try spawning a second mig, it crashes, even with new variables for world and create_instance. Also is there a way to make it spawn an object as a static model instead of a vehicle?
Must be a bug in last build, because it works normally here.
Static object - just give it the object path. The last argument is permanent - true if the object should be made permanent in the world, applies to static ones.
Logged

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: List of all the debug/monitoring tools
« Reply #31 on: September 09, 2014, 05:21:20 pm »

What's the format for xyz co-ordinates for #pos or #rot?

tried w.create_instance("outerra/mig29/mig29", #(pos 10, 20, 50), #rot, false) and variations thereof to no avail.
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6618
  • Pegs is clever, but tae hain’t a touch sentimental
    • outerra.com
Re: List of all the debug/monitoring tools
« Reply #32 on: September 10, 2014, 02:37:58 am »

#pos or #(pos distance) are macros that expand to the current world position + distance ahead. Normally you'd write a position vector there, like {x:6000000, y:14124, z:-1135222}. It's in ECEF.
#rot is rotation quaternion of the camera. Entering quaternion manually is the same (it has also w: component), but you'll probably rather want to convert it from Euler angles. Unfortunately there's no vector math library included in javascript, so working with vector operations is clumsy.
Logged

M7

  • Hero Member
  • *****
  • Posts: 736
  • newbie
Re: List of all the debug/monitoring tools
« Reply #33 on: September 16, 2014, 10:18:35 pm »

Ctrl+F4 : Recorder

What does it record? Is it recording video in another format? I tried to record something with it but when i hit record, the window close and i see the red dot with the time but i can't reopen that window with ctrl+F4 so i cant stop recording whatever it records.
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6618
  • Pegs is clever, but tae hain’t a touch sentimental
    • outerra.com
Re: List of all the debug/monitoring tools
« Reply #34 on: September 17, 2014, 01:24:11 am »

I think that was used to record vehicles and aircraft and their flight paths, to be replayed later. But it was just a temporary stuff, it should not be accessible there.
Logged

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: List of all the debug/monitoring tools
« Reply #35 on: March 16, 2015, 06:42:54 pm »

Can any of these commands be executed from within a vehicle's JS file? I'd like to be able to spawn smaller objects from larger ones.
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6618
  • Pegs is clever, but tae hain’t a touch sentimental
    • outerra.com
Re: List of all the debug/monitoring tools
« Reply #36 on: March 17, 2015, 02:27:12 am »

You could query the world interface and call the equivalent methods, but it's not guaranteed to stay supported. We should add methods to spawn objects from within other objects. I guess initially they should be attached to the parent, and then released while inheriting the motion vectors etc.
Logged

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: List of all the debug/monitoring tools
« Reply #37 on: March 17, 2015, 07:06:58 am »

You could query the world interface and call the equivalent methods,

Could you give an example of that code? Thanks.

And I guess another future request is an option to stop vehicles from automatically resetting to ground level when they're spawned.
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6618
  • Pegs is clever, but tae hain’t a touch sentimental
    • outerra.com
Re: List of all the debug/monitoring tools
« Reply #38 on: March 17, 2015, 04:51:22 pm »

Code: [Select]
var world = this.$query_interface("ot::js::world.get");
var vehicle = world.create_instance("outerra/ddg/ddg", pos, {x:0, y:0, z:0, w:1}, false);

This does not reset vehicles to ground, that's just what the object placer does.
Logged

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: List of all the debug/monitoring tools
« Reply #39 on: April 16, 2015, 03:32:12 pm »

Sorry to bother you again but how would I execute $con.get_hpr() from a js file?
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6618
  • Pegs is clever, but tae hain’t a touch sentimental
    • outerra.com
Re: List of all the debug/monitoring tools
« Reply #40 on: April 16, 2015, 04:48:52 pm »

From what js file? A vehicle script? Vehicles have this.heading_pitch_roll() function.
Logged

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: List of all the debug/monitoring tools
« Reply #41 on: April 16, 2015, 04:55:49 pm »

I'm sorry, I meant "get_camera_angles()", though that heading_pitch_roll function is indeed a useful unlisted command.

and, yes from a vehicle script.
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6618
  • Pegs is clever, but tae hain’t a touch sentimental
    • outerra.com
Re: List of all the debug/monitoring tools
« Reply #42 on: April 16, 2015, 05:09:48 pm »

get_camera_angles() returns lat/lon of current camera position. If you want to get lat/lon of a point, you could use the following (returns radians):

Code: [Select]
lon = Math.atan2(p.y, p.x);
lat = Math.atan2(p.z, Math.sqrt(p.x*p.x + p.y*p.y);

If you specifically want the coordinates of the camera, I can't think of a way to get them from vehicle script ... but if you want the angles for the object, you can use the code above with its position.
Logged

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: List of all the debug/monitoring tools
« Reply #43 on: April 16, 2015, 05:29:52 pm »

I was hoping it had the angles set_camera_angle had but thanks anyway.
Logged
Pages: 1 2 [3]