Esempio n. 1
0
static QScriptValue ScaleOp_ToFloat4x4_const(QScriptContext *context, QScriptEngine *engine)
{
    if (context->argumentCount() != 0) { printf("Error! Invalid number of arguments passed to function ScaleOp_ToFloat4x4_const in file %s, line %d!\nExpected 0, but got %d!\n", __FILE__, __LINE__, context->argumentCount()); PrintCallStack(context->backtrace()); return QScriptValue(); }
    ScaleOp This = qscriptvalue_cast<ScaleOp>(context->thisObject());
    float4x4 ret = This.ToFloat4x4();
    return qScriptValueFromValue(engine, ret);
}
Esempio n. 2
0
float3x4 operator *(const ScaleOp &lhs, const TranslateOp &rhs)
{
	float3x4 ret;
	ret[0][0] = lhs.x; ret[0][1] =	 0; ret[0][2] =	 0; ret[0][3] = lhs.x * rhs.x;
	ret[1][0] =	 0; ret[1][1] = lhs.y; ret[1][2] =	 0; ret[1][3] = lhs.y * rhs.y;
	ret[2][0] =	 0; ret[2][1] =	 0; ret[2][2] = lhs.z; ret[2][3] = lhs.z * rhs.z;

	mathassert(ret.Equals(lhs.ToFloat3x4() * rhs));
	return ret;
}
Esempio n. 3
0
float3x4 operator *(const float3x4 &lhs, const ScaleOp &rhs)
{
	float3x4 ret;
	ret[0][0] = lhs[0][0] * rhs.x; ret[0][1] = lhs[0][1] * rhs.y; ret[0][2] = lhs[0][2] * rhs.z; ret[0][3] = lhs[0][3];
	ret[1][0] = lhs[1][0] * rhs.x; ret[1][1] = lhs[1][1] * rhs.y; ret[1][2] = lhs[1][2] * rhs.z; ret[1][3] = lhs[1][3];
	ret[2][0] = lhs[2][0] * rhs.x; ret[2][1] = lhs[2][1] * rhs.y; ret[2][2] = lhs[2][2] * rhs.z; ret[2][3] = lhs[2][3];

	mathassert(ret.Equals(lhs * rhs.ToFloat3x4()));
	return ret;
}
Esempio n. 4
0
float3x4 operator *(const ScaleOp &lhs, const float3x4 &rhs)
{
	float3x4 ret;
	ret[0][0] = rhs[0][0] * lhs.scale.x; ret[0][1] = rhs[0][1] * lhs.scale.x; ret[0][2] = rhs[0][2] * lhs.scale.x; ret[0][3] = rhs[0][3] * lhs.scale.x;
	ret[1][0] = rhs[1][0] * lhs.scale.y; ret[1][1] = rhs[1][1] * lhs.scale.y; ret[1][2] = rhs[1][2] * lhs.scale.y; ret[1][3] = rhs[1][3] * lhs.scale.y;
	ret[2][0] = rhs[2][0] * lhs.scale.z; ret[2][1] = rhs[2][1] * lhs.scale.z; ret[2][2] = rhs[2][2] * lhs.scale.z; ret[2][3] = rhs[2][3] * lhs.scale.z;

	mathassert(ret.Equals(lhs.ToFloat3x4() * rhs));
	return ret;
}
Esempio n. 5
0
float4x4 operator *(const ScaleOp &lhs, const float4x4 &rhs)
{
	float4x4 ret;
#if defined(MATH_AUTOMATIC_SSE) && defined(MATH_SIMD)
	simd4f x = xxxx_ps(lhs.scale.v);
	simd4f y = yyyy_ps(lhs.scale.v);
	simd4f z = zzzz_ps(lhs.scale.v);
	ret.row[0] = mul_ps(rhs.row[0], x);
	ret.row[1] = mul_ps(rhs.row[1], y);
	ret.row[2] = mul_ps(rhs.row[2], z);
	ret.row[3] = rhs.row[3];
#else
	ret[0][0] = rhs[0][0] * lhs.scale.x; ret[0][1] = rhs[0][1] * lhs.scale.x; ret[0][2] = rhs[0][2] * lhs.scale.x; ret[0][3] = rhs[0][3] * lhs.scale.x;
	ret[1][0] = rhs[1][0] * lhs.scale.y; ret[1][1] = rhs[1][1] * lhs.scale.y; ret[1][2] = rhs[1][2] * lhs.scale.y; ret[1][3] = rhs[1][3] * lhs.scale.y;
	ret[2][0] = rhs[2][0] * lhs.scale.z; ret[2][1] = rhs[2][1] * lhs.scale.z; ret[2][2] = rhs[2][2] * lhs.scale.z; ret[2][3] = rhs[2][3] * lhs.scale.z;
	ret[3][0] = rhs[3][0];         ret[3][1] = rhs[3][1];         ret[3][2] = rhs[3][2];         ret[3][3] = rhs[3][3];
#endif
	mathassert(ret.Equals(lhs.ToFloat4x4() * rhs));
	return ret;
}