MRjsExtensions

These are my custom javaScript extensions for Max6, which are always a work in progress.

For Max7 include the following line at the top of your .js if you want to use this package:
include("MRjsExtensions");
download

Currently available functions:


/****************************************/
function probGate(r)
/****************************************/
function rectWH(r) {//return Width, Height, Area of given rect
/*******************************/
function rectWHtoTopBottom (r) {//convert a rect of form TL, width, height to TL, BR
/********************************/
function rectTopBottomToWH (r) {//convert a rect of form TL, BR to TL, width, height
/********************************/
function rectPosition(r) {//return center point (x/y) of given rect
/********************************/
function rectMake (r) {//creates a rect with tL, bR
/********************************/
function pointInRect(x, y, r)
{//check if given point (x/y) is in rect (r) ->top L, bottom R
/********************************************/
function pointInAnyRect(x, y, array)
/********************************************/
function pointInAnyRectTB(x, y, array)
/********************************/
function rectInRect(r1, r2)
/********************************/
function pointToRect(x, y, w, h)
/************************************************/
function distance2d(pos1, pos2)
/************************************************/
function distance3d(pos1, pos2)
/************************************************/
function distanceArray2d(pos, posArray)
/************************************************/
function distanceArray3d(pos, posArray)
/************************************************/
// array stuff
/************************************************/
/************************************************/
function uniqueArray(origArr)
/************************************************/
function postArray(array, string)
/****************************************/
function postArray2(array)
/****************************************/
function arrayMax(r)
/****************************************/
function arrayMin(r)
/****************************************/
function sortDesc(a,b)
/****************************************/
function sortDescM(a,b)
/****************************************/
function sortDescM1(a,b)
/****************************************/
function sortDescM2(a,b)
/****************************************/
function sortDescM3(a,b)
/****************************************/
function sortDescM4(a,b)
/****************************************/
function sortDescM5(a,b)
/****************************************/
function sortDescM6(a,b)
/****************************************/
function sortDescM13(a,b)
/****************************************/
/****************************************/
function sortAsc(a,b)
/****************************************/
function sortAscM(a,b)
/****************************************/
function sortAscM1(a,b)
/****************************************/
function sortAscM2(a,b)
/****************************************/
function sortAscM3(a,b)
/****************************************/
function sortAscM4(a,b)
/****************************************/
function sortAscM5(a,b)
/****************************************/
function sortAscM6(a,b)
/****************************************/
function sortAscM13(a,b)
/****************************************/
/****************************************/
/****************************************/
Array.prototype.setAll = function(v) {
/****************************************/