[3] | 1 | /* |
---|
| 2 | ----------------------------------------------------------------------------- |
---|
| 3 | This source file is part of OGRE |
---|
| 4 | (Object-oriented Graphics Rendering Engine) |
---|
| 5 | For the latest info, see http://www.ogre3d.org/ |
---|
| 6 | |
---|
| 7 | Copyright (c) 2000-2006 Torus Knot Software Ltd |
---|
| 8 | Also see acknowledgements in Readme.html |
---|
| 9 | |
---|
| 10 | You may use this sample code for anything you like, it is not covered by the |
---|
| 11 | LGPL like the rest of the engine. |
---|
| 12 | ----------------------------------------------------------------------------- |
---|
| 13 | */ |
---|
| 14 | #ifndef OWL_VOLUMERENDERABLE |
---|
| 15 | #define OWL_VOLUMERENDERABLE |
---|
| 16 | #include <OgrePrerequisites.h> |
---|
| 17 | #include <OgreSimpleRenderable.h> |
---|
| 18 | |
---|
| 19 | /** Direct Volume Rendering. |
---|
| 20 | TODO: LOD: reduce number of slices in distance |
---|
| 21 | TODO: option to generate normals for lighting |
---|
| 22 | @author W.J. van der Laan |
---|
| 23 | */ |
---|
| 24 | class VolumeRenderable: public Ogre::SimpleRenderable { |
---|
| 25 | public: |
---|
| 26 | VolumeRenderable(size_t nSlices, float size, const Ogre::String & texture); |
---|
| 27 | ~VolumeRenderable(); |
---|
| 28 | |
---|
| 29 | // Copydoc Ogre::SimpleRenderable::notifyCurrentCamera |
---|
| 30 | void _notifyCurrentCamera( Ogre::Camera* cam ); |
---|
| 31 | void getWorldTransforms( Ogre::Matrix4* xform ) const; |
---|
| 32 | |
---|
| 33 | /** |
---|
| 34 | * Retrieves ratios of the origin-centered bounding sphere for this |
---|
| 35 | * object. |
---|
| 36 | */ |
---|
| 37 | Ogre::Real getBoundingRadius() const; |
---|
| 38 | |
---|
| 39 | /** |
---|
| 40 | * Returns the camera-relative squared depth of this renderable. |
---|
| 41 | */ |
---|
| 42 | Ogre::Real getSquaredViewDepth(const Ogre::Camera*) const; |
---|
| 43 | protected: |
---|
| 44 | void initialise(); |
---|
| 45 | |
---|
| 46 | size_t mSlices; |
---|
| 47 | float mSize; |
---|
| 48 | float mRadius; |
---|
| 49 | Ogre::Matrix3 mFakeOrientation; |
---|
| 50 | Ogre::String mTexture; |
---|
| 51 | Ogre::TextureUnitState *mUnit; |
---|
| 52 | }; |
---|
| 53 | #endif |
---|