~robot3d-team/robot3d/trunk

« back to all changes in this revision

Viewing changes to inc/srCore/sensor/cameraSensor.h

  • Committer: Anne van Rossum
  • Date: 2010-08-10 15:58:55 UTC
  • Revision ID: anne@gamix-20100810155855-kve7x2vwouagdij9
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//! Camera sensor class.
 
2
 
 
3
/*!
 
4
 *
 
5
 * Describes general camera properties.
 
6
 *
 
7
 * @author Lutz Winkler
 
8
 *
 
9
 */
 
10
 
 
11
#ifndef CAMERASENSOR_H_
 
12
#define CAMERASENSOR_H_
 
13
 
 
14
#include <srCore/body/bodyBase.h>
 
15
#include <srCore/sensor/cameraSensorBase.h>
 
16
 
 
17
namespace srCore {
 
18
 
 
19
class CameraSensor: public CameraSensorBase
 
20
{
 
21
public:
 
22
 
 
23
        /**
 
24
         * \brief  Initializes the sensor
 
25
         *
 
26
         * \param                       gm                                                      GameManager, which handles the corresponding robot
 
27
         * \param                       attachedTo                                      Body, where the camera is attached to
 
28
         * \param               pos                                                     Local position of the camera
 
29
         * \param                       orient                                          Local orientation of the camera
 
30
         * \param                       flareAngle                                      flare angle of the camera
 
31
         * \param                       resolution                                      resolution of the camera
 
32
         * \param                       name                                            name of the camera
 
33
         *
 
34
         *
 
35
         */
 
36
        CameraSensor(dtCore::RefPtr<BodyBase> attachedTo, osg::Vec3 pos, osg::Vec3 orient, float flareAngle = 1, osg::Vec2 resolution = osg::Vec2(256,256), const std::string &name="CameraSensor");
 
37
        virtual ~CameraSensor() { printf("camera destructor \n"); value = NULL; };
 
38
 
 
39
        //! sends command to retrieve data
 
40
        void evaluate(ParameterReturnValue srv);
 
41
 
 
42
        inline void getNewSensorValue() {requestData();}
 
43
 
 
44
private:
 
45
        osg::ref_ptr<osg::Image> value;
 
46
        //osg::Image* value;
 
47
protected:
 
48
        inline void getSensorValue(std::ostream& theStream) const { theStream << value;}
 
49
 
 
50
};
 
51
}
 
52
 
 
53
#endif /*CAMERASENSOR_H_*/