Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/world_entities/skybox.h @ 7485

Last change on this file since 7485 was 7328, checked in by bensch, 19 years ago

orxonox/trunk: sky is ok again

File size: 2.2 KB
RevLine 
[4597]1/*!
[5039]2 * @file skybox.h
[5357]3 *  Definition of the SkyBox, that handles the Display of an atmosphere for orxonox.
4 *
5 * A SkyBox is always centered at the current working Camera, and will only obey the cameras
6 * movment but not its rotation.
[3416]7*/
8
[3796]9#ifndef _SKYBOX_H
10#define _SKYBOX_H
[3416]11
[3419]12/* INCLUDES */
[3502]13#include "world_entity.h"
[6771]14#include "material.h"
[3411]15
[6771]16enum SKY_SIDE
17{
[7328]18  SKY_BACK = 0,
19  SKY_FRONT,
[6771]20  SKY_BOTTOM,
[7328]21  SKY_TOP,
[6771]22  SKY_LEFT,
23  SKY_RIGHT,
24};
[3419]25
[3807]26//! A Class to handle a SkyBox
[3796]27class SkyBox : public WorldEntity
[3411]28{
[3416]29 public:
[7221]30  SkyBox(const std::string& fileName = "");
[4261]31  SkyBox(const TiXmlElement* root);
[4010]32
[3796]33  virtual ~SkyBox();
[3419]34
[5357]35  void init();
[4746]36  void preInit();
[4680]37
[6512]38  virtual void loadParams(const TiXmlElement* root);
[4261]39
[4746]40  void postInit();
[4010]41
[6634]42  virtual void draw();
[4012]43
[3796]44  void setSize(float size);
[4998]45  /** assumes jpg as input-format */
[7221]46  void setTexture(const std::string& name);
[4680]47
[7221]48  void setTextureAndType(const std::string& name, const std::string& extension);
[7328]49  void setTextures(const std::string& negX, const std::string& posX, const std::string& negY,
50                   const std::string& posY, const std::string& negZ, const std::string& posZ);
[3420]51
[7328]52  void loadCubeMapTextures(const std::string& negX, const std::string& posX, const std::string& negY,
53                           const std::string& posY, const std::string& negZ, const std::string& posZ);
[6470]54
[6771]55  GLuint getTexture(SKY_SIDE side) const { return (this->material[side]) ? this->material[side]->getDiffuseTexture(): 0; };
56
[6470]57  static void enableCubeMap();
58  static void disableCubeMap();
59
[6341]60  virtual int       writeBytes(const byte* data, int length, int sender);
61  virtual int       readBytes(byte* data, int maxLength, int * reciever);
62  virtual void      writeDebug() const;
63  virtual void      readDebug() const;
64
[3801]65 private:
66  void rebuild();
67
[6307]68  Material*       material[6];     //!< Materials for the SkyBox. sorted by number (0-5) top, bottom, left, right, front, back
[6519]69  Texture*        cubeTexture[6];  //!< Textures for the CubeMap.
[6470]70
[4597]71  float           size;            //!< Size of the SkyBox. This should match the frustum maximum range.
[6634]72  float           textureSize;     //!< this is the length of a texture (assumes a square texture)
[7221]73  std::string     textureName;     //!< Name of the Texture
[4597]74
[3411]75};
76
[3796]77#endif  /* _SKYBOX_H */
[3411]78
79
[3484]80
Note: See TracBrowser for help on using the repository browser.