本文整理汇总了C++中Plane3D::project方法的典型用法代码示例。如果您正苦于以下问题:C++ Plane3D::project方法的具体用法?C++ Plane3D::project怎么用?C++ Plane3D::project使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plane3D
的用法示例。
在下文中一共展示了Plane3D::project方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetClosestGoalTransform
void IKGoal::GetClosestGoalTransform(const RigidTransform& T0,RigidTransform& T) const
{
//fill out rotation first
if(rotConstraint == RotFixed) {
GetFixedGoalRotation(T.R);
}
else if(rotConstraint == RotAxis) {
//T.R*localAxis = endRotation
GetMinimalRotation(localAxis,T0.R*endRotation,T.R);
//make it so orthogonal directions perform a rotation similar to T0.R
Vector3 lx,ly,rx,ry,refx;
GetCanonicalBasis(localAxis,lx,ly);
rx = T.R*rx;
ry = T.R*ry;
refx = T0.R*lx;
Real x = dot(refx,rx);
Real y = dot(refx,ry);
//find the rotation about endRotation that gets closer to this
Real theta = Atan2(y,x);
AngleAxisRotation aa;
aa.angle = theta;
aa.axis = T0.R*endRotation;
Matrix3 Rrot;
aa.getMatrix(Rrot);
T.R = Rrot*T.R;
}
else
T.R = T0.R;
T.t = endPosition - T.R*localPosition;
if(posConstraint == PosPlanar) {
//find closest transform on plane to T0.t
Plane3D p;
p.setPointNormal(T.t,direction);
p.project(T0.t,T.t);
}
else if(posConstraint == PosLinear) {
//find closest transform on line to T0.t
Line3D line;
line.source = T.t;
line.direction = direction;
line.closestPoint(T0.t,T.t);
}
else if(posConstraint == PosNone)
T.t = T0.t;
}