本文整理汇总了C++中IntersectAction::getMaxDist方法的典型用法代码示例。如果您正苦于以下问题:C++ IntersectAction::getMaxDist方法的具体用法?C++ IntersectAction::getMaxDist怎么用?C++ IntersectAction::getMaxDist使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IntersectAction
的用法示例。
在下文中一共展示了IntersectAction::getMaxDist方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: intersectEnter
ActionBase::ResultE Joint::intersectEnter(Action *action)
{
// Use parent class for trivial reject
if(Inherited::intersect(action) == Action::Skip)
return Action::Skip;
// Need to check children
IntersectAction *ia = dynamic_cast<IntersectAction *>(action);
Matrix m = this->getMatrix();
m.mult(this->getJointTransformation());
m.invert();
Pnt3f pos;
Vec3f dir;
m.multFull(ia->getLine().getPosition (), pos);
m.mult (ia->getLine().getDirection(), dir);
Real32 length = dir.length();
if(length < TypeTraits<Real32>::getDefaultEps())
SWARNING << "Joint::intersectEnter: Near-zero scale!" << std::endl;
ia->setLine(Line(pos, dir), ia->getMaxDist());
ia->scale (length );
return ActionBase::Continue;
}
示例2: transformLeave
Action::ResultE transformLeave(CNodePtr& node, Action * action)
{
IntersectAction * ia = dynamic_cast<IntersectAction*>(action);
NodePtr n( node );
Transform* core = dynamic_cast<Transform*>(get_pointer(n->getCore()));
Matrix &m = core->editMatrix();
Pnt3f pos;
Vec3f dir;
m.multFull(ia->getLine().getPosition (), pos);
m.mult (ia->getLine().getDirection(), dir);
ia->setLine( Line( pos, dir ), ia->getMaxDist() );
return Action::Continue;
}
示例3: intersectLeave
Action::ResultE InverseTransform::intersectLeave(Action *action)
{
IntersectAction *ia = dynamic_cast<IntersectAction *>(action);
Matrix m(_invWorld);
Pnt3f pos;
Vec3f dir;
m.multFull(ia->getLine().getPosition (), pos);
m.mult (ia->getLine().getDirection(), dir);
ia->setLine(Line(pos, dir), ia->getMaxDist());
ia->scale(dir.length());
return Action::Continue;
}
示例4: intersectLeave
ActionBase::ResultE Joint::intersectLeave(Action *action)
{
IntersectAction *ia = dynamic_cast<IntersectAction *>(action);
Matrix m = this->getMatrix();
m.mult(this->getJointTransformation());
Pnt3f pos;
Vec3f dir;
m.multFull(ia->getLine().getPosition (), pos);
m.mult (ia->getLine().getDirection(), dir);
ia->setLine(Line(pos, dir), ia->getMaxDist());
ia->scale(dir.length());
return ActionBase::Continue;
}
示例5: intersectEnter
Action::ResultE SkeletonBlendedGeometry::intersectEnter(Action *action)
{
IntersectAction *ia = dynamic_cast<IntersectAction *>(action);
Matrix m(_invWorld);
m.invert();
Pnt3f pos;
Vec3f dir;
m.multFull(ia->getLine().getPosition (), pos);
m.mult (ia->getLine().getDirection(), dir);
ia->setLine(Line(pos, dir), ia->getMaxDist());
ia->scale(dir.length());
return Inherited::intersectEnter(action);
}
示例6: intersectEnter
Action::ResultE ScreenGroup::intersectEnter(Action *action)
{
IntersectAction *ia = dynamic_cast<IntersectAction *>(action);
Matrix m(_camTransform);
m.invert();
Pnt3f pos;
Vec3f dir;
m.multFull(ia->getLine().getPosition (), pos);
m.mult (ia->getLine().getDirection(), dir);
ia->setLine(Line(pos, dir), ia->getMaxDist());
ia->scale(dir.length());
return Action::Continue;
}
示例7: intersectIntersectKDTree
/* virtual */ Action::ResultE
KDTreeIntersectProxyAttachment::intersectEnter(Node *node, Action *action)
{
Action::ResultE res = Inherited::intersectEnter(node, action);
IntersectAction *iact =
boost::polymorphic_downcast<IntersectAction *>(action);
Real32 closestHitT = iact->didHit() ? iact->getHitT() : iact->getMaxDist();
Vec3f hitNormal;
UInt32 hitTriangle;
if(_mfTreeNodes.empty() == false)
{
UInt32 numTris = 0;
bool hit = intersectIntersectKDTree(iact->getLine(),
node->getVolume(),
_sfGeometry.getValue(),
&_mfTreeNodes,
&_mfTriIndices,
closestHitT,
hitNormal,
hitTriangle,
&numTris );
if(hit == true)
{
iact->setHit(closestHitT,
node,
hitTriangle,
hitNormal, 0);
}
iact->getStatCollector()->getElem(
IntersectAction::statNTriangles)->add(numTris);
}
else
{
// tree was empty - skip this proxy and use conventional
// intersect
res = Action::Continue;
}
return res;
}