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


C++ CFrame::pointToWorldSpace方法代码示例

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


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

示例1: transformToWorldSpace

void Surfel::transformToWorldSpace(const CFrame& xform) {
    position = xform.pointToWorldSpace(position);
    geometricNormal = xform.vectorToWorldSpace(geometricNormal);
    shadingNormal   = xform.vectorToWorldSpace(shadingNormal);
    shadingTangent1 = xform.vectorToWorldSpace(shadingTangent1);
    shadingTangent2 = xform.vectorToWorldSpace(shadingTangent2);
}
开发者ID:jackpoz,项目名称:G3D-backup,代码行数:7,代码来源:Surfel.cpp

示例2: sortAndUploadIndices

void ParticleSurface::sortAndUploadIndices(shared_ptr<ParticleSurface> particleSurface, const Vector3& csz) {
    ParticleSystem::s_sortArray.fastClear();
    
    shared_ptr<ParticleSystem::Block> block = particleSurface->m_block;
    shared_ptr<ParticleSystem> particleSystem = block->particleSystem.lock();
    for (int i = 0; i < particleSystem->m_particle.size(); ++i) {
        const ParticleSystem::Particle& particle = particleSystem->m_particle[i];
        CFrame cframe;
        particleSurface->getCoordinateFrame(cframe);
        const Point3& wsPosition = particleSystem->particlesAreInWorldSpace() ?
            particle.position :
            cframe.pointToWorldSpace(particle.position);
        const float particleCSZ = dot(wsPosition, csz);

        ParticleSystem::SortProxy proxy;
        proxy.index = block->startIndex + i;
        proxy.z = particleCSZ;
        ParticleSystem::s_sortArray.append(proxy);
    }
    ParticleSystem::s_sortArray.sort(SORT_DECREASING);
    ParticleSystem::ParticleBuffer& pBuffer = ParticleSystem::s_particleBuffer;
    bool needsReallocation = true;
    if (pBuffer.indexStream.valid() &&
        (pBuffer.indexStream.maxSize() >= size_t(ParticleSystem::s_sortArray.size()))) {
        needsReallocation = false;
    }

    if (needsReallocation) {
        int numToAllocate = ParticleSystem::s_sortArray.size() * 2;
        shared_ptr<VertexBuffer> vb = VertexBuffer::create(sizeof(int) * numToAllocate + 8);
        int ignored;
        pBuffer.indexStream = IndexStream(ignored, numToAllocate, vb);
    }
    static Array<int> sortedIndices;
    sortedIndices.fastClear();
    for (const ParticleSystem::SortProxy& p : ParticleSystem::s_sortArray) {
        sortedIndices.append(p.index);
    }
    pBuffer.indexStream.update(sortedIndices);
}
开发者ID:elfprince13,项目名称:G3D10,代码行数:40,代码来源:ParticleSurface.cpp

示例3: computeAxes

Box2D::Box2D(const CFrame& frame, Box2D& b) {
    for (int i = 0; i < 4; ++i) {
        m_corner[i] = frame.pointToWorldSpace(Vector3(b.corner(i), 0)).xy();
    }
    computeAxes();
}
开发者ID:Cryptoh,项目名称:server,代码行数:6,代码来源:Box2D.cpp


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