forked from Toolchefs/softIkSolver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tcSoftIkSolverNew.h
47 lines (28 loc) · 886 Bytes
/
tcSoftIkSolverNew.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
43
44
45
46
47
#pragma once
#pragma once
#include <maya/MPxIkSolverNode.h>
#include <maya/MVector.h>
#include <maya/MPoint.h>
#include <maya/MDagPath.h>
#define MAX_ITERATIONS 1
#define kSolverType "softIkSolverNode"
#define kPi 3.14159265358979323846264338327950
#define kEpsilon 1.0e-5
#define absoluteValue(x) ((x) < 0 ? (-(x)) : (x))
class TcSoftIkSolverNodeNew : public MPxIkSolverNode {
public:
TcSoftIkSolverNodeNew();
virtual ~TcSoftIkSolverNodeNew();
virtual MStatus preSolve();
virtual MStatus doSolve();
virtual MStatus postSolve(MStatus stat);
virtual MString solverTypeName() const;
static void* creator();
static MStatus initialize();
static MTypeId id;
private:
MStatus doSimpleSolver();
MVector poleVectorFromHandle(const MDagPath &handlePath);
MDagPath getEndJoint(const MDagPath &handlePath);
double twistFromHandle(const MDagPath &handlePath);
};