Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/world_entities/primitive.h @ 3659

Last change on this file since 3659 was 3618, checked in by patrick, 20 years ago

orxonox/trunk: adding TestGun to implement a test gun :) some smaller changes in ghe weapon.h interface. some doxytags for primitive

File size: 1.2 KB
Line 
1/*!
2    \primitive.h
3    \brief representing a primitive body in the world: cube, sphere, cylinder  etc...
4*/
5
6
7#ifndef _PRIMITIVE_H
8#define _PRIMITIVE_H
9
10#include "world_entity.h"
11#include "glincl.h"
12
13typedef enum pForm {P_SPHERE = 0, P_CUBE, P_CYLINDER, P_DISK};
14
15class Material;
16
17class Primitive : public WorldEntity
18{
19  friend class World;
20
21 public:
22  Primitive (pForm form);
23  virtual ~Primitive ();
24
25  void setForm(pForm form);
26  void setSize(float size);
27  void setSegments(int segments);
28  void setMaterial(Material* material);
29  void setTexture(char* name);
30 
31
32  virtual void tick (float time);
33  virtual void hit (WorldEntity* weapon, Vector* loc);
34  virtual void collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags);
35  virtual void draw ();
36
37
38
39 private:
40  GLUquadricObj* object; //!< the object to be rendered
41  Material* material;    //!< A Material for the SkySphere.
42  pForm form;            //!< the chooesen form for the entity
43  char* textureName;     //!< if there is a texture. this is the name for it
44  float size;            //!< size of the object, from [0..1]
45  int segments;          //!< segment count
46
47  void glDrawCube();
48};
49
50#endif /* _PRIMITIVE_H */
Note: See TracBrowser for help on using the repository browser.