Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/shadows/src/shadow.h @ 3715

Last change on this file since 3715 was 3706, checked in by dave, 20 years ago

branches/shadows: Ok, das Abbild vom Raumschiff funktioniert schon mal, sieht recht cool aus:)

File size: 1.6 KB
Line 
1/*!
2    \file shadow.h
3    \brief Definition of the Shadow
4   
5    Shadow should in a first step only be implemented for the players character
6    to be casted on the terrain. This version will only handle the players shjadow!
7    Further versions will propably be able to take parameters like player or non
8    player character and the final object to cast the shadow on to....So it will then
9    be possible(maybe) for an object to cast its shadow onto another object(but I think
10    that will be too much performance eating:)
11   
12    The basic principle to implement the shadow is to create a texture containing
13    a picture of the shadow. This texture then will be mixed onto the normal ground
14    texture to give the impression of a shadow correctly casted on the ground.
15*/
16
17#ifndef _SHADOW_H
18#define _SHADOW_H
19
20#include "importer/material.h"
21#include "importer/objModel.h"
22#include "p_node.h"
23#include "world_entity.h"
24#include "player.h"
25
26//! A Class to handle the Shadow
27class Shadow: public PNode
28{
29    private:
30        int player_id,ground_id; //These are for the glLists!
31        int shadow_id;  //this is for the empty shadow texture
32        float lightPos[3];
33        float playerPos[3];
34
35       
36        unsigned char *image;
37        OBJModel* player;
38        //playerangle used to obtain information about the angle of the player
39        Player* playerangle;
40       
41        void blur(unsigned char *in,int size);
42        void createShadow();
43        void m_inverse(const float *m,float *out);
44       
45   
46    public:
47        Shadow(OBJModel* player,Player* playerangle,float groundVertexes[]);
48        ~Shadow();
49        void init();
50        void draw();
51        void updatePosition(float x,float y,float z);
52
53
54
55
56};
57
58#endif
59   
60
Note: See TracBrowser for help on using the repository browser.