ruby-procedural 0.0.1-x86-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +4 -0
- data/README.md +29 -0
- data/Rakefile +65 -0
- data/bindings/procedural/interface/ProceduralBoxGenerator.i +12 -0
- data/bindings/procedural/interface/ProceduralCapsuleGenerator.i +12 -0
- data/bindings/procedural/interface/ProceduralConeGenerator.i +12 -0
- data/bindings/procedural/interface/ProceduralCylinderGenerator.i +12 -0
- data/bindings/procedural/interface/ProceduralExtruder.i +8 -0
- data/bindings/procedural/interface/ProceduralGeometryHelpers.i +15 -0
- data/bindings/procedural/interface/ProceduralHeader.i +8 -0
- data/bindings/procedural/interface/ProceduralIcoSphereGenerator.i +12 -0
- data/bindings/procedural/interface/ProceduralLathe.i +8 -0
- data/bindings/procedural/interface/ProceduralMeshGenerator.i +9 -0
- data/bindings/procedural/interface/ProceduralMultiShape.i +8 -0
- data/bindings/procedural/interface/ProceduralPath.i +8 -0
- data/bindings/procedural/interface/ProceduralPathGenerators.i +10 -0
- data/bindings/procedural/interface/ProceduralPlaneGenerator.i +12 -0
- data/bindings/procedural/interface/ProceduralPlatform.i +8 -0
- data/bindings/procedural/interface/ProceduralRoot.i +23 -0
- data/bindings/procedural/interface/ProceduralRoundedBoxGenerator.i +12 -0
- data/bindings/procedural/interface/ProceduralShape.i +8 -0
- data/bindings/procedural/interface/ProceduralShapeGenerators.i +10 -0
- data/bindings/procedural/interface/ProceduralSphereGenerator.i +11 -0
- data/bindings/procedural/interface/ProceduralSplines.i +8 -0
- data/bindings/procedural/interface/ProceduralStableHeaders.i +8 -0
- data/bindings/procedural/interface/ProceduralTorusGenerator.i +12 -0
- data/bindings/procedural/interface/ProceduralTorusKnotGenerator.i +12 -0
- data/bindings/procedural/interface/ProceduralTrack.i +8 -0
- data/bindings/procedural/interface/ProceduralTriangleBuffer.i +13 -0
- data/bindings/procedural/interface/ProceduralTriangulator.i +8 -0
- data/bindings/procedural/interface/ProceduralTubeGenerator.i +12 -0
- data/bindings/procedural/interface/ProceduralUtils.i +8 -0
- data/bindings/procedural/interface/Rakefile +22 -0
- data/bindings/procedural/interface/procedural.i +41 -0
- data/bindings/procedural/interface/procedural_wrap.cpp +36079 -0
- data/bindings/procedural/interface/procedural_wrap.h +19 -0
- data/bindings/procedural/interface/procedural_wrap.o +0 -0
- data/deps/include/OgreProcedural/Procedural.h +54 -0
- data/deps/include/OgreProcedural/ProceduralBoxGenerator.h +110 -0
- data/deps/include/OgreProcedural/ProceduralCapsuleGenerator.h +103 -0
- data/deps/include/OgreProcedural/ProceduralConeGenerator.h +90 -0
- data/deps/include/OgreProcedural/ProceduralCylinderGenerator.h +99 -0
- data/deps/include/OgreProcedural/ProceduralExtruder.h +131 -0
- data/deps/include/OgreProcedural/ProceduralGeometryHelpers.h +171 -0
- data/deps/include/OgreProcedural/ProceduralIcoSphereGenerator.h +76 -0
- data/deps/include/OgreProcedural/ProceduralLathe.h +129 -0
- data/deps/include/OgreProcedural/ProceduralMeshGenerator.h +286 -0
- data/deps/include/OgreProcedural/ProceduralMultiShape.h +126 -0
- data/deps/include/OgreProcedural/ProceduralPath.h +322 -0
- data/deps/include/OgreProcedural/ProceduralPathGenerators.h +281 -0
- data/deps/include/OgreProcedural/ProceduralPlaneGenerator.h +93 -0
- data/deps/include/OgreProcedural/ProceduralPlatform.h +54 -0
- data/deps/include/OgreProcedural/ProceduralRoot.h +65 -0
- data/deps/include/OgreProcedural/ProceduralRoundedBoxGenerator.h +118 -0
- data/deps/include/OgreProcedural/ProceduralShape.h +532 -0
- data/deps/include/OgreProcedural/ProceduralShapeGenerators.h +362 -0
- data/deps/include/OgreProcedural/ProceduralSphereGenerator.h +80 -0
- data/deps/include/OgreProcedural/ProceduralSplines.h +168 -0
- data/deps/include/OgreProcedural/ProceduralStableHeaders.h +28 -0
- data/deps/include/OgreProcedural/ProceduralTorusGenerator.h +88 -0
- data/deps/include/OgreProcedural/ProceduralTorusKnotGenerator.h +106 -0
- data/deps/include/OgreProcedural/ProceduralTrack.h +122 -0
- data/deps/include/OgreProcedural/ProceduralTriangleBuffer.h +328 -0
- data/deps/include/OgreProcedural/ProceduralTriangulator.h +173 -0
- data/deps/include/OgreProcedural/ProceduralTubeGenerator.h +96 -0
- data/deps/include/OgreProcedural/ProceduralUtils.h +185 -0
- data/deps/lib/libOgreProcedural.so +0 -0
- data/lib/procedural.so +0 -0
- data/lib/ruby-procedural/version.rb +5 -0
- data/lib/ruby-procedural.rb +27 -0
- data/ruby-procedural.gemspec +33 -0
- metadata +138 -0
@@ -0,0 +1,19 @@
|
|
1
|
+
/* ----------------------------------------------------------------------------
|
2
|
+
* This file was automatically generated by SWIG (http://www.swig.org).
|
3
|
+
* Version 2.0.4
|
4
|
+
*
|
5
|
+
* This file is not intended to be easily readable and contains a number of
|
6
|
+
* coding conventions designed to improve portability and efficiency. Do not make
|
7
|
+
* changes to this file unless you know what you are doing--modify the SWIG
|
8
|
+
* interface file instead.
|
9
|
+
* ----------------------------------------------------------------------------- */
|
10
|
+
|
11
|
+
#ifndef SWIG_Procedural_WRAP_H_
|
12
|
+
#define SWIG_Procedural_WRAP_H_
|
13
|
+
|
14
|
+
namespace Swig {
|
15
|
+
class Director;
|
16
|
+
}
|
17
|
+
|
18
|
+
|
19
|
+
#endif
|
Binary file
|
@@ -0,0 +1,54 @@
|
|
1
|
+
/*
|
2
|
+
-----------------------------------------------------------------------------
|
3
|
+
This source file is part of ogre-procedural
|
4
|
+
|
5
|
+
For the latest info, see http://code.google.com/p/ogre-procedural/
|
6
|
+
|
7
|
+
Copyright (c) 2010 Michael Broutin
|
8
|
+
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
11
|
+
in the Software without restriction, including without limitation the rights
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
14
|
+
furnished to do so, subject to the following conditions:
|
15
|
+
|
16
|
+
The above copyright notice and this permission notice shall be included in
|
17
|
+
all copies or substantial portions of the Software.
|
18
|
+
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
25
|
+
THE SOFTWARE.
|
26
|
+
-----------------------------------------------------------------------------
|
27
|
+
*/
|
28
|
+
#ifndef PROCEDURAL_H_INCLUDED
|
29
|
+
#define PROCEDURAL_H_INCLUDED
|
30
|
+
|
31
|
+
#include "ProceduralBoxGenerator.h"
|
32
|
+
#include "ProceduralCapsuleGenerator.h"
|
33
|
+
#include "ProceduralConeGenerator.h"
|
34
|
+
#include "ProceduralCylinderGenerator.h"
|
35
|
+
#include "ProceduralIcoSphereGenerator.h"
|
36
|
+
#include "ProceduralRoundedBoxGenerator.h"
|
37
|
+
#include "ProceduralSphereGenerator.h"
|
38
|
+
#include "ProceduralTorusGenerator.h"
|
39
|
+
#include "ProceduralTorusKnotGenerator.h"
|
40
|
+
#include "ProceduralTubeGenerator.h"
|
41
|
+
#include "ProceduralPlaneGenerator.h"
|
42
|
+
#include "ProceduralRoot.h"
|
43
|
+
#include "ProceduralExtruder.h"
|
44
|
+
#include "ProceduralLathe.h"
|
45
|
+
#include "ProceduralShape.h"
|
46
|
+
#include "ProceduralShapeGenerators.h"
|
47
|
+
#include "ProceduralMultiShape.h"
|
48
|
+
#include "ProceduralPath.h"
|
49
|
+
#include "ProceduralPathGenerators.h"
|
50
|
+
#include "ProceduralTriangulator.h"
|
51
|
+
#include "ProceduralTriangleBuffer.h"
|
52
|
+
#include "ProceduralTrack.h"
|
53
|
+
|
54
|
+
#endif
|
@@ -0,0 +1,110 @@
|
|
1
|
+
/*
|
2
|
+
-----------------------------------------------------------------------------
|
3
|
+
This source file is part of ogre-procedural
|
4
|
+
|
5
|
+
For the latest info, see http://code.google.com/p/ogre-procedural/
|
6
|
+
|
7
|
+
Copyright (c) 2010 Michael Broutin
|
8
|
+
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
11
|
+
in the Software without restriction, including without limitation the rights
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
14
|
+
furnished to do so, subject to the following conditions:
|
15
|
+
|
16
|
+
The above copyright notice and this permission notice shall be included in
|
17
|
+
all copies or substantial portions of the Software.
|
18
|
+
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
25
|
+
THE SOFTWARE.
|
26
|
+
-----------------------------------------------------------------------------
|
27
|
+
*/
|
28
|
+
#ifndef PROCEDURAL_BOX_GENERATOR_INCLUDED
|
29
|
+
#define PROCEDURAL_BOX_GENERATOR_INCLUDED
|
30
|
+
|
31
|
+
#include "ProceduralMeshGenerator.h"
|
32
|
+
#include "ProceduralPlatform.h"
|
33
|
+
|
34
|
+
namespace Procedural
|
35
|
+
{
|
36
|
+
/**
|
37
|
+
* Generates a box mesh centered on the origin.
|
38
|
+
* Default size is 1.0 with 1 quad per face.
|
39
|
+
*/
|
40
|
+
class _ProceduralExport BoxGenerator : public MeshGenerator<BoxGenerator>
|
41
|
+
{
|
42
|
+
Ogre::Real mSizeX,mSizeY,mSizeZ;
|
43
|
+
int mNumSegX,mNumSegY,mNumSegZ;
|
44
|
+
public:
|
45
|
+
/// Contructor with arguments
|
46
|
+
BoxGenerator(Ogre::Real sizeX=1.f, Ogre::Real sizeY=1.f, Ogre::Real sizeZ=1.f, int numSegX=1, int numSegY=1, int numSegZ=1) :
|
47
|
+
mSizeX(sizeX), mSizeY(sizeY), mSizeZ(sizeZ), mNumSegX(numSegX), mNumSegY(numSegY), mNumSegZ(numSegZ) {}
|
48
|
+
|
49
|
+
/** Sets size along X axis (default=1) */
|
50
|
+
BoxGenerator& setSizeX(Ogre::Real sizeX)
|
51
|
+
{
|
52
|
+
mSizeX = sizeX;
|
53
|
+
return *this;
|
54
|
+
}
|
55
|
+
|
56
|
+
/** Sets size along Y axis (default=1) */
|
57
|
+
BoxGenerator& setSizeY(Ogre::Real sizeY)
|
58
|
+
{
|
59
|
+
mSizeY = sizeY;
|
60
|
+
return *this;
|
61
|
+
}
|
62
|
+
|
63
|
+
/** Sets size along Z axis (default=1) */
|
64
|
+
BoxGenerator& setSizeZ(Ogre::Real sizeZ)
|
65
|
+
{
|
66
|
+
mSizeZ = sizeZ;
|
67
|
+
return *this;
|
68
|
+
}
|
69
|
+
|
70
|
+
/** Sets the size (default=1,1,1) */
|
71
|
+
BoxGenerator& setSize(Ogre::Vector3 size)
|
72
|
+
{
|
73
|
+
mSizeX = size.x;
|
74
|
+
mSizeY = size.y;
|
75
|
+
mSizeZ = size.z;
|
76
|
+
return *this;
|
77
|
+
}
|
78
|
+
|
79
|
+
/** Sets the number of segments along X axis (default=1) */
|
80
|
+
BoxGenerator& setNumSegX(int numSegX)
|
81
|
+
{
|
82
|
+
mNumSegX = numSegX;
|
83
|
+
return *this;
|
84
|
+
}
|
85
|
+
|
86
|
+
/** Sets the number of segments along Y axis (default=1) */
|
87
|
+
BoxGenerator& setNumSegY(int numSegY)
|
88
|
+
{
|
89
|
+
mNumSegY = numSegY;
|
90
|
+
return *this;
|
91
|
+
}
|
92
|
+
|
93
|
+
/** Sets the number of segments along Z axis (default=1) */
|
94
|
+
BoxGenerator& setNumSegZ(int numSegZ)
|
95
|
+
{
|
96
|
+
mNumSegZ = numSegZ;
|
97
|
+
return *this;
|
98
|
+
}
|
99
|
+
|
100
|
+
/**
|
101
|
+
* Builds the mesh into the given TriangleBuffer
|
102
|
+
* @param buffer The TriangleBuffer on where to append the mesh.
|
103
|
+
*/
|
104
|
+
void addToTriangleBuffer(TriangleBuffer& buffer) const;
|
105
|
+
|
106
|
+
};
|
107
|
+
|
108
|
+
|
109
|
+
}
|
110
|
+
#endif
|
@@ -0,0 +1,103 @@
|
|
1
|
+
/*
|
2
|
+
-----------------------------------------------------------------------------
|
3
|
+
This source file is part of ogre-procedural
|
4
|
+
|
5
|
+
For the latest info, see http://code.google.com/p/ogre-procedural/
|
6
|
+
|
7
|
+
Copyright (c) 2010 Michael Broutin
|
8
|
+
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
11
|
+
in the Software without restriction, including without limitation the rights
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
14
|
+
furnished to do so, subject to the following conditions:
|
15
|
+
|
16
|
+
The above copyright notice and this permission notice shall be included in
|
17
|
+
all copies or substantial portions of the Software.
|
18
|
+
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
25
|
+
THE SOFTWARE.
|
26
|
+
-----------------------------------------------------------------------------
|
27
|
+
*/
|
28
|
+
#ifndef PROCEDURAL_CAPSULE_GENERATOR_INCLUDED
|
29
|
+
#define PROCEDURAL_CAPSULE_GENERATOR_INCLUDED
|
30
|
+
|
31
|
+
#include "ProceduralMeshGenerator.h"
|
32
|
+
#include "ProceduralPlatform.h"
|
33
|
+
|
34
|
+
namespace Procedural
|
35
|
+
{
|
36
|
+
/// Generates a capsule mesh, i.e. a sphere-terminated cylinder
|
37
|
+
class _ProceduralExport CapsuleGenerator : public MeshGenerator<CapsuleGenerator>
|
38
|
+
{
|
39
|
+
///Radius of the spheric part
|
40
|
+
Ogre::Real mRadius;
|
41
|
+
|
42
|
+
///Total height
|
43
|
+
Ogre::Real mHeight;
|
44
|
+
|
45
|
+
unsigned int mNumRings;
|
46
|
+
unsigned int mNumSegments;
|
47
|
+
unsigned int mNumSegHeight;
|
48
|
+
|
49
|
+
public:
|
50
|
+
/// Default constructor
|
51
|
+
CapsuleGenerator() : mRadius(1.0), mHeight(1.0),
|
52
|
+
mNumRings(8), mNumSegments(16), mNumSegHeight(1)
|
53
|
+
{}
|
54
|
+
|
55
|
+
/// Constructor with arguments
|
56
|
+
CapsuleGenerator(Ogre::Real radius, Ogre::Real height, unsigned int numRings, unsigned int numSegments, unsigned int numSegHeight) :
|
57
|
+
mRadius(radius), mHeight(height), mNumRings(numRings), mNumSegments(numSegments), mNumSegHeight(numSegHeight) {}
|
58
|
+
|
59
|
+
/**
|
60
|
+
* Builds the mesh into the given TriangleBuffer
|
61
|
+
* @param buffer The TriangleBuffer on where to append the mesh.
|
62
|
+
*/
|
63
|
+
void addToTriangleBuffer(TriangleBuffer& buffer) const;
|
64
|
+
|
65
|
+
/** Sets the radius of the cylinder part (default=1)*/
|
66
|
+
inline CapsuleGenerator & setRadius(Ogre::Real radius)
|
67
|
+
{
|
68
|
+
mRadius = radius;
|
69
|
+
return *this;
|
70
|
+
}
|
71
|
+
|
72
|
+
/** Sets the number of segments of the sphere part (default=8)*/
|
73
|
+
inline CapsuleGenerator & setNumRings(unsigned int numRings)
|
74
|
+
{
|
75
|
+
mNumRings = numRings;
|
76
|
+
return *this;
|
77
|
+
}
|
78
|
+
|
79
|
+
/** Sets the number of segments when rotating around the cylinder (default=16)*/
|
80
|
+
inline CapsuleGenerator & setNumSegments(unsigned int numSegments)
|
81
|
+
{
|
82
|
+
mNumSegments = numSegments;
|
83
|
+
return *this;
|
84
|
+
}
|
85
|
+
|
86
|
+
/** Sets the number of segments along the axis of the cylinder (default=1)*/
|
87
|
+
inline CapsuleGenerator & setNumSegHeight(unsigned int numSegHeight)
|
88
|
+
{
|
89
|
+
mNumSegHeight = numSegHeight;
|
90
|
+
return *this;
|
91
|
+
}
|
92
|
+
|
93
|
+
/** Sets the height of the cylinder part of the capsule (default=1)*/
|
94
|
+
inline CapsuleGenerator & setHeight(Ogre::Real height)
|
95
|
+
{
|
96
|
+
mHeight = height;
|
97
|
+
return *this;
|
98
|
+
}
|
99
|
+
|
100
|
+
|
101
|
+
};
|
102
|
+
}
|
103
|
+
#endif
|
@@ -0,0 +1,90 @@
|
|
1
|
+
/*
|
2
|
+
-----------------------------------------------------------------------------
|
3
|
+
This source file is part of ogre-procedural
|
4
|
+
|
5
|
+
For the latest info, see http://code.google.com/p/ogre-procedural/
|
6
|
+
|
7
|
+
Copyright (c) 2010 Michael Broutin
|
8
|
+
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
11
|
+
in the Software without restriction, including without limitation the rights
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
14
|
+
furnished to do so, subject to the following conditions:
|
15
|
+
|
16
|
+
The above copyright notice and this permission notice shall be included in
|
17
|
+
all copies or substantial portions of the Software.
|
18
|
+
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
25
|
+
THE SOFTWARE.
|
26
|
+
-----------------------------------------------------------------------------
|
27
|
+
*/
|
28
|
+
#ifndef PROCEDURAL_CONE_GENERATOR_INCLUDED
|
29
|
+
#define PROCEDURAL_CONE_GENERATOR_INCLUDED
|
30
|
+
|
31
|
+
#include "ProceduralMeshGenerator.h"
|
32
|
+
#include "ProceduralPlatform.h"
|
33
|
+
|
34
|
+
namespace Procedural
|
35
|
+
{
|
36
|
+
/// Generates a cone mesh along Y-axis
|
37
|
+
class _ProceduralExport ConeGenerator : public MeshGenerator<ConeGenerator>
|
38
|
+
{
|
39
|
+
int mNumSegBase;
|
40
|
+
int mNumSegHeight;
|
41
|
+
Ogre::Real mRadius;
|
42
|
+
Ogre::Real mHeight;
|
43
|
+
public:
|
44
|
+
/// Contructor with arguments
|
45
|
+
ConeGenerator(Ogre::Real radius = 1.f, Ogre::Real height = 1.f, int numSegBase = 16, int numSegHeight = 1) :
|
46
|
+
mNumSegBase(numSegBase),
|
47
|
+
mNumSegHeight(numSegHeight),
|
48
|
+
mRadius(radius),
|
49
|
+
mHeight(height)
|
50
|
+
{}
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Builds the mesh into the given TriangleBuffer
|
54
|
+
* @param buffer The TriangleBuffer on where to append the mesh.
|
55
|
+
*/
|
56
|
+
void addToTriangleBuffer(TriangleBuffer& buffer) const;
|
57
|
+
|
58
|
+
/** Sets the number of segments on the side of the base (default=16)*/
|
59
|
+
inline ConeGenerator & setNumSegBase(int numSegBase)
|
60
|
+
{
|
61
|
+
mNumSegBase = numSegBase;
|
62
|
+
return *this;
|
63
|
+
}
|
64
|
+
|
65
|
+
/** Sets the number of segments on the height (default=1) */
|
66
|
+
inline ConeGenerator & setNumSegHeight(int numSegHeight)
|
67
|
+
{
|
68
|
+
mNumSegHeight = numSegHeight;
|
69
|
+
return *this;
|
70
|
+
}
|
71
|
+
|
72
|
+
/** Sets the base radius (default=1)*/
|
73
|
+
inline ConeGenerator & setRadius(Ogre::Real radius)
|
74
|
+
{
|
75
|
+
mRadius = radius;
|
76
|
+
return *this;
|
77
|
+
}
|
78
|
+
|
79
|
+
/** Sets the height of the cone (default=1)*/
|
80
|
+
inline ConeGenerator & setHeight(Ogre::Real height)
|
81
|
+
{
|
82
|
+
mHeight = height;
|
83
|
+
return *this;
|
84
|
+
}
|
85
|
+
|
86
|
+
|
87
|
+
};
|
88
|
+
}
|
89
|
+
|
90
|
+
#endif
|
@@ -0,0 +1,99 @@
|
|
1
|
+
/*
|
2
|
+
-----------------------------------------------------------------------------
|
3
|
+
This source file is part of ogre-procedural
|
4
|
+
|
5
|
+
For the latest info, see http://code.google.com/p/ogre-procedural/
|
6
|
+
|
7
|
+
Copyright (c) 2010 Michael Broutin
|
8
|
+
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
11
|
+
in the Software without restriction, including without limitation the rights
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
14
|
+
furnished to do so, subject to the following conditions:
|
15
|
+
|
16
|
+
The above copyright notice and this permission notice shall be included in
|
17
|
+
all copies or substantial portions of the Software.
|
18
|
+
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
25
|
+
THE SOFTWARE.
|
26
|
+
-----------------------------------------------------------------------------
|
27
|
+
*/
|
28
|
+
#ifndef PROCEDURAL_CYLINDER_GENERATOR_INCLUDED
|
29
|
+
#define PROCEDURAL_CYLINDER_GENERATOR_INCLUDED
|
30
|
+
|
31
|
+
#include "ProceduralMeshGenerator.h"
|
32
|
+
#include "ProceduralPlatform.h"
|
33
|
+
|
34
|
+
namespace Procedural
|
35
|
+
{
|
36
|
+
/// Generates a cylinder mesh along Y-axis
|
37
|
+
class _ProceduralExport CylinderGenerator : public MeshGenerator<CylinderGenerator>
|
38
|
+
{
|
39
|
+
int mNumSegBase;
|
40
|
+
int mNumSegHeight;
|
41
|
+
bool mCapped;
|
42
|
+
Ogre::Real mRadius;
|
43
|
+
Ogre::Real mHeight;
|
44
|
+
|
45
|
+
public:
|
46
|
+
/// Contructor with arguments
|
47
|
+
CylinderGenerator(Ogre::Real radius = 1.f, Ogre::Real height = 1.f, int numSegBase = 16, int numSegHeight = 1, bool capped = true) :
|
48
|
+
mNumSegBase(numSegBase),
|
49
|
+
mNumSegHeight(numSegHeight),
|
50
|
+
mCapped(capped),
|
51
|
+
mRadius(radius),
|
52
|
+
mHeight(height)
|
53
|
+
{}
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Builds the mesh into the given TriangleBuffer
|
57
|
+
* @param buffer The TriangleBuffer on where to append the mesh.
|
58
|
+
*/
|
59
|
+
void addToTriangleBuffer(TriangleBuffer& buffer) const;
|
60
|
+
|
61
|
+
/** Sets the number of segments when rotating around the cylinder's axis (default=16) */
|
62
|
+
inline CylinderGenerator & setNumSegBase(int numSegBase)
|
63
|
+
{
|
64
|
+
mNumSegBase = numSegBase;
|
65
|
+
return *this;
|
66
|
+
}
|
67
|
+
|
68
|
+
/** Sets the number of segments along the height of the cylinder (default=1) */
|
69
|
+
inline CylinderGenerator & setNumSegHeight(int numSegHeight)
|
70
|
+
{
|
71
|
+
mNumSegHeight = numSegHeight;
|
72
|
+
return *this;
|
73
|
+
}
|
74
|
+
|
75
|
+
/** Sets whether the cylinder has endings or not (default=true) */
|
76
|
+
inline CylinderGenerator & setCapped(bool capped)
|
77
|
+
{
|
78
|
+
mCapped = capped;
|
79
|
+
return *this;
|
80
|
+
}
|
81
|
+
|
82
|
+
/** Sets the radius of the cylinder (default=1) */
|
83
|
+
inline CylinderGenerator & setRadius(Ogre::Real radius)
|
84
|
+
{
|
85
|
+
mRadius = radius;
|
86
|
+
return *this;
|
87
|
+
}
|
88
|
+
|
89
|
+
/** Sets the height of the cylinder (default=1) */
|
90
|
+
inline CylinderGenerator & setHeight(Ogre::Real height)
|
91
|
+
{
|
92
|
+
mHeight = height;
|
93
|
+
return *this;
|
94
|
+
}
|
95
|
+
|
96
|
+
};
|
97
|
+
}
|
98
|
+
|
99
|
+
#endif
|