Exemplo n.º 1
0
float4x4 operator *(const TranslateOp &lhs, const float4x4 &rhs)
{
	float4x4 r = rhs;
	r.SetTranslatePart(r.TranslatePart() + lhs.Offset());

	// Our optimized form of multiplication must be the same as this.
	mathassert(r.Equals(lhs.ToFloat4x4() * rhs));
	return r;
}
Exemplo n.º 2
0
float3x4 operator *(const float3x4 &lhs, const TranslateOp &rhs)
{
	float3x4 r = lhs;
	r.SetTranslatePart(lhs.TransformPos(rhs.Offset()));

	// Our optimized form of multiplication must be the same as this.
	mathassert(r.Equals(lhs * (float3x4)rhs));
	return r;
}
Exemplo n.º 3
0
float3x4 operator *(const float3x4 &lhs, const TranslateOp &rhs)
{
	float3x4 r = lhs;
	r.SetTranslatePart(lhs.TransformPos(DIR_TO_FLOAT3(rhs.Offset())));

	// Our optimized form of multiplication must be the same as this.
	assume4(r.Equals(lhs * (float3x4)rhs), lhs, rhs, r, lhs * (float3x4)rhs);
	return r;
}
Exemplo n.º 4
0
float3x4 operator *(const TranslateOp &lhs, const float3x4 &rhs)
{
	float3x4 r = rhs;
	r.SetTranslatePart(r.TranslatePart() + DIR_TO_FLOAT3(lhs.Offset()));

	// Our optimized form of multiplication must be the same as this.
	mathassert(r.Equals((float3x4)lhs * rhs));
	return r;
}
Exemplo n.º 5
0
float3x4 operator *(const TranslateOp &lhs, const ScaleOp &rhs)
{
	float3x4 ret;
	ret[0][0] = rhs.x; ret[0][1] =	 0; ret[0][2] =	 0; ret[0][3] = lhs.x;
	ret[1][0] =	 0; ret[1][1] = rhs.y; ret[1][2] =	 0; ret[1][3] = lhs.y;
	ret[2][0] =	 0; ret[2][1] =	 0; ret[2][2] = rhs.z; ret[2][3] = lhs.z;

	mathassert(ret.Equals(lhs.ToFloat3x4() * rhs));
	return ret;
}
Exemplo n.º 6
0
float4x4 operator *(const TranslateOp &lhs, const float4x4 &rhs)
{
	// This function is based on the optimized assumption that the last row of rhs is [0,0,0,1].
	// If this does not hold and you are hitting the check below, explicitly cast TranslateOp lhs to float4x4 before multiplication!
	assume(rhs.Row(3).Equals(0.f, 0.f, 0.f, 1.f));

	float4x4 r = rhs;
	r.SetTranslatePart(r.TranslatePart() + DIR_TO_FLOAT3(lhs.Offset()));
	return r;
}
Exemplo n.º 7
0
float4x4 operator *(const float4x4 &lhs, const TranslateOp &rhs)
{
	float4x4 r = lhs;
	r.SetTranslatePart(lhs.TransformPos(DIR_TO_FLOAT3(rhs.Offset())));
	return r;
}