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