|
Last change
on this file since 3614 was
3614,
checked in by patrick, 21 years ago
|
|
orxonox/trunk: enhanced primitives, now more properties to set
|
|
File size:
857 bytes
|
| Line | |
|---|
| 1 | #ifndef _PRIMITIVE_H |
|---|
| 2 | #define _PRIMITIVE_H |
|---|
| 3 | |
|---|
| 4 | #include "world_entity.h" |
|---|
| 5 | #include "glincl.h" |
|---|
| 6 | |
|---|
| 7 | typedef enum pForm {P_SPHERE = 0, P_CUBE, P_CYLINDER, P_DISK}; |
|---|
| 8 | |
|---|
| 9 | class Material; |
|---|
| 10 | |
|---|
| 11 | class Primitive : public WorldEntity |
|---|
| 12 | { |
|---|
| 13 | friend class World; |
|---|
| 14 | |
|---|
| 15 | public: |
|---|
| 16 | Primitive (pForm form); |
|---|
| 17 | virtual ~Primitive (); |
|---|
| 18 | |
|---|
| 19 | void setForm(pForm form); |
|---|
| 20 | void setSize(float size); |
|---|
| 21 | void setMaterial(Material* material); |
|---|
| 22 | void setTexture(char* name); |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | virtual void tick (float time); |
|---|
| 26 | virtual void hit (WorldEntity* weapon, Vector* loc); |
|---|
| 27 | virtual void collide (WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags); |
|---|
| 28 | virtual void draw (); |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | private: |
|---|
| 33 | GLUquadricObj* object; //!< the object to be rendered |
|---|
| 34 | Material* material; //!< A Material for the SkySphere. |
|---|
| 35 | pForm form; |
|---|
| 36 | char* textureName; |
|---|
| 37 | float size; |
|---|
| 38 | |
|---|
| 39 | void glDrawCube(); |
|---|
| 40 | }; |
|---|
| 41 | |
|---|
| 42 | #endif /* _PRIMITIVE_H */ |
|---|
Note: See
TracBrowser
for help on using the repository browser.