Utility Object

From Dim3 Wiki

Jump to: navigation, search

This global object model has a number of useful utility functions, from math functions to integer packing functions.

Contents

point

    equal(x,z,y,px,pz,py,slop);         Returns TRUE if equal
    angleTo(x,z,px,pz);                 Returns float angle
    distanceTo(x,z,y,px,pz,py);         Returns integer distance

angle

    add(ang1,ang2);                     Returns float angle
    sub(ang1,ang2);                     Returns float angle
    dif(ang1,ang2);                     Returns float angle

random

    getInteger(min,max);                Returns random integer between min and max
    getFloat(min,max);                  Returns random float between min and max
    getBoolean();                       Returns random boolean
    getPosOrNeg();                      Returns 1 or -1

pack

    pack(high,low);                     Returns the two integers packed into one
    unpackHigh(i);                      Returns the high packed integer
    unpackLow(i);
Personal tools