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


C++ Point3F::convolveInverse方法代码示例

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


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

示例1: processTick

void SoftBody::processTick(const Move* move)
{     
	if (m_stopSimulation)
		return;
	Parent::processTick(move);
	int nodesNum = m_physShapeSoft ? m_physShapeSoft->getNodesNum() : 0;
	if (nodesNum>0)
	{
		//update obj box
		mObjBox.minExtents.set( 10E30f, 10E30f, 10E30f);
		mObjBox.maxExtents.set(-10E30f,-10E30f,-10E30f);
		for (U32 i=0; i < nodesNum; i++)
		{
			Point3F physVertex = m_physShapeSoft->getNodePos(i);
			mRenderWorldToObj.mulP(physVertex);
			physVertex.convolveInverse(mObjScale);
			mObjBox.minExtents.setMin(physVertex);
			mObjBox.maxExtents.setMax(physVertex);
		}
	}
}
开发者ID:Bloodknight,项目名称:GMK,代码行数:21,代码来源:softBody.cpp

示例2: prepBatchRender

void SoftBody::prepBatchRender(SceneRenderState* state, S32 mountedImageIndex )
{
	if (!m_physShapeSoft || m_physShapeSoft->getNodesNum()==0 || gFreezeSim || m_stopSimulation)
	{
		Parent::prepBatchRender(state,mountedImageIndex);
		return;
	}

	TSShapeInstance* shapeInst = getShapeInstance();

	S32 dl = 0;
	const TSShape* shape = getShape();
	const TSDetail * detail = &shape->details[dl];
	S32 ss = detail->subShapeNum;
	S32 od = detail->objectDetailNum;

	U32 vertexStride = shape->getVertexSize();

	S32 start = shape->subShapeFirstObject[ss];
	S32 end   = shape->subShapeNumObjects[ss] + start;
	int physVertexIdx = 0;
	
	for (S32 i=start; i<end; i++)
	{
		TSShapeInstance::MeshObjectInstance* meshOI = &shapeInst->mMeshObjects[i];
		
		if (od >= meshOI->object->numMeshes)
			continue;
		TSMesh* mesh = meshOI->getMesh(od);
		if (mesh)
		{
			mesh->setManualDynamic(true);
			TSVertexBufferHandle& vb = meshOI->mVertexBuffer;
			if (vb == NULL)
				mesh->createVBIB(vb);

			
			U8 *vertData = (U8*)vb.lock();
			
			for(size_t i = 0;i<mesh->mNumVerts;i++)
			{
				Point3F physVertex = m_physShapeSoft->getNodePos(m_vertexBindingVec[physVertexIdx++]);
				//transform into local coordinates
				mRenderWorldToObj.mulP(physVertex);
				physVertex.convolveInverse(mObjScale);
	
				*((Point3F*)vertData) = physVertex;
				vertData += vertexStride;
			}
			
			vb.unlock();
			
		}
	}
	
	Parent::prepBatchRender(state,mountedImageIndex);

	for (S32 i=start; i<end; i++)
	{
		TSShapeInstance::MeshObjectInstance* meshOI = &shapeInst->mMeshObjects[i];
		if (od >= meshOI->object->numMeshes)
			continue;
		TSMesh* mesh = meshOI->getMesh(od);
		if (mesh)
			mesh->setManualDynamic(false);
	}
	
}
开发者ID:Bloodknight,项目名称:GMK,代码行数:68,代码来源:softBody.cpp


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