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 /* EighthDBaseSceneNode: 14 * Encapsulates information for rendering the eighth dimension 15 * of a base building. 16 */ 17 18 #ifndef BZF_EIGHTHD_BASE_SCENE_NODE_H 19 #define BZF_EIGHTHD_BASE_SCENE_NODE_H 20 21 // Inherit from 22 #include "EighthDimSceneNode.h" 23 24 class EighthDBaseSceneNode : public EighthDimSceneNode 25 { 26 public: 27 EighthDBaseSceneNode(const float pos[3], 28 const float size[3], float rotation); 29 ~EighthDBaseSceneNode(); 30 void notifyStyleChange(); 31 void addRenderNodes(SceneRenderer&); 32 protected: 33 class EighthDBaseRenderNode : public RenderNode 34 { 35 public: 36 EighthDBaseRenderNode(const EighthDBaseSceneNode *, 37 const float pos[3], 38 const float size[3], float rotation); 39 ~EighthDBaseRenderNode(); 40 void render(); getPosition()41 const GLfloat * getPosition() const 42 { 43 return sceneNode->getSphere(); 44 } 45 private: 46 const EighthDBaseSceneNode *sceneNode; 47 GLfloat corner[8][3]; 48 }; 49 private: 50 OpenGLGState gstate; 51 EighthDBaseRenderNode renderNode; 52 }; 53 54 #endif // BZF_EIGHTHD_BASE_SCENE_NODE_H 55 56 // Local Variables: *** 57 // mode: C++ *** 58 // tab-width: 4 *** 59 // c-basic-offset: 4 *** 60 // indent-tabs-mode: nil *** 61 // End: *** 62 // ex: shiftwidth=4 tabstop=4 63