Anteworld - Outerra Game > JavaScript development

Function documentation

(1/1)

zzz:
Can we get some documentation on:

this.$ctx()

specifically on how to get the context of another Object from within a different Object.

and

this.object_test
this.add_weapon

Thanks.

cameni:
$ctx returns the context where the object was created. this.$ctx() returns the scope through which you can access the global variables, the same ones that you'd normally access without any $ctx call. Hence, it makes no sense to use it on this, but only on references to other objects that you obtained, if you want to access their globals.

Note all this temporary and will likely go away, as it's no good usage pattern to have scripts accessing stuff arbitrarily.


--- Code: ---    ///Test if ray from model hits an object
    //@param pos model-space position
    //@param dir model-space ray direction
    //@param maxdist max ray distance to check (keep short if possible)
    //@param exclude_self true if ray should not hit origin body
    //@param joint [optional] bone id to be relative to (with pos, rot arguments)
    //@return {$ret: object hit, norm: hit surface normal vector, hitpoint: world position}
    function object_test( pos, dir, maxdist, exclude_self, joint)

--- End code ---

add_weapon is a dummy, does nothing yet.

Navigation

[0] Message Index

Go to full version