root/OpenSceneGraph/trunk/src/osgPlugins/flt/AttrData.h @ 3527

Revision 3527, 2.6 kB (checked in by robert, 9 years ago)

From Fred Mammond, fixes for x86_64 build

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1#ifndef __ATTR_DATA_H
2#define __ATTR_DATA_H
3
4#if defined(_MSC_VER)
5#pragma warning( disable : 4786 )
6#endif
7
8#include <osg/StateSet>
9#include <osg/Referenced>
10
11// Detail Texture as defined in Creator v2.5.1 got lot's of parameters that I don't know
12// how they work, so I have implemented only the things I need, and if someone needs
13// something else it's posible to use other parameters using the new flt::AttrData class
14// Now the implemented parameters are:
15//        - txDetail_m, txDetail_n : Control how new texcoord will be generated.
16//        - modulateDetail         : If set to true, be use scale_rgb and scale_alpha values from
17//                                 osg::TexEnvCombine to make a lighted image.
18//
19// I implement detail texture as a new TexEnvCombine attribute in texture unit 1
20// that is added to the stateset of the geometry.
21//
22// flt::AttrData class is used to store Texture Attribute Data as defined in Creator
23// so we can pass this info to others loader object an use it where needed.
24//
25// Julian Ortiz, June 18th 2003.
26
27namespace flt {
28
29 typedef signed int     int32; 
30
31 class AttrData : public osg::Object {
32  public:
33    osg::StateSet *stateset;
34
35    int32   useDetail;              // TRUE if using next 5 integers for detail texture
36    int32   txDetail_j;             // J argument for TX_DETAIL
37    int32   txDetail_k;             // K argument for TX_DETAIL
38    int32   txDetail_m;             // M argument for TX_DETAIL
39    int32   txDetail_n;             // N argument for TX_DETAIL
40    int32   txDetail_s;             // Scramble argument for TX_DETAIL
41    bool    modulateDetail;            // True if Magnification filter type is MODULATE_DETAIL
42   
43    AttrData() :
44        stateset(0),
45        useDetail(0),
46        txDetail_j(0),
47        txDetail_k(0),
48        txDetail_m(0),
49        txDetail_n(0),
50        txDetail_s(0),
51        modulateDetail(false) {}
52
53
54    AttrData(const AttrData& attr,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
55        osg::Object(attr,copyop),       
56        stateset(attr.stateset),
57        useDetail(attr.useDetail),
58        txDetail_j(attr.txDetail_j),
59        txDetail_k(attr.txDetail_k),
60        txDetail_m(attr.txDetail_m),
61        txDetail_n(attr.txDetail_n),
62        txDetail_s(attr.txDetail_s),
63        modulateDetail(attr.modulateDetail) {}
64
65    virtual osg::Object* cloneType() const { return new AttrData(); }
66    virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new AttrData(*this,copyop); }   
67    virtual const char* libraryName() const { return "osg"; }
68    virtual const char* className() const { return "AttrData"; }
69 };
70}
71
72#endif // __ATTR_DATA_H
Note: See TracBrowser for help on using the browser.