Ejemplo n.º 1
0
void GetMM(M4* result, V3 pos, V3 rot)
{
    M4 rotation;
    M4 translation;

    GetRotationMatrix(&rotation, rot);
    GetTranslationMatrix(&translation, pos);

    MatrixMult(result, translation, rotation);
}
Ejemplo n.º 2
0
void TransformObject::GetWorldTransform(Matrix4f & outM) const
{
	Matrix4f posM, rotM, scaleM;
	GetTranslationMatrix(posM);
	GetRotationMatrix(rotM);
	GetScaleMatrix(scaleM);

	Matrix4f ret = Matrix4f::Multiply(posM, rotM, scaleM);

	outM.SetValues(&ret);
}
Ejemplo n.º 3
0
void TransformObject::GetWorldTransform(Matrix4f & outM) const
{
    //TODO: Figure out the math for making one matrix instead of multiplying the pos, rot, and scale matrices.

	Matrix4f posM, rotM, scaleM;
	GetTranslationMatrix(posM);
	GetRotationMatrix(rotM);
	GetScaleMatrix(scaleM);

	Matrix4f ret = Matrix4f::Multiply(posM, rotM, scaleM);

	outM.Set(ret);
}
Ejemplo n.º 4
0
  inline Matrix3 GetToClipspaceTransform(const FSize& destFrame,
                                         const FPoint& sourcePoint,
                                         bool swapHeightSign) {
    // (Position / Resolution) * 2 - 1
    auto toClipspace = Matrix3{
        2.0f / destFrame.width, 0.0f, -1.0f,
        0.0f, (swapHeightSign ? -2.0f : 2.0f) / destFrame.height,
          (swapHeightSign ? 1.0f : -1.0f),
        0.0f, 0.0f, 1.0f
    };

    return toClipspace * GetTranslationMatrix(-sourcePoint.x, -sourcePoint.y);
  }
Ejemplo n.º 5
0
a2de::Matrix3x3 Matrix3x3::GetTranslationMatrix(const Vector2D& pos) {
    return GetTranslationMatrix(pos.GetX(), pos.GetY());
}
Ejemplo n.º 6
0
 inline constexpr Matrix3 GetTranslationMatrix(const FPoint& point) {
   return GetTranslationMatrix(point.x, point.y);
 }