2001-11-27 18:50:04 -07:00
|
|
|
// galaxy.h
|
|
|
|
//
|
|
|
|
// Copyright (C) 2001, Chris Laurel <claurel@shatters.net>
|
|
|
|
//
|
|
|
|
// This program 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 2
|
|
|
|
// of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
#ifndef _GALAXY_H_
|
|
|
|
#define _GALAXY_H_
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
#include <iostream>
|
|
|
|
#include <celmath/vecmath.h>
|
|
|
|
#include <celmath/quaternion.h>
|
2003-01-28 22:47:50 -07:00
|
|
|
#include <celengine/deepskyobj.h>
|
2001-11-27 18:50:04 -07:00
|
|
|
|
|
|
|
|
2005-07-13 03:29:51 -06:00
|
|
|
struct Blob
|
|
|
|
{
|
|
|
|
Point3f position;
|
2006-09-16 12:25:32 -06:00
|
|
|
unsigned int colorIndex;
|
2005-07-13 03:29:51 -06:00
|
|
|
float brightness;
|
2006-09-16 12:25:32 -06:00
|
|
|
};
|
2005-07-13 03:29:51 -06:00
|
|
|
|
2001-11-27 18:50:04 -07:00
|
|
|
struct GalacticForm
|
|
|
|
{
|
2005-07-13 03:29:51 -06:00
|
|
|
std::vector<Blob>* blobs;
|
2001-11-27 18:50:04 -07:00
|
|
|
Vec3f scale;
|
|
|
|
};
|
|
|
|
|
2003-01-28 22:47:50 -07:00
|
|
|
class Galaxy : public DeepSkyObject
|
2001-11-27 18:50:04 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
Galaxy();
|
2005-11-18 02:00:39 -07:00
|
|
|
virtual const char* getType() const;
|
|
|
|
virtual void setType(const std::string&);
|
2005-11-21 03:22:52 -07:00
|
|
|
virtual size_t getDescription(char* buf, size_t bufLength) const;
|
2006-09-16 12:25:32 -06:00
|
|
|
virtual std::string getCustomTmpName() const;
|
2006-09-11 15:46:07 -06:00
|
|
|
virtual void setCustomTmpName(const std::string&);
|
2005-11-18 02:00:39 -07:00
|
|
|
|
2001-11-27 18:50:04 -07:00
|
|
|
float getDetail() const;
|
|
|
|
void setDetail(float);
|
2003-01-28 22:47:50 -07:00
|
|
|
// float getBrightness() const;
|
|
|
|
// void setBrightness();
|
|
|
|
|
2003-03-24 01:55:54 -07:00
|
|
|
virtual bool load(AssociativeArray*, const std::string&);
|
2005-07-13 03:29:51 -06:00
|
|
|
virtual void render(const GLContext& context,
|
|
|
|
const Vec3f& offset,
|
2003-01-28 22:47:50 -07:00
|
|
|
const Quatf& viewerOrientation,
|
|
|
|
float brightness,
|
|
|
|
float pixelSize);
|
2005-07-13 03:29:51 -06:00
|
|
|
virtual void renderGalaxyPointSprites(const GLContext& context,
|
|
|
|
const Vec3f& offset,
|
|
|
|
const Quatf& viewerOrientation,
|
|
|
|
float brightness,
|
|
|
|
float pixelSize);
|
|
|
|
virtual void renderGalaxyEllipsoid(const GLContext& context,
|
|
|
|
const Vec3f& offset,
|
|
|
|
const Quatf& viewerOrientation,
|
|
|
|
float brightness,
|
|
|
|
float pixelSize);
|
|
|
|
|
|
|
|
GalacticForm* getForm() const;
|
|
|
|
|
|
|
|
static void increaseLightGain();
|
|
|
|
static void decreaseLightGain();
|
|
|
|
static float getLightGain();
|
2005-12-04 23:42:43 -07:00
|
|
|
static void setLightGain(float);
|
2005-11-18 02:00:39 -07:00
|
|
|
static void hsv2rgb( float *r, float *g, float *b, float h, float s, float v );
|
2001-11-27 18:50:04 -07:00
|
|
|
|
2005-11-18 02:00:39 -07:00
|
|
|
virtual unsigned int getRenderMask() const;
|
|
|
|
virtual unsigned int getLabelMask() const;
|
|
|
|
|
|
|
|
public:
|
|
|
|
enum GalaxyType {
|
|
|
|
S0 = 0,
|
|
|
|
Sa = 1,
|
|
|
|
Sb = 2,
|
|
|
|
Sc = 3,
|
|
|
|
SBa = 4,
|
|
|
|
SBb = 5,
|
|
|
|
SBc = 6,
|
|
|
|
E0 = 7,
|
|
|
|
E1 = 8,
|
|
|
|
E2 = 9,
|
|
|
|
E3 = 10,
|
2006-09-16 12:25:32 -06:00
|
|
|
E4 = 11,
|
2005-11-18 02:00:39 -07:00
|
|
|
E5 = 12,
|
|
|
|
E6 = 13,
|
|
|
|
E7 = 14,
|
|
|
|
Irr = 15
|
|
|
|
};
|
2006-09-16 12:25:32 -06:00
|
|
|
|
|
|
|
private:
|
2001-11-27 18:50:04 -07:00
|
|
|
float detail;
|
2006-09-16 12:25:32 -06:00
|
|
|
std::string* customTmpName;
|
2003-01-28 22:47:50 -07:00
|
|
|
// float brightness;
|
2001-11-27 18:50:04 -07:00
|
|
|
GalaxyType type;
|
|
|
|
GalacticForm* form;
|
2005-11-18 02:00:39 -07:00
|
|
|
|
|
|
|
static float lightGain;
|
2001-11-27 18:50:04 -07:00
|
|
|
};
|
|
|
|
|
2005-11-18 02:00:39 -07:00
|
|
|
//std::ostream& operator<<(std::ostream& s, const Galaxy::GalaxyType& sc);
|
2001-11-27 18:50:04 -07:00
|
|
|
|
|
|
|
#endif // _GALAXY_H_
|