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


C++ Ray::intersectionTime方法代码示例

本文整理汇总了C++中g3d::Ray::intersectionTime方法的典型用法代码示例。如果您正苦于以下问题:C++ Ray::intersectionTime方法的具体用法?C++ Ray::intersectionTime怎么用?C++ Ray::intersectionTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在g3d::Ray的用法示例。


在下文中一共展示了Ray::intersectionTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: intersectRay

bool GameObjectModel::intersectRay(const G3D::Ray& ray, float& MaxDist, bool StopAtFirstHit, uint32 ph_mask) const
{
    if (!(phasemask & ph_mask) || !owner->isSpawned())
        return false;

    float time = ray.intersectionTime(iBound);
    if (time == G3D::inf())
        return false;

    // child bounds are defined in object space:
    Vector3 p = iInvRot * (ray.origin() - iPos) * iInvScale;
    Ray modRay(p, iInvRot * ray.direction());
    float distance = MaxDist * iInvScale;
    bool hit = iModel->IntersectRay(modRay, distance, StopAtFirstHit);
    if (hit)
    {
        distance *= iScale;
        MaxDist = distance;
    }
    return hit;
}
开发者ID:redlaine,项目名称:InfinityCore-Ark,代码行数:21,代码来源:GameObjectModel.cpp

示例2: intersectRay

bool ModelInstance::intersectRay(const G3D::Ray& pRay, float& pMaxDist, bool pStopAtFirstHit) const
{
    if (!iModel)
        return false;

    float time = pRay.intersectionTime(iBound);
    if (time == G3D::inf())
        return false;

    // child bounds are defined in object space:
    Vector3 p = iInvRot * (pRay.origin() - iPos) * iInvScale;
    Ray modRay(p, iInvRot * pRay.direction());
    float distance = pMaxDist * iInvScale;
    bool hit = iModel->IntersectRay(modRay, distance, pStopAtFirstHit);
    if (hit)
    {
        distance *= iScale;
        pMaxDist = distance;
    }
    return hit;
}
开发者ID:Phentora,项目名称:OregonCore,代码行数:21,代码来源:ModelInstance.cpp

示例3: intersectRay

bool GameObjectModel::intersectRay(G3D::Ray const& ray, float& maxDist, bool stopAtFirstHit, PhaseShift const& phaseShift, VMAP::ModelIgnoreFlags ignoreFlags) const
{
    if (!isCollisionEnabled() || !owner->IsSpawned())
        return false;

    if (!owner->IsInPhase(phaseShift))
        return false;

    float time = ray.intersectionTime(iBound);
    if (time == G3D::finf())
        return false;

    // child bounds are defined in object space:
    Vector3 p = iInvRot * (ray.origin() - iPos) * iInvScale;
    Ray modRay(p, iInvRot * ray.direction());
    float distance = maxDist * iInvScale;
    bool hit = iModel->IntersectRay(modRay, distance, stopAtFirstHit, ignoreFlags);
    if (hit)
    {
        distance *= iScale;
        maxDist = distance;
    }
    return hit;
}
开发者ID:welder1976,项目名称:TrinityCore,代码行数:24,代码来源:GameObjectModel.cpp


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