transform fix, revived path tracer

This commit is contained in:
turanszkij
2018-09-03 19:13:02 +01:00
parent 0f28948c01
commit 922af25343
2 changed files with 792 additions and 904 deletions
File diff suppressed because it is too large Load Diff
+10 -12
View File
@@ -94,20 +94,18 @@ namespace wiSceneSystem
{
dirty = true;
XMVECTOR S_local = XMLoadFloat3(&scale_local);
XMVECTOR R_local = XMLoadFloat4(&rotation_local);
XMVECTOR T_local = XMLoadFloat3(&translation_local);
XMMATRIX W =
XMMatrixScalingFromVector(S_local) *
XMMatrixRotationQuaternion(R_local) *
XMMatrixTranslationFromVector(T_local);
XMVECTOR S;
XMVECTOR R;
XMVECTOR T;
XMMatrixDecompose(&S, &R, &T, matrix);
W = W * matrix;
S = XMLoadFloat3(&scale_local) * S;
R = XMQuaternionMultiply(XMLoadFloat4(&rotation_local), R);
T = XMLoadFloat3(&translation_local) + T;
XMMatrixDecompose(&S_local, &R_local, &T_local, W);
XMStoreFloat3(&scale_local, S_local);
XMStoreFloat4(&rotation_local, R_local);
XMStoreFloat3(&translation_local, T_local);
XMStoreFloat3(&scale_local, S);
XMStoreFloat4(&rotation_local, R);
XMStoreFloat3(&translation_local, T);
}
void TransformComponent::Lerp(const TransformComponent& a, const TransformComponent& b, float t)
{