Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/ogre_src_v1-9-0/OgreMain/include/OgrePatchMesh.h @ 148

Last change on this file since 148 was 148, checked in by patricwi, 6 years ago

Added new dependencies for ogre1.9 and cegui0.8

File size: 3.4 KB
Line 
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4    (Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2013 Torus Knot Software Ltd
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25THE SOFTWARE.
26-----------------------------------------------------------------------------
27*/
28#ifndef __PatchMesh_H__
29#define __PatchMesh_H__
30
31#include "OgrePrerequisites.h"
32#include "OgreMesh.h"
33#include "OgrePatchSurface.h"
34
35namespace Ogre {
36
37        /** \addtogroup Core
38        *  @{
39        */
40        /** \addtogroup LOD
41        *  @{
42        */
43        /** Patch specialisation of Mesh.
44    @remarks
45        Instances of this class should be created by calling MeshManager::createBezierPatch.
46    */
47    class _OgreExport PatchMesh : public Mesh
48    {
49    protected:
50        /// Internal surface definition
51        PatchSurface mSurface;
52        /// Vertex declaration, cloned from the input
53        VertexDeclaration* mDeclaration;
54    public:
55        /// Constructor
56        PatchMesh(ResourceManager* creator, const String& name, ResourceHandle handle,
57            const String& group);
58        /// Update the mesh with new control points positions.
59                void update(void* controlPointBuffer, size_t width, size_t height, 
60                    size_t uMaxSubdivisionLevel, size_t vMaxSubdivisionLevel, 
61                    PatchSurface::VisibleSide visibleSide);
62        /// Define the patch, as defined in MeshManager::createBezierPatch
63        void define(void* controlPointBuffer, 
64            VertexDeclaration *declaration, size_t width, size_t height,
65            size_t uMaxSubdivisionLevel = PatchSurface::AUTO_LEVEL, 
66            size_t vMaxSubdivisionLevel = PatchSurface::AUTO_LEVEL,
67            PatchSurface::VisibleSide visibleSide = PatchSurface::VS_FRONT,
68            HardwareBuffer::Usage vbUsage = HardwareBuffer::HBU_STATIC_WRITE_ONLY, 
69            HardwareBuffer::Usage ibUsage = HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY,
70            bool vbUseShadow = false, bool ibUseShadow = false);
71
72        /* Sets the current subdivision level as a proportion of full detail.
73        @param factor Subdivision factor as a value from 0 (control points only) to 1 (maximum
74            subdivision). */
75        void setSubdivision(Real factor);
76    protected:
77        /// Overridden from Resource
78        void loadImpl(void);
79                /// Overridden from Resource - do nothing (no disk caching)
80                void prepareImpl(void) {}
81
82    };
83        /** @} */
84        /** @} */
85
86}
87
88#endif
Note: See TracBrowser for help on using the repository browser.