summaryrefslogtreecommitdiff
path: root/src/world_camera.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/world_camera.cpp35
1 files changed, 27 insertions, 8 deletions
diff --git a/src/world_camera.cpp b/src/world_camera.cpp
index 4f9b848..a020621 100644
--- a/src/world_camera.cpp
+++ b/src/world_camera.cpp
@@ -21,6 +21,11 @@ int dWorldCamera_c::onCreate() {
this->camPos = (Point3d){0.0f, 500.0f, 1000.0f};
this->camRotate = (Point3d){-40.0f, -30.0f, 0.0f}; // ZXY order
+ camDist = 740;
+ camY = 330;
+ targetDist = 100;
+ targetY = -220;
+
return true;
}
@@ -33,7 +38,7 @@ int dWorldCamera_c::onDelete() {
int dWorldCamera_c::onExecute() {
int heldButtons = Remocon_GetButtons(GetActiveRemocon());
- if (heldButtons & WPAD_LEFT)
+ /*if (heldButtons & WPAD_LEFT)
this->camPos.x -= 5.0f;
if (heldButtons & WPAD_RIGHT)
this->camPos.x += 5.0f;
@@ -46,7 +51,21 @@ int dWorldCamera_c::onExecute() {
if (heldButtons & WPAD_MINUS)
this->camRotate.y -= 2.0f;
if (heldButtons & WPAD_PLUS)
- this->camRotate.y += 2.0f;
+ this->camRotate.y += 2.0f;*/
+
+ /*bool change = false;
+
+ if (heldButtons & WPAD_LEFT) { camDist -= 5.0f; change = true; }
+ if (heldButtons & WPAD_RIGHT) { camDist += 5.0f; change = true; }
+ if (heldButtons & WPAD_UP) { camY -= 5.0f; change = true; }
+ if (heldButtons & WPAD_DOWN) { camY += 5.0f; change = true; }
+ if (heldButtons & WPAD_MINUS) { targetDist -= 5.0f; change = true; }
+ if (heldButtons & WPAD_PLUS) { targetDist += 5.0f; change = true; }
+ if (heldButtons & WPAD_ONE) { targetY -= 5.0f; change = true; }
+ if (heldButtons & WPAD_TWO) { targetY += 5.0f; change = true; }
+
+ if (change)
+ OSReport("[Cam Dist=%f Y=%f] [Target Dist=%f Y=%f]\n", camDist, camY, targetDist, targetY);*/
return true;
}
@@ -87,17 +106,17 @@ int dWorldCamera_c::onDraw() {
// TODO: Make these vars tweakable!
float angle = MTXDegToRad(90.0) - atan2(daWMPlayer_c::instance->pos.z, daWMPlayer_c::instance->pos.x);
- float camX = sin(angle) * 800;
- float camZ = cos(angle) * 800;
- float targetX = sin(angle) * 100;
- float targetZ = cos(angle) * 100;
+ float camX = sin(angle) * camDist;
+ float camZ = cos(angle) * camDist;
+ float targetX = sin(angle) * targetDist;
+ float targetZ = cos(angle) * targetDist;
nw4r::g3d::Camera::PostureInfo posture;
posture.tp = nw4r::g3d::Camera::POSTURE_LOOKAT;
posture.cameraUp = (Point3d){0,1,0};
- posture.cameraTarget = (Point3d){targetX,0,targetZ};
+ posture.cameraTarget = (Point3d){targetX,targetY,targetZ};
- cam3d.SetPosition((Point3d){camX,50,camZ});
+ cam3d.SetPosition((Point3d){camX,camY,camZ});
cam3d.SetPosture(posture);
return true;