Code: Select all
RectF( topleft + Vec2( x * brickWidth, y * brickHeight ) );
like this:
Code: Select all
RectF( topleft + Vec2( x, y ) * Vec2( brickWidth, brickHeight ) );
Code: Select all
RectF( topleft + Vec2( x * brickWidth, y * brickHeight ) );
Code: Select all
RectF( topleft + Vec2( x, y ) * Vec2( brickWidth, brickHeight ) );
Code: Select all
Vec2 a( 1, 3 );
Vec2 b( 4, 5 );
Mat2x2 c
{
b.x, 0.f,
0.f, b.y
};
Vec2 result;
result.x = ( a.x * c.values[0][0] ) + ( a.y * c.values[1][0] );
result.y = ( a.x * c.values[0][1] ) + ( a.y * c.values[1][1] );
// Would be the same as
Vec2 result = Vec2(
DotProduct( a, { c.values[0][0], c.values[1][0] },
DotProduct( a, { c.values[0][1], c.values[1][1] }
);
// Or, if you have one of the chili frameworks that has his _Vec2 template class
Vec2 result = Vec2(
a * { c[0][0], c[1][0] },
a * { c[0][1], c[1][1] }
);
// Since he overloads his operator*(const _Vec2 &) function to be the dot product operation.
Code: Select all
class Mat2x2
{
public:
Mat2x2( float V00, float V01, float V10, float V11 );
float values[2][2];
};