SleakEngine
1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
Mouse.hpp
Go to the documentation of this file.
1
/*
2
-------- Unprojecting mouse coordinate (NDC) to world space
3
float ndcX = (2.0f * mouseX) / screenWidth - 1.0f;
4
float ndcY = 1.0f - (2.0f * mouseY) / screenHeight;
5
XMMATRIX viewProjectionMatrix = XMMatrixMultiply(viewMatrix, projectionMatrix);
6
7
XMVECTOR mouseNDC = XMVectorSet(ndcX, ndcY, 0.0 , 1.0); // Z value stands for Near/Far plane
8
9
XMMATRIX inverseViewProjection = XMMatrixInverse(nullptr, viewProjectionMatrix);
10
11
XMVECTOR worldNear = XMVector3TransformCoord(mouseNear, inverseViewProjection);
12
*/
include
public
Input
Mouse.hpp
Generated on
for SleakEngine by
1.16.1