| 1 | /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield |
|---|
| 2 | * |
|---|
| 3 | * This library is open source and may be redistributed and/or modified under |
|---|
| 4 | * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or |
|---|
| 5 | * (at your option) any later version. The full license is in LICENSE file |
|---|
| 6 | * included with this distribution, and on the openscenegraph.org website. |
|---|
| 7 | * |
|---|
| 8 | * This library is distributed in the hope that it will be useful, |
|---|
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 11 | * OpenSceneGraph Public License for more details. |
|---|
| 12 | */ |
|---|
| 13 | |
|---|
| 14 | #ifndef OSGSIM_OBJECTRECORDDATA |
|---|
| 15 | #define OSGSIM_OBJECTRECORDDATA 1 |
|---|
| 16 | |
|---|
| 17 | #include <osg/Object> |
|---|
| 18 | |
|---|
| 19 | #include <ostream> |
|---|
| 20 | |
|---|
| 21 | namespace osgSim { |
|---|
| 22 | |
|---|
| 23 | /** When the OpenFlight importer encounters an Object record, it stores |
|---|
| 24 | the data in one of these classes, and attaches the instance of the |
|---|
| 25 | class as UserData to the corresponding osgLLGroup node. |
|---|
| 26 | */ |
|---|
| 27 | |
|---|
| 28 | class ObjectRecordData : public osg::Object |
|---|
| 29 | { |
|---|
| 30 | public: |
|---|
| 31 | |
|---|
| 32 | ObjectRecordData() |
|---|
| 33 | : _flags( 0 ), |
|---|
| 34 | _relativePriority( 0 ), |
|---|
| 35 | _transparency( 0 ), |
|---|
| 36 | _effectID1( 0 ), |
|---|
| 37 | _effectID2( 0 ), |
|---|
| 38 | |
|---|
| 39 | _significance( 0 ) |
|---|
| 40 | {} |
|---|
| 41 | |
|---|
| 42 | ObjectRecordData( const ObjectRecordData& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY ): |
|---|
| 43 | osg::Object(copy, copyop) |
|---|
| 44 | { |
|---|
| 45 | _flags = copy._flags; |
|---|
| 46 | _relativePriority = copy._relativePriority; |
|---|
| 47 | _transparency = copy._transparency; |
|---|
| 48 | _effectID1 = copy._effectID1; |
|---|
| 49 | _effectID2 = copy._effectID2; |
|---|
| 50 | _significance = copy._significance; |
|---|
| 51 | } |
|---|
| 52 | |
|---|
| 53 | META_Object( osgSim, ObjectRecordData ); |
|---|
| 54 | |
|---|
| 55 | enum Flags |
|---|
| 56 | { |
|---|
| 57 | DONT_DISPLAY_IN_DAYLIGHT = 0x80000000u >> 0, |
|---|
| 58 | DONT_DISPLAY_AT_DUSK = 0x80000000u >> 1, |
|---|
| 59 | DONT_DISPLAY_AT_NIGHT = 0x80000000u >> 2, |
|---|
| 60 | DONT_ILLUMINATE = 0x80000000u >> 3, |
|---|
| 61 | FLAT_SHADED = 0x80000000u >> 4, |
|---|
| 62 | GROUPS_SHADOW_OBJECT = 0x80000000u >> 5 |
|---|
| 63 | }; |
|---|
| 64 | |
|---|
| 65 | unsigned int _flags; |
|---|
| 66 | short _relativePriority; |
|---|
| 67 | unsigned short _transparency; // 0=opaque, 65535=totally clear |
|---|
| 68 | short _effectID1; |
|---|
| 69 | short _effectID2; |
|---|
| 70 | short _significance; |
|---|
| 71 | |
|---|
| 72 | }; // end of class ObjectRecordData |
|---|
| 73 | |
|---|
| 74 | } // end of namespace osgSim |
|---|
| 75 | |
|---|
| 76 | #endif |
|---|