示例#1
0
Matrix4x4::Ptr
Matrix4x4::recompose(Vector3Ptr        translation,
                     QuaternionPtr    rotation,
                     Vector3Ptr        scaling)
{
    static auto matrixRotation = Matrix4x4::create();

    matrixRotation->fromQuaternion(rotation);

    const std::vector<float>& matRot    = matrixRotation->_m;

    const float sx    = scaling->x();
    const float sy    = scaling->y();
    const float sz    = scaling->z();

    return initialize(
        sx * matRot[0],    sy * matRot[1],    sz * matRot[2],        translation->x(),
        sx * matRot[4],    sy * matRot[5],    sz * matRot[6],        translation->y(),
        sx * matRot[8],    sy * matRot[9],    sz * matRot[10],    translation->z(),
        0.0f,            0.0f,            0.0f,                1.0f
    );
}
示例#2
0
			inline
			Ptr
			prependTranslation(Vector3Ptr value)
			{
				return prependTranslation(value->x(), value->y(), value->z());
			}