summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2011-09-08 16:10:44 +0200
committerKahrl <kahrl@gmx.net>2011-09-08 16:10:44 +0200
commite4cb0044602f2dc5eb92c8955797b628c158a0d9 (patch)
tree7a8c131e399a67033b9fc11458bf81d97b02ea6c /src/game.cpp
parent71418639d3e81a0c4f03633042f9c3472572a87e (diff)
downloadminetest-e4cb0044602f2dc5eb92c8955797b628c158a0d9.tar.gz
minetest-e4cb0044602f2dc5eb92c8955797b628c158a0d9.tar.bz2
minetest-e4cb0044602f2dc5eb92c8955797b628c158a0d9.zip
trying something else... also replaced M_PI by PI everywhere
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/game.cpp b/src/game.cpp
index af4886137..cb7594c30 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -831,7 +831,7 @@ void the_game(
Tool
*/
- v3f tool_wield_position(0.06*BS, 1.619*BS, 0.1*BS);
+ v3f tool_wield_position(0.06*BS, -0.06*BS, 0.1*BS);
v3f tool_wield_rotation(-25, 180, -25);
float tool_wield_animation = 0.0;
scene::IMeshSceneNode *tool_wield;
@@ -856,7 +856,7 @@ void the_game(
mesh->addMeshBuffer(buf);
buf->drop();
- tool_wield = smgr->addMeshSceneNode(mesh, camera.getPlayerNode());
+ tool_wield = smgr->addMeshSceneNode(mesh, camera.getCameraNode());
mesh->drop();
}
tool_wield->setVisible(false);
@@ -1997,8 +1997,9 @@ void the_game(
Animate tool
*/
{
- tool_wield->setRotation(tool_wield_rotation - sin(tool_wield_animation * PI) * 40.0);
- tool_wield->setPosition(tool_wield_position - sin(tool_wield_animation * PI) / 3.0);
+ f32 tool_wield_sin = sin(tool_wield_animation * PI);
+ tool_wield->setRotation(tool_wield_rotation - tool_wield_sin * 40.0);
+ tool_wield->setPosition(tool_wield_position - tool_wield_sin * BS / 30.0);
}