-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcylinder.h
42 lines (35 loc) · 988 Bytes
/
cylinder.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef cylinder_H_
#define cylinder_H_
#include <maya/MPoint.h>
#include <maya/MPoint.h>
#include <maya/MPointArray.h>
#include <maya/MVector.h>
#include <maya/MVectorArray.h>
#include <maya/MIntArray.h>
#include <maya/MDoubleArray.h>
class CylinderMesh
{
public:
CylinderMesh(const MPoint& start, const MPoint& end, double r = 0.25);
~CylinderMesh();
void getMesh(
MPointArray& points,
MIntArray& faceCounts,
MIntArray& faceConnects);
void appendToMesh(
MPointArray& points,
MIntArray& faceCounts,
MIntArray& faceConnects);
protected:
void transform(MPointArray& points, MVectorArray& normals);
MPoint mStart;
MPoint mEnd;
double r;
// Creates a unit cylinder from (0,0,0) to (1,0,0) with radius r
static void initCylinderMesh(double r);
static MPointArray gPoints;
static MVectorArray gNormals;
static MIntArray gFaceCounts;
static MIntArray gFaceConnects;
};
#endif