本文整理汇总了C++中Matrix34::Transform方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix34::Transform方法的具体用法?C++ Matrix34::Transform怎么用?C++ Matrix34::Transform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix34
的用法示例。
在下文中一共展示了Matrix34::Transform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
static unsigned GetAABox2EdgeIntersectionPoints( TCFixedVector<Vector3,MAX_CONTACTS_PER_BOX_PAIR> &pts,
const Vector3& vSides,
const CJL_Box& rBox,
const Vector3& vEdgePt0,
const Vector3& vEdgePt1,
const Matrix34& rOrigBoxPose,
Scalar combination_dist_sq )
{
unsigned num = 0;
for( unsigned iDir = 3; iDir-- != 0 ; )
{
const unsigned jDir = (iDir + 1) % 3;
const unsigned kDir = (iDir + 2) % 3;
// one plane goes through the origin, one is offset
// const Scalar face_offset[] = {0.0f, vSides[iDir]};
const Scalar face_offset[] = { -vSides[iDir] * 0.5f, vSides[iDir] * 0.5f };
for( unsigned iFace = 2; iFace-- != 0 ; )
{
// distance of each point from to the plane
const Scalar dist0 = vEdgePt0[iDir] - face_offset[iFace];
const Scalar dist1 = vEdgePt1[iDir] - face_offset[iFace];
Scalar frac = -1.0f;
if( dist0 * dist1 < -SCALAR_TINY )
frac= -dist0 / (dist1 - dist0);
// else if(fabsf(dist0) < SCALAR_TINY )
else if(fabsf(dist0) < SCALAR_TINY )
frac = 0.0f;
else if( fabsf(dist1) < SCALAR_TINY )
frac = 1.0f;
if( 0.0f <= frac )
{
assert( frac <= 1.0f );
Vector3 vP = (1.0f - frac) * vEdgePt0 + frac * vEdgePt1;
// check the point is within the face rectange
// if( (-SCALAR_TINY < vP[jDir]) && (vP[jDir] < vSides[jDir] + SCALAR_TINY) &&
// (-SCALAR_TINY < vP[kDir]) && (vP[kDir] < vSides[kDir] + SCALAR_TINY) )
Scalar side_j = vSides[jDir] * 0.5f;
Scalar side_k = vSides[kDir] * 0.5f;
if( (-SCALAR_TINY - side_j < vP[jDir]) && (vP[jDir] < side_j + SCALAR_TINY) &&
(-SCALAR_TINY - side_k < vP[kDir]) && (vP[kDir] < side_k + SCALAR_TINY) )
{
// got a point
Vector3 vPos;
rOrigBoxPose.Transform( vPos, vP );
AddPoint(pts, vPos, combination_dist_sq);
// pts.push_back(vPos);
if( ++num == 2 )
return num;
}
}
}
}
return num;
}