setting statically sized multi-dimensional arrays

Hoenir mrmocool at gmx.de
Tue Jan 22 02:07:01 PST 2008


Spacen Jasset schrieb:
> void MakeRotationAboutX(float[4][4] m, float angle)
> {
>     m[] = [[1f, 0, 0, 0],
>            [0, cos(angle * PI / 180), sin(angle * PI / 180), 0],
>            [0, -sin(angle * PI / 180), cos(angle * PI / 180), 0],
>            [0, 0, 0, 1]];
> }
why don't you use an extra function for the conversion of deg to rad? it 
will get inlined by the compiler so there's no efficiency loss.

btw you rotate clockwise, is this intented?


More information about the Digitalmars-d-learn mailing list