Moderators: Sascha Willems, walaber
ndAssert (ret.m_f[0] == ndFloor(m_f[0]));
-0.363887, -3.55271e-15, -0.630272
-0.363887, 0.273553, -0.630272
-0.727775, 2.11758e-22, 3.79982e-08
-0.727775, 0.273553, 3.79982e-08
-0.363887, 3.55271e-15, 0.630272
-0.363887, 0.273553, 0.630272
0.363887, 3.55271e-15, 0.630272
0.363887, 0.273553, 0.630272
0.727775, -4.23516e-22, -7.59964e-08
0.727775, 0.273553, -7.59964e-08
0.363887, -3.55271e-15, -0.630272
0.363887, 0.273553, -0.630272
void ndJointBilateralConstraint::CalculateLocalMatrix(const ndMatrix& globalMatrix, ndMatrix& localMatrix0, ndMatrix& localMatrix1) const
{
ndAssert(globalMatrix.TestOrthogonal());
localMatrix0 = globalMatrix * m_body0->GetMatrix().Inverse();
localMatrix1 = globalMatrix * m_body1->GetMatrix().Inverse();
}
void Mat4::MakeDir(const Vec3& dir, const int axis)
{
Vec3 ii, jj, kk;
switch (axis)
{
case 0:
ii = dir.Normalize();
jj = Vec3(0, 1, 0);
if (Abs(jj.Dot(ii)) > 0.5) jj = Vec3(0, 0, 1);
kk = ii.Cross(jj);
jj = -ii.Cross(kk);
break;
case 1:
jj = dir.Normalize();
ii = Vec3(1, 0, 0);
if (Abs(jj.Dot(ii)) > 0.5) ii = Vec3(0, 0, 1);
kk = jj.Cross(ii);
ii = -jj.Cross(kk);
break;
case 2:
kk = dir.Normalize();
ii = Vec3(1, 0, 0);
if (Abs(kk.Dot(ii)) > 0.5) ii = Vec3(0, 1, 0);
jj = kk.Cross(ii);
ii = -kk.Cross(jj);
break;
}
i.x = ii.x; i.y = ii.y; i.z = ii.z;
j.x = jj.x; j.y = jj.y; j.z = jj.z;
k.x = kk.x; k.y = kk.y; k.z = kk.z;
}
Julio Jerez wrote:On the assert, you have point that are on the order of 1e-15
And 1e-22
Those values can't be rounded but a simd instruction.
And that a good thing, because front ther that kind of object will have an almost infinite length as far as 32 int operation are concert.
JoshKlint wrote: case 0:
ii = dir.Normalize();
jj = Vec3(0, 1, 0);
if (Abs(jj.Dot(ii)) > 0.5) jj = Vec3(0, 0, 1);
kk = ii.Cross(jj);
Kk = kk.normalize()
jj = -ii.Cross(kk);
break;
case 1:
Julio Jerez wrote:The construction of the matrix is not normalizing the vertor perpendicular to the plane.
JoshKlint wrote:I always assumed the cross product of two normallized vectors would also be normalized, but I guess not.
Users browsing this forum: No registered users and 0 guests