00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef FISHEYEMAKER_H
00016 #define FISHEYEMAKER_H
00017
00018 #include "pandabase.h"
00019
00020 #include "pandaNode.h"
00021 #include "pointerTo.h"
00022 #include "namable.h"
00023
00024 class GeomVertexWriter;
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 class EXPCL_PANDA_GRUTIL FisheyeMaker : public Namable {
00040 PUBLISHED:
00041 INLINE FisheyeMaker(const string &name);
00042 INLINE ~FisheyeMaker();
00043
00044 void reset();
00045 void set_fov(PN_stdfloat fov);
00046 INLINE void set_num_vertices(int num_vertices);
00047 INLINE void set_square_inscribed(bool square_inscribed, PN_stdfloat square_radius);
00048 INLINE void set_reflection(bool reflection);
00049
00050 PT(PandaNode) generate();
00051
00052 private:
00053 void add_vertex(GeomVertexWriter &vertex, GeomVertexWriter &texcoord,
00054 PN_stdfloat r, PN_stdfloat a);
00055
00056 void add_square_vertex(GeomVertexWriter &vertex, GeomVertexWriter &texcoord,
00057 PN_stdfloat a);
00058
00059 PN_stdfloat _fov;
00060 PN_stdfloat _half_fov_rad;
00061 int _num_vertices;
00062 bool _square_inscribed;
00063 PN_stdfloat _square_radius;
00064 PN_stdfloat _reflect;
00065 };
00066
00067 #include "fisheyeMaker.I"
00068
00069 #endif
00070