Skip to content
PixhawkCheetahNode.cc 5.47 MiB
Newer Older
/*=====================================================================

QGroundControl Open Source Ground Control Station

(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>

This file is part of the QGROUNDCONTROL project

    QGROUNDCONTROL is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    QGROUNDCONTROL 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 General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.

======================================================================*/

/**
 * @file
 *   @brief Generates a OpenSceneGraph node which renders a
 *
 *   @author Lionel Heng <hengli@student.ethz.ch>
 *
 */

#include <osg/Geometry>
#include <osg/PositionAttitudeTransform>

#include "PixhawkCheetahNode.h"
struct sample_MATERIAL {
    GLfloat ambient[3];
    GLfloat diffuse[3];
    GLfloat specular[3];
    GLfloat emission[3];
    GLfloat alpha;
    GLfloat phExp;
    int texture;
    {{0.117647f,0.117647f,0.117647f},	{0.596078f,0.666667f,0.686275f},	{0.301176f,0.301176f,0.301176f},	{0.0f,0.0f,0.0f},	1.0f,8.0f,-1} //Material #1
// 0 Texture Coordinates
// 22155 Normals
// 77848 Triangles

static unsigned short face_indicies[77848][9] = {
// Battery3.prt
    {0,1,2 ,0,1,0 ,0,0,0}, {3,4,5 ,2,2,3 ,0,0,0}, {3,2,4 ,2,0,2 ,0,0,0},
    {5,4,6 ,3,2,3 ,0,0,0}, {2,3,0 ,0,2,0 ,0,0,0}, {7,1,0 ,1,1,0 ,0,0,0},
    {8,7,9 ,4,1,4 ,0,0,0}, {7,8,1 ,1,4,1 ,0,0,0}, {10,11,12 ,5,6,5 ,0,0,0},
    {13,14,15 ,7,7,8 ,0,0,0}, {13,12,14 ,7,5,7 ,0,0,0}, {15,14,16 ,8,7,8 ,0,0,0},
    {12,13,10 ,5,7,5 ,0,0,0}, {17,11,10 ,9,6,5 ,0,0,0}, {18,17,19 ,10,9,11 ,0,0,0},
    {17,18,11 ,9,10,6 ,0,0,0}, {20,21,22 ,12,13,12 ,0,0,0}, {23,24,25 ,14,14,15 ,0,0,0},
    {23,22,24 ,14,12,14 ,0,0,0}, {25,24,26 ,15,14,15 ,0,0,0}, {22,23,20 ,12,14,12 ,0,0,0},
    {27,21,20 ,13,13,12 ,0,0,0}, {28,27,29 ,16,13,16 ,0,0,0}, {27,28,21 ,13,16,13 ,0,0,0},
    {30,31,32 ,17,18,17 ,0,0,0}, {33,34,35 ,19,19,20 ,0,0,0}, {33,32,34 ,19,17,19 ,0,0,0},
    {35,34,36 ,20,19,20 ,0,0,0}, {32,33,30 ,17,19,17 ,0,0,0}, {37,31,30 ,18,18,17 ,0,0,0},
    {38,37,39 ,21,18,21 ,0,0,0}, {37,38,31 ,18,21,18 ,0,0,0}, {40,41,42 ,22,23,24 ,0,0,0},
    {43,44,45 ,25,26,27 ,0,0,0}, {46,40,42 ,28,22,24 ,0,0,0}, {45,44,46 ,27,26,28 ,0,0,0},
    {44,43,47 ,26,25,29 ,0,0,0}, {42,45,46 ,24,27,28 ,0,0,0}, {48,49,50 ,30,31,32 ,0,0,0},
    {49,51,50 ,31,33,32 ,0,0,0}, {47,52,48 ,29,34,30 ,0,0,0}, {49,48,52 ,31,30,34 ,0,0,0},
    {53,54,55 ,35,36,37 ,0,0,0}, {56,57,51 ,38,39,33 ,0,0,0}, {54,57,56 ,36,39,38 ,0,0,0},
    {54,56,55 ,36,38,37 ,0,0,0}, {55,58,53 ,37,40,35 ,0,0,0}, {50,51,57 ,32,33,39 ,0,0,0},
    {47,43,52 ,29,25,34 ,0,0,0}, {40,59,41 ,22,41,23 ,0,0,0}, {60,59,61 ,42,41,43 ,0,0,0},
    {59,60,41 ,41,42,23 ,0,0,0}, {62,63,61 ,44,45,43 ,0,0,0}, {60,61,63 ,42,43,45 ,0,0,0},
    {62,64,65 ,44,46,47 ,0,0,0}, {65,63,62 ,47,45,44 ,0,0,0}, {66,64,67 ,48,46,49 ,0,0,0},
    {64,66,65 ,46,48,47 ,0,0,0}, {68,69,67 ,50,51,49 ,0,0,0}, {66,67,69 ,48,49,51 ,0,0,0},
    {68,70,71 ,50,52,53 ,0,0,0}, {71,69,68 ,53,51,50 ,0,0,0}, {72,70,73 ,54,52,54 ,0,0,0},
    {70,72,71 ,52,54,53 ,0,0,0}, {74,75,76 ,22,55,24 ,0,0,0}, {77,78,79 ,56,57,58 ,0,0,0},
    {80,74,76 ,59,22,24 ,0,0,0}, {79,78,80 ,58,57,59 ,0,0,0}, {78,77,81 ,57,56,60 ,0,0,0},
    {76,79,80 ,24,58,59 ,0,0,0}, {82,83,84 ,61,62,63 ,0,0,0}, {83,85,84 ,62,64,63 ,0,0,0},
    {81,86,82 ,60,65,61 ,0,0,0}, {83,82,86 ,62,61,65 ,0,0,0}, {87,88,89 ,66,67,68 ,0,0,0},
    {90,91,85 ,69,70,64 ,0,0,0}, {88,91,90 ,67,70,69 ,0,0,0}, {88,90,89 ,67,69,68 ,0,0,0},
    {89,92,87 ,68,66,66 ,0,0,0}, {84,85,91 ,63,64,70 ,0,0,0}, {81,77,86 ,60,56,65 ,0,0,0},
    {74,93,75 ,22,71,55 ,0,0,0}, {94,93,95 ,72,71,43 ,0,0,0}, {93,94,75 ,71,72,55 ,0,0,0},
    {96,97,95 ,73,74,43 ,0,0,0}, {94,95,97 ,72,43,74 ,0,0,0}, {96,98,99 ,73,46,75 ,0,0,0},
    {99,97,96 ,75,74,73 ,0,0,0}, {100,98,101 ,76,46,77 ,0,0,0}, {98,100,99 ,46,76,75 ,0,0,0},
    {102,103,101 ,50,78,77 ,0,0,0}, {100,101,103 ,76,77,78 ,0,0,0},
    {102,104,105 ,50,79,80 ,0,0,0}, {105,103,102 ,80,78,50 ,0,0,0},
    {106,104,107 ,81,79,82 ,0,0,0}, {104,106,105 ,79,81,80 ,0,0,0},
    {108,109,110 ,83,84,85 ,0,0,0}, {111,112,113 ,86,87,88 ,0,0,0},
    {114,108,110 ,89,83,85 ,0,0,0}, {113,112,114 ,88,87,89 ,0,0,0},
    {112,111,115 ,87,86,90 ,0,0,0}, {110,113,114 ,85,88,89 ,0,0,0},
    {116,117,118 ,91,92,93 ,0,0,0}, {117,119,118 ,92,94,93 ,0,0,0},
    {115,120,116 ,90,95,91 ,0,0,0}, {117,116,120 ,92,91,95 ,0,0,0},
    {121,122,123 ,96,97,98 ,0,0,0}, {124,125,119 ,99,100,94 ,0,0,0},
    {122,125,124 ,97,100,99 ,0,0,0}, {122,124,123 ,97,99,98 ,0,0,0},
    {123,126,121 ,98,101,96 ,0,0,0}, {118,119,125 ,93,94,100 ,0,0,0},
    {115,111,120 ,90,86,95 ,0,0,0}, {108,127,109 ,83,102,84 ,0,0,0},
    {128,127,129 ,103,102,104 ,0,0,0}, {127,128,109 ,102,103,84 ,0,0,0},
    {130,131,129 ,105,106,104 ,0,0,0}, {128,129,131 ,103,104,106 ,0,0,0},
    {130,132,133 ,105,107,108 ,0,0,0}, {133,131,130 ,108,106,105 ,0,0,0},
    {134,132,135 ,109,107,110 ,0,0,0}, {132,134,133 ,107,109,108 ,0,0,0},
    {136,137,135 ,111,112,110 ,0,0,0}, {134,135,137 ,109,110,112 ,0,0,0},
    {136,138,139 ,111,113,114 ,0,0,0}, {139,137,136 ,114,112,111 ,0,0,0},
    {140,138,141 ,54,113,54 ,0,0,0}, {138,140,139 ,113,54,114 ,0,0,0},
    {142,143,144 ,83,115,85 ,0,0,0}, {145,146,147 ,116,117,118 ,0,0,0},
    {148,142,144 ,119,83,85 ,0,0,0}, {147,146,148 ,118,117,119 ,0,0,0},
    {146,145,149 ,117,116,120 ,0,0,0}, {144,147,148 ,85,118,119 ,0,0,0},
    {150,151,152 ,121,122,123 ,0,0,0}, {151,153,152 ,122,124,123 ,0,0,0},
    {149,154,150 ,120,125,121 ,0,0,0}, {151,150,154 ,122,121,125 ,0,0,0},
    {155,156,157 ,126,127,128 ,0,0,0}, {158,159,153 ,129,130,124 ,0,0,0},
    {156,159,158 ,127,130,129 ,0,0,0}, {156,158,157 ,127,129,128 ,0,0,0},
    {157,160,155 ,128,35,126 ,0,0,0}, {152,153,159 ,123,124,130 ,0,0,0},
    {149,145,154 ,120,116,125 ,0,0,0}, {142,161,143 ,83,131,115 ,0,0,0},
    {162,161,163 ,132,131,133 ,0,0,0}, {161,162,143 ,131,132,115 ,0,0,0},
    {164,165,163 ,134,74,133 ,0,0,0}, {162,163,165 ,132,133,74 ,0,0,0},
    {164,166,167 ,134,135,108 ,0,0,0}, {167,165,164 ,108,74,134 ,0,0,0},
    {168,166,169 ,136,135,137 ,0,0,0}, {166,168,167 ,135,136,108 ,0,0,0},
    {170,171,169 ,138,139,137 ,0,0,0}, {168,169,171 ,136,137,139 ,0,0,0},
    {170,172,173 ,138,79,80 ,0,0,0}, {173,171,170 ,80,139,138 ,0,0,0},
    {174,172,175 ,140,79,140 ,0,0,0}, {172,174,173 ,79,140,80 ,0,0,0},
    {176,177,178 ,141,142,143 ,0,0,0}, {179,180,181 ,144,145,146 ,0,0,0},
    {182,176,178 ,147,141,143 ,0,0,0}, {181,180,182 ,146,145,147 ,0,0,0},
    {180,179,183 ,145,144,148 ,0,0,0}, {178,181,182 ,143,146,147 ,0,0,0},
    {184,185,186 ,149,150,151 ,0,0,0}, {185,187,186 ,150,152,151 ,0,0,0},
    {183,188,184 ,148,153,149 ,0,0,0}, {185,184,188 ,150,149,153 ,0,0,0},
    {189,190,191 ,126,154,155 ,0,0,0}, {192,193,187 ,156,157,152 ,0,0,0},
    {190,193,192 ,154,157,156 ,0,0,0}, {190,192,191 ,154,156,155 ,0,0,0},
    {191,194,189 ,155,35,126 ,0,0,0}, {186,187,193 ,151,152,157 ,0,0,0},
    {183,179,188 ,148,144,153 ,0,0,0}, {176,195,177 ,141,158,142 ,0,0,0},
    {196,195,197 ,159,158,160 ,0,0,0}, {195,196,177 ,158,159,142 ,0,0,0},
    {198,199,197 ,161,162,160 ,0,0,0}, {196,197,199 ,159,160,162 ,0,0,0},
    {198,200,201 ,161,163,164 ,0,0,0}, {201,199,198 ,164,162,161 ,0,0,0},
    {202,200,203 ,165,163,166 ,0,0,0}, {200,202,201 ,163,165,164 ,0,0,0},
    {204,205,203 ,167,168,166 ,0,0,0}, {202,203,205 ,165,166,168 ,0,0,0},
    {204,206,207 ,167,169,170 ,0,0,0}, {207,205,204 ,170,168,167 ,0,0,0},
    {208,206,209 ,140,169,140 ,0,0,0}, {206,208,207 ,169,140,170 ,0,0,0},
    {210,211,212 ,171,172,173 ,0,0,0}, {213,214,215 ,174,175,176 ,0,0,0},
    {216,210,212 ,177,171,173 ,0,0,0}, {215,214,216 ,176,175,177 ,0,0,0},
    {214,213,217 ,175,174,178 ,0,0,0}, {212,215,216 ,173,176,177 ,0,0,0},
    {218,219,220 ,179,180,181 ,0,0,0}, {219,221,220 ,180,182,181 ,0,0,0},
    {217,222,218 ,178,183,179 ,0,0,0}, {219,218,222 ,180,179,183 ,0,0,0},
    {223,224,225 ,35,184,185 ,0,0,0}, {226,227,221 ,186,187,182 ,0,0,0},
    {224,227,226 ,184,187,186 ,0,0,0}, {224,226,225 ,184,186,185 ,0,0,0},
    {225,228,223 ,185,40,35 ,0,0,0}, {220,221,227 ,181,182,187 ,0,0,0},
    {217,213,222 ,178,174,183 ,0,0,0}, {210,229,211 ,171,188,172 ,0,0,0},
    {230,229,231 ,189,188,104 ,0,0,0}, {229,230,211 ,188,189,172 ,0,0,0},
    {232,233,231 ,190,45,104 ,0,0,0}, {230,231,233 ,189,104,45 ,0,0,0},
    {232,234,235 ,190,191,192 ,0,0,0}, {235,233,232 ,192,45,190 ,0,0,0},
    {236,234,237 ,193,191,194 ,0,0,0}, {234,236,235 ,191,193,192 ,0,0,0},
    {238,239,237 ,111,195,194 ,0,0,0}, {236,237,239 ,193,194,195 ,0,0,0},
    {238,240,241 ,111,52,53 ,0,0,0}, {241,239,238 ,53,195,111 ,0,0,0},
    {242,240,243 ,54,52,54 ,0,0,0}, {240,242,241 ,52,54,53 ,0,0,0},
    {244,245,246 ,196,197,197 ,0,0,0}, {247,248,249 ,198,196,198 ,0,0,0},
    {248,244,246 ,196,196,197 ,0,0,0}, {247,249,250 ,198,198,199 ,0,0,0},
    {251,252,253 ,200,82,200 ,0,0,0}, {250,249,254 ,199,198,199 ,0,0,0},
    {254,253,250 ,199,200,199 ,0,0,0}, {253,254,251 ,200,199,200 ,0,0,0},
    {252,251,255 ,82,200,201 ,0,0,0}, {248,247,244 ,196,198,196 ,0,0,0},
    {256,246,245 ,202,197,197 ,0,0,0}, {257,256,258 ,203,202,202 ,0,0,0},
    {245,258,256 ,197,202,202 ,0,0,0}, {259,260,257 ,203,204,203 ,0,0,0},
    {257,258,259 ,203,202,203 ,0,0,0}, {260,261,262 ,204,204,205 ,0,0,0},
    {261,260,259 ,204,204,203 ,0,0,0}, {261,263,262 ,204,205,205 ,0,0,0},
    {264,265,266 ,206,207,208 ,0,0,0}, {267,264,268 ,209,206,210 ,0,0,0},
    {264,267,265 ,206,209,207 ,0,0,0}, {269,270,268 ,211,212,210 ,0,0,0},
    {267,268,270 ,209,210,212 ,0,0,0}, {269,271,272 ,211,213,214 ,0,0,0},
    {272,270,269 ,214,212,211 ,0,0,0}, {273,271,274 ,215,213,216 ,0,0,0},
    {271,273,272 ,213,215,214 ,0,0,0}, {275,276,274 ,217,218,216 ,0,0,0},
    {273,274,276 ,215,216,218 ,0,0,0}, {275,277,278 ,217,219,220 ,0,0,0},
    {278,276,275 ,220,218,217 ,0,0,0}, {279,278,277 ,221,220,219 ,0,0,0},
    {279,280,278 ,221,221,220 ,0,0,0}, {264,266,281 ,206,208,222 ,0,0,0},
    {282,283,266 ,223,224,208 ,0,0,0}, {281,266,283 ,222,208,224 ,0,0,0},
    {282,284,285 ,223,225,226 ,0,0,0}, {285,283,282 ,226,224,223 ,0,0,0},
    {286,284,287 ,227,225,228 ,0,0,0}, {284,286,285 ,225,227,226 ,0,0,0},
    {288,289,287 ,229,230,228 ,0,0,0}, {286,287,289 ,227,228,230 ,0,0,0},
    {288,290,291 ,229,231,232 ,0,0,0}, {291,289,288 ,232,230,229 ,0,0,0},
    {292,290,293 ,233,231,234 ,0,0,0}, {290,292,291 ,231,233,232 ,0,0,0},
    {293,294,292 ,234,235,233 ,0,0,0}, {292,294,295 ,233,235,235 ,0,0,0},
    {296,297,298 ,236,237,238 ,0,0,0}, {299,300,296 ,239,240,236 ,0,0,0},
    {296,298,299 ,236,238,239 ,0,0,0}, {300,301,302 ,240,241,242 ,0,0,0},
    {301,300,299 ,241,240,239 ,0,0,0}, {303,302,304 ,243,242,244 ,0,0,0},
    {301,304,302 ,241,244,242 ,0,0,0}, {305,306,303 ,245,246,243 ,0,0,0},
    {303,304,305 ,243,244,245 ,0,0,0}, {307,306,305 ,247,246,245 ,0,0,0},
    {307,308,306 ,247,126,246 ,0,0,0}, {298,297,309 ,238,237,248 ,0,0,0},
    {309,310,311 ,248,249,250 ,0,0,0}, {310,309,297 ,249,248,237 ,0,0,0},
    {312,311,313 ,251,250,252 ,0,0,0}, {310,313,311 ,249,252,250 ,0,0,0},
    {314,315,312 ,253,254,251 ,0,0,0}, {312,313,314 ,251,252,253 ,0,0,0},
    {315,316,317 ,254,255,256 ,0,0,0}, {316,315,314 ,255,254,253 ,0,0,0},
    {316,318,317 ,255,257,256 ,0,0,0}, {317,318,319 ,256,257,257 ,0,0,0},
    {320,321,322 ,258,259,260 ,0,0,0}, {323,320,324 ,261,258,262 ,0,0,0},
    {320,323,321 ,258,261,259 ,0,0,0}, {325,326,324 ,263,264,262 ,0,0,0},
    {323,324,326 ,261,262,264 ,0,0,0}, {325,327,328 ,263,265,266 ,0,0,0},
    {328,326,325 ,266,264,263 ,0,0,0}, {329,327,330 ,267,265,268 ,0,0,0},
    {327,329,328 ,265,267,266 ,0,0,0}, {331,332,330 ,269,270,268 ,0,0,0},
    {329,330,332 ,267,268,270 ,0,0,0}, {331,333,334 ,269,271,272 ,0,0,0},
    {334,332,331 ,272,270,269 ,0,0,0}, {335,334,333 ,273,272,271 ,0,0,0},
    {335,336,334 ,273,273,272 ,0,0,0}, {320,322,337 ,258,260,274 ,0,0,0},
    {338,339,322 ,275,276,260 ,0,0,0}, {337,322,339 ,274,260,276 ,0,0,0},
    {338,340,341 ,275,277,278 ,0,0,0}, {341,339,338 ,278,276,275 ,0,0,0},
Loading
Loading full blame...