StaticObj::StaticObj(ObjectType p_typeOfObject, BoundingOrientedBox p_box) { m_typeOfObject = p_typeOfObject; m_box = p_box; XMVECTOR t_scalingVector = XMLoadFloat3(&m_box.Center); XMVECTOR t_scalingFactor = XMLoadFloat3(&XMFLOAT3(1,1,1)); XMVECTOR t_rotationOrigin = t_scalingVector; XMVECTOR t_orientation = XMLoadFloat4(&m_box.Orientation); XMVECTOR t_position = XMLoadFloat3(&m_box.Center); XMMATRIX testTransformation = XMMatrixTransformation(t_scalingVector,t_orientation, t_scalingFactor, t_rotationOrigin,t_orientation, t_position); //m_box.Transform(m_box, XMMatrixInverse(nullptr, testTransformation)); //XMMATRIX testRotation = XMMatrixRotationQuaternion(XMLoadFloat4(&m_box.Orientation)); //XMVECTOR //XMMATRIX testTransformation = XMMatrixTransformation() }
void GameEntity::Update(float dt) { // Load XMFLOAT4 origin = XMFLOAT4(0.0f, 0.0f, 0.0f, 1.0f); XMVECTOR orig = XMLoadFloat4(&origin); XMVECTOR pos = XMLoadFloat4(&_position); //Rotation XMVECTOR rot = XMLoadFloat4(&_rotation); // Scale XMVECTOR scal = XMLoadFloat4(&_scale); // Change // Update world matrix XMMATRIX worldMatrix = XMMatrixTranspose(XMMatrixTransformation(orig, rot, scal, orig, rot, pos)); // Store XMStoreFloat4(&_position, pos); XMStoreFloat4(&_rotation, rot); XMStoreFloat4(&_scale, scal); XMStoreFloat4x4(&_world, worldMatrix); }