Inlining ray matrix multiplication