Skip to content

Commit fa1a7fe

Browse files
author
Neha Thumu
committed
quick fixes for camera, diamond collisions, herobrine lookAt
1 parent 16638ba commit fa1a7fe

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

DirectX12TriangleTutorial/DirectX12Triangle/src/Camera.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Camera::Camera()
1212

1313
yaw = 0.0f;
1414
pitch = 0.0f;
15-
mouseSensitivity = 0.005f;
15+
mouseSensitivity = 0.05f;
1616

1717
UpdateCameraVectors();
1818
}
@@ -64,7 +64,7 @@ bool Camera::CheckCollision(const DirectX::XMFLOAT3& newPosition) {
6464
if (camBox.Intersects(camBox, m->b)) {
6565
if (m->isRemovable) {
6666
collectedDiamonds.push_back(m);
67-
continue;
67+
return false;
6868
}
6969
return true;
7070
}

DirectX12TriangleTutorial/DirectX12Triangle/src/Engine.cpp

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ LRESULT CALLBACK WindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPara
5555
float deltaY = static_cast<float>(currentPos.y - engine->lastPos.y);
5656

5757
if (deltaX != 0.0f || deltaY != 0.0f) {
58-
std::string test = "deltaX: " + std::to_string(deltaX) + "\n";
58+
/*std::string test = "deltaX: " + std::to_string(deltaX) + "\n";
5959
OutputDebugStringA(test.c_str());
6060
6161
test = "deltaY: " + std::to_string(deltaY);
62-
OutputDebugStringA(test.c_str());
62+
OutputDebugStringA(test.c_str());*/
6363

6464
engine->lastPos = currentPos;
6565

@@ -90,11 +90,11 @@ LRESULT CALLBACK WindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPara
9090
float deltaY = static_cast<float>(currentPos.y - engine->lastPos.y);
9191

9292
if (deltaX != 0.0f || deltaY != 0.0f) {
93-
std::string test = "deltaX: " + std::to_string(deltaX) + "\n";
94-
OutputDebugStringA(test.c_str());
93+
//std::string test = "deltaX: " + std::to_string(deltaX) + "\n";
94+
//OutputDebugStringA(test.c_str());
9595

96-
test = "deltaY: " + std::to_string(deltaY);
97-
OutputDebugStringA(test.c_str());
96+
//test = "deltaY: " + std::to_string(deltaY);
97+
//OutputDebugStringA(test.c_str());
9898

9999
engine->lastPos = currentPos;
100100

@@ -103,12 +103,12 @@ LRESULT CALLBACK WindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPara
103103
}
104104
}
105105
// Recenter cursor to prevent hitting window boundaries
106-
RECT rect;
106+
/* RECT rect;
107107
GetClientRect(hwnd, &rect);
108108
POINT center = { (rect.right - rect.left) / 2, (rect.bottom - rect.top) / 2 };
109109
ClientToScreen(hwnd, &center);
110110
SetCursorPos(center.x, center.y);
111-
engine->lastPos = center;
111+
engine->lastPos = center;*/
112112
}
113113
}
114114
}
@@ -299,8 +299,10 @@ void Engine::Init() {
299299
diamond->SetRotation(0.0f, DirectX::XM_PI/2.0f, 0.0f);
300300
diamond->ApplyTransformation(false);
301301

302-
diamond->b.minY = 10.0f;
303-
diamond->b.maxY = 11.5f;
302+
/*diamond->b.minY = 10.0f;
303+
diamond->b.maxY = 11.5f;*/
304+
diamond->b.minY = 2.0f;
305+
diamond->b.maxY = 8.0f;
304306
diamond->b.minX -= 2.0f;
305307
diamond->b.maxX += 2.0f;
306308
diamond->b.minZ -= 2.0f;
@@ -346,7 +348,7 @@ void Engine::Run() {
346348
DispatchMessage(&msg);
347349
}
348350
else {
349-
if (renderer->c.IsLookingAtModel(herobrineModel, 0.90f)) {
351+
if (renderer->c.IsLookingAtModel(herobrineModel, 0.80f)) {
350352

351353
/*std::filesystem::path exePath = GetExecutablePath();
352354
std::filesystem::path soundFile = exePath / "assets" / "Audio" / "Cave5.mp3";

0 commit comments

Comments
 (0)