1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 22/* Minetest Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #pragma once #include "irrlichttypes_extrabloated.h" #include "inventory.h" #include "client/tile.h" #include <ICameraSceneNode.h> #include <ISceneNode.h> #include <list> class LocalPlayer; struct MapDrawControl; class Client; class WieldMeshSceneNode; struct Nametag { Nametag(scene::ISceneNode *a_parent_node, const std::string &a_nametag_text, const video::SColor &a_nametag_color, const v3f &a_nametag_pos): parent_node(a_parent_node), nametag_text(a_nametag_text), nametag_color(a_nametag_color), nametag_pos(a_nametag_pos) { } scene::ISceneNode *parent_node; std::string nametag_text; video::SColor nametag_color; v3f nametag_pos; }; enum CameraMode {CAMERA_MODE_FIRST, CAMERA_MODE_THIRD, CAMERA_MODE_THIRD_FRONT}; /* Client camera class, manages the player and camera scene nodes, the viewing distance and performs view bobbing etc. It also displays the wielded tool in front of the first-person camera. */ class Camera { public: Camera(MapDrawControl &draw_control, Client *client); ~Camera(); // Get camera scene node. // It has the eye transformation, pitch and view bobbing applied. inline scene::ICameraSceneNode* getCameraNode() const { return m_cameranode; } // Get the camera position (in absolute scene coordinates). // This has view bobbing applied. inline v3f getPosition() const { return m_camera_position; } // Returns the absolute position of the head SceneNode in the world inline v3f getHeadPosition() const {< v 0.028581 0.039726 0.268412 v 0.028581 0.166622 0.268412 v 0.028581 0.166622 0.325575 v 0.028581 0.039726 0.325575 v -0.028581 0.370886 0.439611 v -0.028581 0.497782 0.439611 v 0.028581 0.497782 0.439611 v 0.028581 0.370886 0.439611 v 0.028581 0.370886 0.496774 v 0.028581 0.497782 0.496774 v -0.028581 0.497782 0.496774 v -0.028581 0.370886 0.496774 v -0.028581 0.370886 0.325575 v -0.028581 0.497782 0.325575 v -0.028581 0.497782 0.268412 v -0.028581 0.370886 0.268412 v 0.028581 0.370886 0.268412 v 0.028581 0.497782 0.268412 v 0.028581 0.497782 0.325575 v 0.028581 0.370886 0.325575 v 0.028581 -0.826857 0.268412 v -0.028581 -0.826857 0.268412 v -0.028581 -0.826857 0.496774 v 0.028581 -0.826857 0.496774 v 0.028581 -0.826857 0.325575 v 0.028581 -0.826857 0.439611 v -0.028581 -0.826857 0.325575 v -0.028581 -0.826857 0.439611 v -0.028581 -0.622593 0.439611 v 0.028581 -0.622593 0.439611 v 0.028581 -0.622593 0.496774 v -0.028581 -0.622593 0.496774 v -0.028581 -0.622593 0.325575 v -0.028581 -0.622593 0.268412 v 0.028581 -0.622593 0.268412 v 0.028581 -0.622593 0.325575 vt 0.214079 0.750000 vt 0.214079 0.595797 vt 0.285559 0.595797 vt 0.214079 0.500000 vt 0.285559 0.500000 vt 0.285559 0.750000 vt 0.357039 0.595797 vt 0.357039 0.500000 vt 0.571118 0.750000 vt 0.571118 0.595797 vt 0.642599 0.595797 vt 0.571118 0.500000 vt 0.642599 0.500000 vt 0.785559 0.250000 vt 0.785559 0.404203 vt 0.714079 0.404203 vt 0.785559 0.500000 vt 0.714079 0.500000 vt 0.714079 0.250000 vt 0.642599 0.404203 vt 0.785559 0.480802 vt 0.785559 0.326599 vt 0.857040 0.326599 vt 0.000000 0.750000 vt 0.000000 0.595797 vt 0.071480 0.595797 vt 0.000000 0.500000 vt 0.071480 0.500000 vt 0.499638 0.750000 vt 0.499638 0.595797 vt 0.499638 0.500000 vt 0.857040 0.480802 vt 0.857040 0.566890 vt 0.928520 0.258266 vt 0.928520 0.172177 vt 1.000000 0.172177 vt 0.214079 0.345797 vt 0.214079 0.250000 vt 0.285559 0.250000 vt 0.285559 0.345797 vt 0.357039 0.250000 vt 0.571118 0.345797 vt 0.571118 0.250000 vt 0.642599 0.250000 vt 0.785559 0.654203 vt 0.785559 0.750000 vt 0.714079 0.750000 vt 0.714079 0.654203 vt 0.642599 0.750000 vt 0.000000 0.345797 vt 0.000000 0.250000 vt 0.071480 0.250000 vt 0.499638 0.345797 vt 0.499638 0.250000 vt 0.857040 0.480583 vt 0.928520 0.480583 vt 0.928520 0.566672 vt 0.357039 0.345797 vt 0.928520 0.086089 vt 1.000000 0.086089 vt 0.214079 0.095797 vt 0.214079 0.000000 vt 0.285559 0.000000 vt 0.285559 0.095797 vt 0.357039 0.000000 vt 0.571118 0.095797 vt 0.571118 0.000000 vt 0.642598 0.000000 vt 0.785559 0.904203 vt 0.785559 1.000000 vt 0.714079 1.000000 vt 0.714079 0.904203 vt 0.642599 1.000000 vt 0.000000 0.095797 vt 0.000000 0.000000 vt 0.071480 0.000000 vt 0.499638 0.095797 vt 0.499638 0.000000 vt 0.857040 0.394495 vt 0.928520 0.394495 vt 0.357039 0.095797 vt 0.785559 0.129242 vt 0.785559 0.043154 vt 0.857040 0.043154 vt 0.857040 0.129242 vt 0.857040 0.172396 vt 0.785559 0.000000 vt 0.857040 0.000000 vt 0.214079 1.000000 vt 0.214079 0.845797 vt 0.285559 0.845797 vt 0.285559 1.000000 vt 0.357040 0.845797 vt 0.571119 1.000000 vt 0.571118 0.845797 vt 0.642599 0.845797 vt 0.785559 0.154203 vt 0.714079 0.154203 vt 0.714079 0.000000 vt 0.642599 0.154203 vt 0.785559 0.172396 vt 0.000000 1.000000 vt 0.000000 0.845797 vt 0.071480 0.845797 vt 0.499638 1.000000 vt 0.499638 0.845797 vt 0.857040 0.308406 vt 0.928520 0.308406 vt 0.642599 0.345797 vt 0.642599 0.654203 vt 0.857040 0.154203 vt 0.928520 0.154203 vt 0.071480 0.345797 vt 0.642599 0.095797 vt 0.642599 0.904203 vt 0.928520 0.000000 vt 0.071480 0.095797 vt 0.357040 0.750000 vt 0.071480 0.750000 vt 1.000000 0.000000 vt 0.785559 0.566890 vt 1.000000 0.258266 vt 0.857040 0.566672 vt 0.357040 1.000000 vt 0.071480 1.000000 vn 1.000000 0.000000 0.000000 vn -1.000000 0.000000 -0.000000 vn 0.000000 0.000000 1.000000 vn 0.000000 0.000000 -1.000000 vn 0.000000 -1.000000 0.000000 vn 0.000000 1.000000 0.000000 g MastVollNode_Plane.006_Mast usemtl Mast s off f 6/1/1 12/2/1 13/3/1 f 12/2/1 11/4/1 14/5/1 f 3/6/2 16/3/2 9/7/2 f 16/3/2 15/5/2 10/8/2 f 4/9/3 13/10/3 16/11/3 f 13/10/3 14/12/3 15/13/3 f 8/14/4 9/15/4 12/16/4 f 9/15/4 10/17/4 11/18/4 f 2/19/4 20/16/4 21/20/4 f 20/16/4 19/18/4 22/13/4 f 5/21/3 24/22/3 17/23/3 f 1/24/1 21/25/1 24/26/1 f 21/25/1 22/27/1 23/28/1 f 7/29/2 17/30/2 20/10/2 f 17/30/2 18/31/2 19/12/2 f 23/28/1 11/4/1 12/2/1 f 17/21/5 24/32/5 12/33/5 f 17/30/2 9/7/2 10/8/2 f 18/34/6 10/35/6 11/36/6 f 28/37/1 27/38/1 30/39/1 f 32/40/2 31/39/2 26/41/2 f 29/42/3 30/43/3 31/44/3 f 25/45/4 26/46/4 27/47/4 f 36/48/4 35/47/4 38/49/4 f 37/50/1 38/51/1 39/52/1 f 33/53/2 34/54/2 35/43/2 f 39/52/1 27/38/1 28/37/1 f 33/55/5 40/56/5 28/57/5 f 33/53/2 25/58/2 26/41/2 f 34/35/6 26/59/6 27/60/6 f 44/61/1 43/62/1 46/63/1 f 48/64/2 47/63/2 42/65/2 f 45/66/3 46/67/3 47/68/3 f 41/69/4 42/70/4 43/71/4 f 52/72/4 51/71/4 54/73/4 f 53/74/1 54/75/1 55/76/1 f 49/77/2 50/78/2 51/67/2 f 55/76/1 43/62/1 44/61/1 f 49/79/5 56/80/5 44/56/5 f 49/77/2 41/81/2 42/65/2 f 50/82/6 42/83/6 43/84/6 f 50/82/6 55/85/6 54/86/6 f 42/83/6 47/87/6 46/88/6 f 62/89/1 66/90/1 67/91/1 f 59/92/2 68/91/2 65/93/2 f 60/94/3 67/95/3 68/96/3 f 64/87/4 65/97/4 66/98/4 f 58/99/4 70/98/4 71/100/4 f 61/22/3 72/101/3 69/86/3 f 57/102/1 71/103/1 72/104/1 f 63/105/2 69/106/2 70/95/2 f 69/107/5 72/108/5 66/80/5 f 11/4/1 28/37/1 29/40/1 f 15/5/2 32/40/2 25/58/2 f 14/12/3 29/42/3 32/109/3 f 10/17/4 25/45/4 28/48/4 f 19/18/4 36/48/4 37/110/4 f 23/107/3 40/111/3 33/112/3 f 22/27/1 37/50/1 40/113/1 f 18/31/2 33/53/2 36/42/2 f 27/38/1 44/61/1 45/64/1 f 31/39/2 48/64/2 41/81/2 f 30/43/3 45/66/3 48/114/3 f 26/46/4 41/69/4 44/72/4 f 35/47/4 52/72/4 53/115/4 f 39/111/3 56/88/3 49/116/3 f 38/51/1 53/74/1 56/117/1 f 34/54/2 49/77/2 52/66/2 f 66/90/1 6/1/1 4/6/1 f 68/91/2 3/6/2 8/118/2 f 67/95/3 4/9/3 3/49/3 f 65/97/4 8/14/4 6/19/4 f 70/98/4 2/19/4 1/44/4 f 71/103/1 1/24/1 5/119/1 f 69/106/2 7/29/2 2/9/2 f 5/119/1 6/1/1 66/90/1 f 69/106/2 65/93/2 8/118/2 f 7/59/6 8/116/6 6/120/6 f 4/6/1 6/1/1 13/3/1 f 13/3/1 12/2/1 14/5/1 f 8/118/2 3/6/2 9/7/2 f 9/7/2 16/3/2 10/8/2 f 3/49/3 4/9/3 16/11/3 f 16/11/3 13/10/3 15/13/3 f 6/19/4 8/14/4 12/16/4 f 12/16/4 9/15/4 11/18/4 f 1/44/4 2/19/4 21/20/4 f 21/20/4 20/16/4 22/13/4 f 7/32/3 5/21/3 17/23/3 f 5/119/1 1/24/1 24/26/1 f 24/26/1 21/25/1 23/28/1 f 2/9/2 7/29/2 20/10/2 f 20/10/2 17/30/2 19/12/2 f 24/26/1 23/28/1 12/2/1 f 9/121/5 17/21/5 12/33/5 f 18/31/2 17/30/2 10/8/2 f 23/122/6 18/34/6 11/36/6 f 29/40/1 28/37/1 30/39/1 f 25/58/2 32/40/2 26/41/2 f 32/109/3 29/42/3 31/44/3 f 28/48/4 25/45/4 27/47/4 f 37/110/4 36/48/4 38/49/4 f 40/113/1 37/50/1 39/52/1 f 36/42/2 33/53/2 35/43/2 f 40/113/1 39/52/1 28/37/1 f 25/123/5 33/55/5 28/57/5 f 34/54/2 33/53/2 26/41/2 f 39/36/6 34/35/6 27/60/6 f 45/64/1 44/61/1 46/63/1 f 41/81/2 48/64/2 42/65/2 f 48/114/3 45/66/3 47/68/3 f 44/72/4 41/69/4 43/71/4 f 53/115/4 52/72/4 54/73/4 f 56/117/1 53/74/1 55/76/1 f 52/66/2 49/77/2 51/67/2 f 56/117/1 55/76/1 44/61/1 f 41/55/5 49/79/5 44/56/5 f 50/78/2 49/77/2 42/65/2 f 55/85/6 50/82/6 43/84/6 f 51/101/6 50/82/6 54/86/6 f 43/84/6 42/83/6 46/88/6 f 60/92/1 62/89/1 67/91/1 f 64/124/2 59/92/2 65/93/2 f 59/73/3 60/94/3 68/96/3 f 62/99/4 64/87/4 66/98/4 f 57/68/4 58/99/4 71/100/4 f 63/23/3 61/22/3 69/86/3 f 61/125/1 57/102/1 72/104/1 f 58/94/2 63/105/2 70/95/2 f 65/79/5 69/107/5 66/80/5 f 14/5/1 11/4/1 29/40/1 f 10/8/2 15/5/2 25/58/2 f 15/13/3 14/12/3 32/109/3 f 11/18/4 10/17/4 28/48/4 f 22/13/4 19/18/4 37/110/4 f 18/108/3 23/107/3 33/112/3 f 23/28/1 22/27/1 40/113/1 f 19/12/2 18/31/2 36/42/2 f 30/39/1 27/38/1 45/64/1 f 26/41/2 31/39/2 41/81/2 f 31/44/3 30/43/3 48/114/3 f 27/47/4 26/46/4 44/72/4 f 38/49/4 35/47/4 53/115/4 f 34/112/3 39/111/3 49/116/3 f 39/52/1 38/51/1 56/117/1 f 35/43/2 34/54/2 52/66/2 f 67/91/1 66/90/1 4/6/1 f 65/93/2 68/91/2 8/118/2 f 68/96/3 67/95/3 3/49/3 f 66/98/4 65/97/4 6/19/4 f 71/100/4 70/98/4 1/44/4 f 72/104/1 71/103/1 5/119/1 f 70/95/2 69/106/2 2/9/2 f 72/104/1 5/119/1 66/90/1 f 7/29/2 69/106/2 8/118/2 f 5/60/6 7/59/6 6/120/6