Example #1
0
    static PxQuat setRotY(out PxMat33 m, float angle)
    {
        m = new PxMat33(PxIdentity);

        float cos = MathF.Cos(angle);
        float sin = MathF.Sin(angle);

        //BIOQUIRK: Overloaded indexers
        //BIOQUIRK: Also the lifetime of these pointers is wildly illegal if the PxMat33 is on the managed heap
        *(m.operator_Subscript(0)->operator_Subscript(0)) = *(m.operator_Subscript(2)->operator_Subscript(2)) = cos;
        *(m.operator_Subscript(0)->operator_Subscript(2)) = -sin;
        *(m.operator_Subscript(2)->operator_Subscript(0)) = sin;

        return(new PxQuat(m));
    }