Blender V4.3
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
39#ifndef __IK_SOLVER_H__
40#define __IK_SOLVER_H__
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
80typedef void IK_Segment;
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
125typedef void IK_Solver;
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_SolverSetPoleVectorConstraint(IK_Solver *solver, IK_Segment *tip, float goal[3], float polegoal[3], float poleangle, int getangle)
void IK_Segment
Definition IK_solver.h:80
void IK_SetParent(IK_Segment *seg, IK_Segment *parent)
void IK_FreeSolver(IK_Solver *solver)
IK_Segment * IK_CreateSegment(int flag)
Definition IK_Solver.cpp:97
void IK_FreeSegment(IK_Segment *seg)
@ IK_ZDOF
Definition IK_solver.h:85
@ IK_TRANS_XDOF
Definition IK_solver.h:86
@ IK_TRANS_ZDOF
Definition IK_solver.h:88
@ IK_XDOF
Definition IK_solver.h:83
@ IK_YDOF
Definition IK_solver.h:84
@ 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])
IK_SegmentAxis
Definition IK_solver.h:91
@ IK_X
Definition IK_solver.h:92
@ IK_TRANS_X
Definition IK_solver.h:95
@ IK_Y
Definition IK_solver.h:93
@ IK_TRANS_Y
Definition IK_solver.h:96
@ IK_TRANS_Z
Definition IK_solver.h:97
@ IK_Z
Definition IK_solver.h:94
void IK_SetStiffness(IK_Segment *seg, IK_SegmentAxis axis, float stiffness)
void IK_GetTranslationChange(IK_Segment *seg, float *translation_change)
void IK_Solver
Definition IK_solver.h:125
IK_SegmentFlag
IK_SegmentAxis
uint8_t flag
Definition wm_window.cc:138