本文整理汇总了C++中b3Vector3::dot方法的典型用法代码示例。如果您正苦于以下问题:C++ b3Vector3::dot方法的具体用法?C++ b3Vector3::dot怎么用?C++ b3Vector3::dot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类b3Vector3
的用法示例。
在下文中一共展示了b3Vector3::dot方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: notExist
bool notExist(const b3Vector3& planeEquation,const b3AlignedObjectArray<b3Vector3>& planeEquations)
{
int numbrushes = planeEquations.size();
for (int i=0;i<numbrushes;i++)
{
const b3Vector3& N1 = planeEquations[i];
if (planeEquation.dot(N1) > b3Scalar(0.999))
{
return false;
}
}
return true;
}
示例2:
bool b3GeometryUtil::areVerticesBehindPlane(const b3Vector3& planeNormal, const b3AlignedObjectArray<b3Vector3>& vertices, b3Scalar margin)
{
int numvertices = vertices.size();
for (int i=0;i<numvertices;i++)
{
const b3Vector3& N1 = vertices[i];
b3Scalar dist = b3Scalar(planeNormal.dot(N1))+b3Scalar(planeNormal[3])-margin;
if (dist>b3Scalar(0.))
{
return false;
}
}
return true;
}
示例3: ComputeClosestPointsPlaneSphere
void ComputeClosestPointsPlaneSphere(const b3Vector3& planeNormalWorld, b3Scalar planeConstant, const b3Vector3& spherePosWorld,b3Scalar sphereRadius, plContactCache* contactCache)
{
if (contactCache->numAddedPoints < contactCache->pointCapacity)
{
lwContactPoint& pointOut = contactCache->pointsOut[contactCache->numAddedPoints];
b3Scalar t = -(spherePosWorld.dot(-planeNormalWorld)+planeConstant);
b3Vector3 intersectionPoint = spherePosWorld+t*-planeNormalWorld;
b3Scalar distance = t-sphereRadius;
if (distance<=0)
{
pointOut.m_distance = distance;
plVecCopy(pointOut.m_ptOnBWorld,intersectionPoint);
plVecCopy(pointOut.m_ptOnAWorld,spherePosWorld+sphereRadius*-planeNormalWorld);
plVecCopy(pointOut.m_normalOnB,planeNormalWorld);
contactCache->numAddedPoints++;
}
}
}