Blender V5.0
IK_solver.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
38
39#ifndef __IK_SOLVER_H__
40#define __IK_SOLVER_H__
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
57
79
80using IK_Segment = void;
81
90
99
100extern IK_Segment *IK_CreateSegment(int flag);
101extern void IK_FreeSegment(IK_Segment *seg);
102
103extern void IK_SetParent(IK_Segment *seg, IK_Segment *parent);
104extern void IK_SetTransform(
105 IK_Segment *seg, float start[3], float rest_basis[][3], float basis[][3], float length);
106extern void IK_SetLimit(IK_Segment *seg, IK_SegmentAxis axis, float lmin, float lmax);
107extern void IK_SetStiffness(IK_Segment *seg, IK_SegmentAxis axis, float stiffness);
108
109extern void IK_GetBasisChange(IK_Segment *seg, float basis_change[][3]);
110extern void IK_GetTranslationChange(IK_Segment *seg, float *translation_change);
111
124
125using IK_Solver = void;
126
128void IK_FreeSolver(IK_Solver *solver);
129
130void IK_SolverAddGoal(IK_Solver *solver, IK_Segment *tip, float goal[3], float weight);
132 IK_Segment *tip,
133 float goal[][3],
134 float weight);
136 IK_Segment *tip,
137 float goal[3],
138 float polegoal[3],
139 float poleangle,
140 int getangle);
141float IK_SolverGetPoleAngle(IK_Solver *solver);
142
143int IK_Solve(IK_Solver *solver, float tolerance, int max_iterations);
144
145#define IK_STRETCH_STIFF_EPS 0.01f
146#define IK_STRETCH_STIFF_MIN 0.001f
147#define IK_STRETCH_STIFF_MAX 1e10
148
149#ifdef __cplusplus
150}
151#endif
152
153#endif // __IK_SOLVER_H__
IK_Solver * IK_CreateSolver(IK_Segment *root)
float IK_SolverGetPoleAngle(IK_Solver *solver)
void IK_Segment
Definition IK_solver.h:80
void IK_SolverSetPoleVectorConstraint(IK_Solver *solver, IK_Segment *tip, float goal[3], float polegoal[3], float poleangle, int getangle)
void IK_SetParent(IK_Segment *seg, IK_Segment *parent)
void IK_FreeSolver(IK_Solver *solver)
void IK_Solver
Definition IK_solver.h:125
IK_Segment * IK_CreateSegment(int flag)
Definition IK_Solver.cpp:98
void IK_FreeSegment(IK_Segment *seg)
@ IK_TRANS_XDOF
Definition IK_solver.h:86
@ IK_TRANS_ZDOF
Definition IK_solver.h:88
@ IK_TRANS_YDOF
Definition IK_solver.h:87
void IK_SolverAddGoalOrientation(IK_Solver *solver, IK_Segment *tip, float goal[][3], float weight)
void IK_SetLimit(IK_Segment *seg, IK_SegmentAxis axis, float lmin, float lmax)
void IK_SolverAddGoal(IK_Solver *solver, IK_Segment *tip, float goal[3], float weight)
int IK_Solve(IK_Solver *solver, float tolerance, int max_iterations)
void IK_SetTransform(IK_Segment *seg, float start[3], float rest_basis[][3], float basis[][3], float length)
void IK_GetBasisChange(IK_Segment *seg, float basis_change[][3])
void IK_SetStiffness(IK_Segment *seg, IK_SegmentAxis axis, float stiffness)
void IK_GetTranslationChange(IK_Segment *seg, float *translation_change)
float length(VecOp< float, D >) RET
IK_SegmentFlag
@ IK_ZDOF
@ IK_XDOF
@ IK_YDOF
IK_SegmentAxis
@ IK_X
@ IK_TRANS_X
@ IK_Y
@ IK_TRANS_Y
@ IK_TRANS_Z
@ IK_Z
uint8_t flag
Definition wm_window.cc:145