Outerra forum

Anteworld - Outerra Game => Modding: Importer, Tools & Utilities => JavaScript development => Topic started by: zzz on September 19, 2016, 06:55:18 pm

Title: find_object arguments
Post by: zzz on September 19, 2016, 06:55:18 pm
In the world interface, what are the purposes and arguments of find_object, find_object2, find_object_mesh, and find_object_point?

Putting in random values returns me the ECEF positions of objects when the camera is within their bounding box. Was wondering if I could use it to get the positions of all objects in a scene.
Title: Re: find_object arguments
Post by: cameni on September 20, 2016, 02:35:06 pm
These take parameters that define a single ray, and return the object hit by it. Getting the positions of all objects would be likely too expensive, but sometimes it is used, for example for line-of-sight computation. Usually you'd spread it over several frames though.
Title: Re: find_object arguments
Post by: SteelRat on September 20, 2016, 05:49:23 pm
These take parameters that define a single ray, and return the object hit by it. Getting the positions of all objects would be likely too expensive, but sometimes it is used, for example for line-of-sight computation. Usually you'd spread it over several frames though.

Code: [Select]
$world.nearest_objects(pos/*ECEF*/, radius/*radius of the sphere within which a search will be*/)
?

alternatively an easier solution.