1 /* bzflag 2 * Copyright (c) 1993-2021 Tim Riker 3 * 4 * This package is free software; you can redistribute it and/or 5 * modify it under the terms of the license found in the file 6 * named COPYING that should have accompanied this file. 7 * 8 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 9 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 10 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 11 */ 12 13 /* EighthDimSceneNode: 14 * Encapsulates information for rendering the eighth dimension 15 */ 16 17 #ifndef BZF_EIGHTH_DIM_SCENE_NODE_H 18 #define BZF_EIGHTH_DIM_SCENE_NODE_H 19 20 // Inherits from 21 #include "SceneNode.h" 22 23 class EighthDimSceneNode : public SceneNode 24 { 25 public: 26 ~EighthDimSceneNode(); 27 28 bool cull(const ViewFrustum&) const; 29 void notifyStyleChange(); 30 void addRenderNodes(SceneRenderer&); 31 32 protected: 33 EighthDimSceneNode(int numPolys); 34 35 void setPolygon(int index, const GLfloat[3][3]); 36 37 protected: 38 class EighthDimRenderNode : public RenderNode 39 { 40 public: 41 EighthDimRenderNode( 42 const EighthDimSceneNode*, 43 int numPolygons); 44 ~EighthDimRenderNode(); 45 void render(); 46 void setPolygon(int index, const GLfloat[3][3]); getPosition()47 const GLfloat* getPosition() const 48 { 49 return sceneNode->getSphere(); 50 } 51 private: 52 const EighthDimSceneNode* sceneNode; 53 int numPolygons; 54 GLfloat (*color)[4]; 55 GLfloat (*poly)[3][3]; 56 }; 57 58 private: 59 OpenGLGState gstate; 60 EighthDimRenderNode renderNode; 61 }; 62 63 #endif // BZF_EIGHTH_DIM_SCENE_NODE_H 64 65 // Local Variables: *** 66 // mode: C++ *** 67 // tab-width: 4 *** 68 // c-basic-offset: 4 *** 69 // indent-tabs-mode: nil *** 70 // End: *** 71 // ex: shiftwidth=4 tabstop=4 72