Math.abs error
BlitzMax Forums/BlitzMax Beginners Area/Math.abs error
| ||
Hi, I ported APE (Actionscript Physics Engine) over to Bmax and i'm going through all the compiler errors now, and I got to this one and I can't figure out what's wrong. There's an error at this line: Local radius# = extents[0] * (Math.abs(axis.dot(axes[0]))) + extents[1] * (Math.abs(axis.dot(axes[1]))) that says in the error message: "Compile Error. Expecting expression but encountered Abs" here's some info so you can understand the code a little better: extents[] is an array of Floats axis[] is an array of Vectors dot(v:Vector) returns a Float (dot-product) I'm kind of confused right now, any help would be appreciated. |
| ||
Change Math.abs() to Abs(). |
| ||
the whole line is wrong. math is not a function of bmax axis.dot(axes[0]) if dot is an array then you need to change () to []. |
| ||
Math functions such as Abs, Sin, Cos, Sqr aren't in a sepparate Math class like in Java. They are global functions. So you would just do Abs( ... ) to use Abs. |