49 #define ANIM_FEEDBACK 0.8
214 bPoseChannel *curchan, *pchan_root =
nullptr, *chanlist[256], **oldchan;
218 int a,
t, segcount = 0,
size, newsize, *oldparent, parent, rootbone, treecount;
224 pchan_tip = pchan_tip->
parent;
227 rootbone =
data->rootbone;
229 for (curchan = pchan_tip; curchan; curchan = curchan->
parent) {
230 pchan_root = curchan;
232 if (++segcount > 255) {
236 if (segcount == rootbone) {
262 for (rootbone = segcount, segcount = 0, curchan = pchan_tip; segcount < rootbone;
263 segcount++, curchan = curchan->
parent) {
264 chanlist[segcount] = curchan;
270 target = MEM_cnew<PoseTarget>(
"posetarget");
278 tree = MEM_cnew<PoseTree>(
"posetree");
280 tree->iterations =
data->iterations;
281 tree->totchannel = segcount;
285 tree->parent = (
int *)
MEM_callocN(segcount *
sizeof(
int),
"ik tree parent");
286 for (
a = 0;
a < segcount;
a++) {
287 tree->pchan[
a] = chanlist[segcount -
a - 1];
290 target->
tip = segcount - 1;
304 while (
a <
size && t < tree->totchannel) {
306 for (;
t <
tree->totchannel &&
tree->pchan[
t] != chanlist[segcount -
a - 1];
t++) {
309 if (
t >=
tree->totchannel) {
312 for (;
a <
size &&
t <
tree->totchannel &&
tree->pchan[
t] == chanlist[segcount -
a - 1];
318 segcount = segcount -
a;
319 target->
tip =
tree->totchannel + segcount - 1;
322 for (parent =
a - 1; parent <
tree->totchannel; parent++) {
323 if (
tree->pchan[parent] == chanlist[segcount - 1]->parent) {
329 if (parent ==
tree->totchannel) {
334 newsize =
tree->totchannel + segcount;
335 oldchan =
tree->pchan;
336 oldparent =
tree->parent;
339 tree->parent = (
int *)
MEM_callocN(newsize *
sizeof(
int),
"ik tree parent");
340 memcpy(
tree->pchan, oldchan,
sizeof(
void *) *
tree->totchannel);
341 memcpy(
tree->parent, oldparent,
sizeof(
int) *
tree->totchannel);
346 for (
a = 0;
a < segcount;
a++) {
347 tree->pchan[
tree->totchannel +
a] = chanlist[segcount -
a - 1];
350 tree->parent[
tree->totchannel] = parent;
352 tree->totchannel = newsize;
384 if (
data->tar ==
nullptr) {
453 double qy =
R(0, 2) -
R(2, 0);
454 double qw =
R(0, 0) +
R(1, 1) +
R(2, 2) + 1;
597 next.setValue(&tarmat[0][0]);
629 next.setValue(&rootmat[0][0]);
671 double q_rest[3], q[3],
length;
695 polerot.
UnitZ(-poledir);
707 unsigned int _nvalues,
752 unsigned int nvalues,
761 for (i = 0,
error = 0.0, value = values->
values; i < values->number; i++, value++) {
769 for (i = 0,
error = 0.0, value = values->
values; i < values->number; i++, value++) {
779 unsigned int _nvalues,
796 switch (condata->
mode) {
809 switch (condata->
mode) {
829 unsigned int _nvalues,
837 unsigned int _nvalues,
853 if (chan->rotmode > 0) {
912 for (
unsigned int i = 0; i < _nvalues; i++, dof++) {
914 _values[i].
alpha = chan->ikrotweight;
932 for (
a = 0, ikchan = ikscene->
channels; a < ikscene->numchan;
a++, ikchan++) {
933 pchan =
tree->pchan[
a];
934 ikchan->
pchan = pchan;
1046 njoint += ikchan->
ndof;
1070 for (joint =
a = 0, ikchan = ikscene->
channels;
1071 a < ikscene->numchan && joint < ikscene->numjoint;
1073 pchan = ikchan->
pchan;
1093 joint += ikchan->
ndof;
1113 for (joint =
a = 0, ikchan = ikscene->
channels;
1114 a < ikscene->numchan && joint < ikscene->numjoint;
1116 pchan = ikchan->
pchan;
1123 joint += ikchan->
ndof;
1148 if (
tree->totchannel == 0) {
1158 ikscene->numchan =
tree->totchannel;
1159 ikscene->armature = arm;
1160 ikscene->scene =
scene;
1173 switch (ikparam->solver) {
1184 ikscene->blArmature = ob;
1187 ikscene->blInvScale = (ikscene->blScale <
KDL::epsilon) ? 0.0f : 1.0f / ikscene->blScale;
1190 std::string root(
"root");
1192 std::vector<double> weights;
1198 rot = ikscene->jointArray(0);
1200 for (
a = 0, ikchan = ikscene->channels; a < tree->totchannel;
a++, ikchan++) {
1201 pchan = ikchan->pchan;
1208 fl[0][0], fl[1][0], fl[2][0], fl[0][1], fl[1][1], fl[2][1], fl[0][2], fl[1][2], fl[2][2]);
1213 float R_parmat[3][3];
1214 float iR_parmat[3][3];
1225 start[0] = start[1] = start[2] = 0.0f;
1232 bpos *= ikscene->blScale;
1236 length = bone->length * ikscene->blScale;
1237 parent = (
a > 0) ? ikscene->channels[
tree->parent[
a]].tail : root;
1250 weight[0] = (1.0 - pchan->
stiffness[0]);
1251 weight[1] = (1.0 - pchan->
stiffness[1]);
1252 weight[2] = (1.0 - pchan->
stiffness[2]);
1253 switch (ikchan->jointType & ~
IK_TRANSY) {
1263 weights.push_back(weight[0]);
1269 weights.push_back(weight[1]);
1275 weights.push_back(weight[2]);
1280 weights.push_back(weight[0]);
1286 weights.push_back(weight[1]);
1292 weights.push_back(weight[0]);
1293 weights.push_back(weight[2]);
1299 weights.push_back(weight[2]);
1305 weights.push_back(weight[1]);
1312 weights.push_back(weight[0]);
1313 weights.push_back(weight[2]);
1319 weights.push_back(weight[1]);
1325 weights.push_back(weight[0]);
1326 weights.push_back(weight[1]);
1327 weights.push_back(weight[2]);
1337 weight[1] = (1.0 -
min_ff(1.0 - ikstretch, 1.0f - 0.001f));
1338 weights.push_back(weight[1]);
1345 ikchan->tail = joint;
1346 ikchan->head = parent;
1353 if (arm->addLimitConstraint(joint, 0, pchan->
limitmin[0], pchan->
limitmax[0]) < 0) {
1358 if (arm->addConstraint(joint,
joint_callback, ikchan,
false,
false) < 0) {
1367 if (arm->addLimitConstraint(joint, 0, pchan->
limitmin[1], pchan->
limitmax[1]) < 0) {
1372 if (arm->addConstraint(joint,
joint_callback, ikchan,
false,
false) < 0) {
1381 if (arm->addLimitConstraint(joint, 0, pchan->
limitmin[2], pchan->
limitmax[2]) < 0) {
1386 if (arm->addConstraint(joint,
joint_callback, ikchan,
false,
false) < 0) {
1391 if ((ikchan->jointType &
IK_SWING) &&
1396 if (arm->addLimitConstraint(joint, 0, pchan->
limitmin[0], pchan->
limitmax[0]) < 0) {
1401 if (arm->addLimitConstraint(joint, 1, pchan->
limitmin[2], pchan->
limitmax[2]) < 0) {
1406 if (arm->addConstraint(joint,
joint_callback, ikchan,
false,
false) < 0) {
1414 if (arm->addConstraint(joint,
joint_callback, ikchan,
false,
false) < 0) {
1420 rot += ikchan->ndof;
1427 for (numtarget = 0, polarcon =
nullptr,
ret =
true, target = (
PoseTarget *)
tree->targets.first;
1431 pchan =
tree->pchan[target->tip];
1436 ikscene->targets.push_back(iktarget);
1437 iktarget->
ee = arm->addEndEffector(ikscene->channels[target->tip].tail);
1438 if (iktarget->
ee == -1) {
1444 iktarget->
channel = target->tip;
1446 iktarget->
rootChannel = ikscene->channels[0].pchan;
1447 iktarget->
owner = ob;
1455 if (condata->poletar) {
1457 polarcon = target->con;
1462 if (numtarget == 1 && polarcon) {
1463 ikscene->polarConstraint = polarcon;
1471 std::string armname;
1474 ret =
scene->addObject(armname, ikscene->base);
1478 ret =
scene->addObject(armname, ikscene->armature, ikscene->base);
1486 assert(Wq.cols() == (
int)weights.size());
1487 for (
int q = 0; q < Wq.cols(); q++) {
1488 Wq(q, q) = weights[q];
1494 float invBaseFrame[4][4];
1495 pchan = ikscene->channels[0].pchan;
1498 float baseFrame[4][4];
1509 for (
t = 0;
t < ikscene->targets.size();
t++) {
1515 unsigned int controltype, bone_count;
1521 for (bone_count = 0, bone_length = 0.0f,
a = iktarget->
channel;
a >= 0;
1522 a =
tree->parent[
a], bone_count++) {
1523 bone_length += ikscene->blScale *
tree->pchan[
a]->bone->length;
1525 bone_length /= bone_count;
1544 switch (condata->type) {
1590 ikscene->channels[iktarget->
channel].tail);
1597 ikscene->channels[iktarget->
channel].tail);
1614 ikscene->channels[iktarget->
channel].tail);
1621 if (!
ret || !
scene->addCache(ikscene->cache) || !
scene->addSolver(ikscene->solver) ||
1622 !
scene->initialize()) {
1644 ikdata->
first = ikscene;
1656 if (
tree->basis_change) {
1694 for (i = 0, ikchan = ikscene->
channels; i < ikscene->numchan; i++, ikchan++) {
1704 for (i = 0, ikchan = ikscene->
channels; i < ikscene->numchan; i++, ikchan++) {
1716 for (i = ikscene->
targets.size(); i > 0; i--) {
1728 double timestamp = ctime * frtime + 2147483.648;
1729 double timestep = frtime;
1763 timestep = sts / 1000.0;
1770 for (i = 0; i < ikparam->
numiter; i++) {
1779 ikscene->
scene->
update(timestamp, 0.0, 1,
true,
true,
true);
1783 for (i = ikscene->
targets.size(); i > 0; i--) {
1786 unsigned int nvalues;
1800 double q_rest[3], q[3];
1807 for (i = 0, ikchan = ikscene->
channels; i < ikscene->numchan; i++, ikchan++) {
1824 if (!arm->
getSegment(ikchan->
tail, 3, joint, q_rest[0], q[0], tip)) {
1829 scale = (
float)(q[0] / q_rest[0]);
1839 pchan = ikchan->
pchan;
1857 if (i < ikscene->numchan) {
1914 if (ikscene->channels[0].pchan == pchan_root) {
1948 scene->cache->clearCacheFrom(
nullptr, 1);
1960 double armlength = ikscene->armature->getArmLength();
1967 ikscene->armature->setControlParameter(
1976 ikscene->armature->setControlParameter(
1992 switch (
data->type) {
typedef float(TangentPoint)[2]
Blender kernel action and pose functionality.
void BKE_pose_itasc_init(struct bItasc *itasc)
void BKE_pose_where_is_bone(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan, float ctime, bool do_extra)
void BKE_constraint_target_matrix_get(struct Depsgraph *depsgraph, struct Scene *scene, struct bConstraint *con, int index, short ownertype, void *ownerdata, float mat[4][4], float ctime)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE float min_ff(float a, float b)
void mul_m3_v3(const float M[3][3], float r[3])
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void unit_m3(float m[3][3])
void blend_m4_m4m4(float out[4][4], const float dst[4][4], const float src[4][4], float srcweight)
void copy_m3_m4(float m1[3][3], const float m2[4][4])
void mul_m4_m4m3(float R[4][4], const float A[4][4], const float B[3][3])
void unit_m4(float m[4][4])
bool invert_m4_m4(float R[4][4], const float A[4][4])
void normalize_m3(float R[3][3]) ATTR_NONNULL()
#define mul_m4_series(...)
bool invert_m3_m3(float R[3][3], const float A[3][3])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void normalize_m4(float R[4][4]) ATTR_NONNULL()
void eulO_to_mat3(float mat[3][3], const float eul[3], short order)
float normalize_qt(float q[4])
void quat_to_mat3(float mat[3][3], const float q[4])
void axis_angle_to_mat3(float R[3][3], const float axis[3], float angle)
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
#define CONSTRAINT_ID_ALL
struct Depsgraph Depsgraph
@ ITASC_INITIAL_REITERATION
@ CONSTRAINT_IK_TARGETAXIS
@ CONSTRAINT_TYPE_KINEMATIC
@ CONSTRAINT_OBTYPE_OBJECT
Object is a sort of wrapper for general info.
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
Read Guarded memory(de)allocation.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between and object coordinate space Combine Create a color from its and value channels Color Retrieve a color or the default fallback if none is specified Separate Split a vector into its X
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between and object coordinate space Combine Create a color from its and value channels Color Retrieve a color or the default fallback if none is specified Separate Split a vector into its Y
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
represents a frame transformation in 3D space (rotation + translation)
Rotation M
Orientation of the Frame.
void setValue(float *oglmat)
void getValue(float *oglmat) const
Vector p
origine of the Frame
void resize(unsigned int newSize)
This class encapsulates a simple joint, that is with one parameterized degree of freedom and with sca...
const JointType & getType() const
represents rotations in 3 dimensional space.
Rotation Inverse() const
Gives back the inverse rotation matrix of *this.
Vector UnitY() const
Access to the underlying unitvectors of the rotation matrix.
Vector UnitZ() const
Access to the underlying unitvectors of the rotation matrix.
Vector UnitX() const
Access to the underlying unitvectors of the rotation matrix.
static Rotation RotX(double angle)
The Rot... static functions give the value of the appropriate rotation matrix back.
void setValue(float *oglmat)
static Rotation RotY(double angle)
The Rot... static functions give the value of the appropriate rotation matrix back.
static Rotation RotZ(double angle)
The Rot... static functions give the value of the appropriate rotation matrix back.
void GetValue(double *xy) const
store vector components in array
A concrete implementation of a 3 dimensional vector class.
void GetValue(double *xyz) const
store vector components in array
bool getRelativeFrame(Frame &result, const std::string &segment_name, const std::string &base_name=m_root)
virtual const Frame & getPose(const unsigned int end_effector)
bool getSegment(const std::string &segment_name, const unsigned int q_size, const Joint *&p_joint, double &q_rest, double &q, const Frame *&p_tip)
double getMaxEndEffectorChange()
virtual bool setJointArray(const KDL::JntArray &joints)
double getMaxJointChange()
const void * getPreviousCacheItem(const void *device, int channel, CacheTS *timestamp)
bool setControlParameter(int id, ConstraintAction action, double value, double timestep=0.0)
void substep(bool _substep)
virtual EIGEN_MAKE_ALIGNED_OPERATOR_NEW bool registerCallback(ConstraintCallback _function, void *_param)
virtual const ConstraintValues * getControlParameters(unsigned int *_nvalues)=0
virtual const unsigned int getNrOfConstraints()
bool setCallback(MovingFrameCallback _function, void *_param)
virtual const KDL::Frame & getPose(const unsigned int end_effector=0)
bool update(double timestamp, double timestep, unsigned int numsubstep=1, bool reiterate=false, bool cache=true, bool interpolate=true)
virtual void setParam(SolverParam param, double value)=0
const Depsgraph * depsgraph
SyclQueue void void size_t num_bytes void
IMETHOD void SetToZero(Vector &v)
static void execute_scene(struct Depsgraph *depsgraph, Scene *blscene, IK_Scene *ikscene, bItasc *ikparam, float ctime, float frtime)
static void RemoveEulerAngleFromMatrix(KDL::Rotation &R, double angle, int axis)
static void distance_error(const iTaSC::ConstraintValues *values, unsigned int _nvalues, IK_Target *iktarget)
void itasc_clear_cache(struct bPose *pose)
static int init_scene(Object *ob)
static IK_Data * get_ikdata(bPose *pose)
static bool target_callback(const iTaSC::Timestamp ×tamp, const iTaSC::Frame ¤t, iTaSC::Frame &next, void *param)
void itasc_clear_data(struct bPose *pose)
static bool base_callback(const iTaSC::Timestamp ×tamp, const iTaSC::Frame ¤t, iTaSC::Frame &next, void *param)
static void BKE_pose_rest(IK_Scene *ikscene)
static void convert_pose(IK_Scene *ikscene)
static bool copypose_callback(const iTaSC::Timestamp ×tamp, iTaSC::ConstraintValues *const _values, unsigned int _nvalues, void *_param)
void itasc_update_param(struct bPose *pose)
static int convert_channels(struct Depsgraph *depsgraph, IK_Scene *ikscene, PoseTree *tree, float ctime)
static int initialize_scene(Object *ob, bPoseChannel *pchan_tip)
static bool joint_callback(const iTaSC::Timestamp ×tamp, iTaSC::ConstraintValues *const _values, unsigned int _nvalues, void *_param)
static void create_scene(struct Depsgraph *depsgraph, Scene *scene, Object *ob, float ctime)
static bool constraint_valid(bConstraint *con)
void itasc_release_tree(struct Scene *scene, struct Object *ob, float ctime)
static void GetJointRotation(KDL::Rotation &boneRot, int type, double *rot)
static void copypose_error(const iTaSC::ConstraintValues *values, unsigned int nvalues, IK_Target *iktarget)
static double ComputeTwist(const KDL::Rotation &R)
void itasc_initialize_tree(struct Depsgraph *depsgraph, struct Scene *scene, Object *ob, float ctime)
static bool is_cartesian_constraint(bConstraint *con)
void(*)(const iTaSC::ConstraintValues *values, unsigned int nvalues, IK_Target *iktarget) ErrorCallback
void itasc_execute_tree(struct Depsgraph *depsgraph, struct Scene *scene, Object *ob, bPoseChannel *pchan_root, float ctime)
void itasc_test_constraint(struct Object *ob, struct bConstraint *cons)
static int initialize_chain(Object *ob, bPoseChannel *pchan_tip, bConstraint *con)
static IK_Scene * convert_tree(struct Depsgraph *depsgraph, Scene *blscene, Object *ob, bPoseChannel *pchan, float ctime)
static double EulerAngleFromMatrix(const KDL::Rotation &R, int axis)
static bool distance_callback(const iTaSC::Timestamp ×tamp, iTaSC::ConstraintValues *const _values, unsigned int _nvalues, void *_param)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
ccl_device_inline float2 fabs(const float2 &a)
static void error(const char *str)
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
Vector Normalize(const Vector &, double eps=epsilon)
const double PI
the value of pi
INLINE Rall1d< T, V, S > sqrt(const Rall1d< T, V, S > &arg)
double epsilon
default precision while comparing with Equal(..,..) functions. Initialized at 0.0000001.
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
INLINE Rall1d< T, V, S > atan2(const Rall1d< T, V, S > &y, const Rall1d< T, V, S > &x)
INLINE Rall1d< T, V, S > sqr(const Rall1d< T, V, S > &arg)
T length(const vec_base< T, Size > &a)
struct bConstraint * polarConstraint
iTaSC::MovingFrame * base
iTaSC::Armature * armature
std::vector< IK_Target * > targets
struct Depsgraph * bldepsgraph
unsigned short controlType
std::string constraintName
struct bPoseChannel * rootChannel
iTaSC::ConstraintSet * constraint
struct bConstraint * blenderConstraint
struct Depsgraph * bldepsgraph
ErrorCallback errorCallback
iTaSC::MovingFrame * target
struct bConstraint * next
struct bPoseChannel * parent
struct bPoseChannel * next
struct ConstraintSingleValue * values