本文整理汇总了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);
}
示例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);
}
示例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();
}