Mercurial > hg > Game > Cerium
changeset 975:c48e3866f85f draft
player is center in camera
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 01 Oct 2010 19:26:10 +0900 |
parents | 6e6d5a2ffe52 |
children | 8e35f32c6ed1 |
files | Renderer/Test/network.cc |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Test/network.cc Fri Oct 01 18:52:13 2010 +0900 +++ b/Renderer/Test/network.cc Fri Oct 01 19:26:10 2010 +0900 @@ -167,10 +167,12 @@ if (pad->right.isHold() || pad->left.isHold()) { if (pad->right.isHold()) { node->xyz[0] += 5.0f; + sgroot->camera->xyz[0] = node->xyz[0]; // node->angle[1] = 0.0f; flag = 1; } else if (pad->left.isHold()) { node->xyz[0] -= 5.0f; + sgroot->camera->xyz[0] = node->xyz[0]; // node->angle[1] = 180.0f; flag = 1; } @@ -179,9 +181,11 @@ if (pad->down.isHold() || pad->up.isHold() ) { if (pad->down.isHold()) { node->xyz[1] += 5.0f; + sgroot->camera->xyz[1] = node->xyz[1]; flag = 1; } else if (pad->up.isHold()) { node->xyz[1] -= 5.0f; + sgroot->camera->xyz[1] = node->xyz[1]; flag = 1; } } @@ -200,7 +204,10 @@ SceneGraphPtr sgp = viewer->createSceneGraph(); viewer->createFromXMLmemory(sgp, (char *)addr, size); sgp->set_move_collision(my_move, null_collision); - + Camera *camera = viewer->sgroot->camera; + camera->xyz[0] = 0.0; + camera->xyz[1] = 0.0; + par->addChild(sgp); sgp->c_xyz[0] = 0.0f; sgp->c_xyz[1] = 0.0f;