• R/O
  • SSH
  • HTTPS

gdx64: Commit


Commit MetaInfo

Revisión272 (tree)
Tiempo2020-01-19 03:06:08
Autorhgtterry

Log Message

GD19 Ogre 1.9 Camera Follower 180120

Cambiar Resumen

Diferencia incremental

--- GD19_OSDN/GD19_OgreListener.cpp (revision 271)
+++ GD19_OSDN/GD19_OgreListener.cpp (revision 272)
@@ -60,6 +60,7 @@
6060 GD_Selection_Mode = 0;
6161
6262 FollowPlayer = 1;
63+ Object_ToFollow = 1;
6364
6465 Show_ImGui_Panels = 1;
6566
@@ -218,13 +219,21 @@
218219 }
219220 else
220221 {
222+ btVector3 Centre;
223+ Centre = App->Cl_Scene_Data->Cl_Object[Object_ToFollow]->bt_body->getWorldTransform().getOrigin();
224+ Pos.x = Centre.getX();
225+ Pos.y = Centre.getY();
226+ Pos.z = Centre.getZ();
221227
228+ //mmPitch = App->Cl_Scene_Data->Cl_Object[Object_ToFollow]->OgreNode->getOrientation().getPitch();
229+ mYaw = App->Cl_Scene_Data->Cl_Object[Object_ToFollow]->OgreNode->getOrientation().getYaw();
230+ Pos.y = Pos.y + App->Cl_Player->PlayerHeight;
222231 }
223232
224233 App->Cl19_Ogre->mCamera->setPosition(Pos);
225234 App->Cl19_Ogre->mCamera->setOrientation(Ogre::Quaternion(1, 0, 0, 0));
226235 App->Cl19_Ogre->mCamera->yaw(mYaw);
227- App->Cl19_Ogre->mCamera->pitch(mmPitch);
236+ //App->Cl19_Ogre->mCamera->pitch(mmPitch);
228237 App->Cl19_Ogre->mCamera->yaw(Ogre::Degree(180));
229238
230239
--- GD19_OSDN/GD19_OgreListener.h (revision 271)
+++ GD19_OSDN/GD19_OgreListener.h (revision 272)
@@ -103,6 +103,7 @@
103103 bool ShowFPS;
104104 bool StopOgre;
105105 bool FollowPlayer;
106+ int Object_ToFollow;
106107
107108 MOC::CollisionTools* mCollisionTools;
108109
--- GD19_OSDN/GD_Keyboard.cpp (revision 271)
+++ GD19_OSDN/GD_Keyboard.cpp (revision 272)
@@ -8,6 +8,7 @@
88 Rate = 0;
99 OldPos.ZERO;
1010 //mCamera = App->Cl19_Ogre->OgreListener->mCam;
11+
1112 }
1213
1314
@@ -20,6 +21,19 @@
2021 // *************************************************************************
2122 void GD_Keyboard::Keyboard_Monitor(float deltaTime)
2223 {
24+ //------------------------------------------------ O Key - Change to Object
25+ if (GetAsyncKeyState(79) < 0 && App->Cl19_Ogre->OgreListener->GD_CameraMode == Enums::CamFirst)
26+ {
27+
28+ App->Cl19_Ogre->OgreListener->FollowPlayer = 0;
29+ }
30+
31+ if (GetAsyncKeyState(80) < 0 && App->Cl19_Ogre->OgreListener->GD_CameraMode == Enums::CamFirst)
32+ {
33+
34+ App->Cl19_Ogre->OgreListener->FollowPlayer = 1; // P Key - Change to Player
35+ }
36+
2337 //------------------------------------------------ Space Key - Jump and Selection
2438 if (GetAsyncKeyState(VK_SPACE) < 0 && App->Cl_Player->PlayerAdded == 1)
2539 {
Show on old repository browser