AABB to AABB collision time function

BlitzMax Forums/BlitzMax Programming/AABB to AABB collision time function

Ok in C++ that's passing by reference, you are passing the actual variable as opposed to passing by value where only the numeric value of the variable is transfered.

In BlitzMax you can use pointers to pass the Address of the variable and this can then be used to alter the value of the variable.

e.g.
x=1;y=2

Print x + " " + y
change(Varptr x, Varptr y)
Print x + " " + y
'hopefully now x=3;y=5

Function change(a:Int Ptr,b:Int Ptr)
       a[0]=a[0]+2;b[0]=b[0]+2
End Function


The odd array syntax is used to access the values of the variable pointers.

There may be a better way to write this, but hope it helps.

Regards