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


C++ vector3::getAs4Values方法代码示例

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


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

示例1: ray_traverse

double controller::ray_traverse(vector3 const & direction) const
{
    float coords[4];
    direction.getAs4Values(coords);
    vector3 dir(coords[0] * cos(-rotation) - coords[2] * sin(-rotation),
                coords[1], 
                coords[0] * sin(-rotation) + coords[2] * cos(-rotation));
    boost::lock_guard<boost::mutex> lock(mutex_);
    core::line3d<f32> ray;
    ray.start = position_ + vector3(0, 5, 0);
    ray.end = position_  + vector3(0, 5, 0) + dir * 1000.0f;

    core::vector3df intersection;
    core::triangle3df hitTriangle;
    
    scene::ISceneNode * selectedSceneNode =
      collision_manager_->getSceneNodeAndCollisionPointFromRay(
        ray,
        intersection, // This will be the position of the collision
        hitTriangle, // This will be the triangle hit in the collision
        0, //IDFlag_IsPickable, // This ensures that only nodes that we have
                // set up to be pickable are considered
        0); // Check 
   return (intersection - position_).getLength();
}
开发者ID:finomen,项目名称:Ivan-Susanin,代码行数:25,代码来源:controller.cpp


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