当前位置: 首页>>代码示例>>C++>>正文


C++ IntersectAction::getMaxDist方法代码示例

本文整理汇总了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; 
}
开发者ID:msteners,项目名称:OpenSGToolbox,代码行数:29,代码来源:OSGJoint.cpp

示例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; 
}
开发者ID:mlimper,项目名称:OpenSG1x,代码行数:15,代码来源:testIntersectActionRender.cpp

示例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;
}
开发者ID:Himbeertoni,项目名称:OpenSGDevMaster,代码行数:16,代码来源:OSGInverseTransform.cpp

示例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;
}
开发者ID:msteners,项目名称:OpenSGToolbox,代码行数:17,代码来源:OSGJoint.cpp

示例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);
}
开发者ID:Himbeertoni,项目名称:OpenSGToolbox,代码行数:18,代码来源:OSGSkeletonBlendedGeometry.cpp

示例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;
}
开发者ID:DaveHarrison,项目名称:OpenSGDevMaster,代码行数:18,代码来源:OSGScreenGroup.cpp

示例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;
}
开发者ID:Himbeertoni,项目名称:OpenSGDevMaster,代码行数:44,代码来源:OSGKDTreeIntersectProxyAttachment.cpp


注:本文中的IntersectAction::getMaxDist方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。