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


C++ Pnt3f函数代码示例

本文整理汇总了C++中Pnt3f函数的典型用法代码示例。如果您正苦于以下问题:C++ Pnt3f函数的具体用法?C++ Pnt3f怎么用?C++ Pnt3f使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: extend

OSG_BASE_DLLMAPPING 
void extend(SphereVolume &srcVol, const CylinderVolume &vol)
{
    Pnt3f   min, max, min1, max1, min2, max2, c;
    Real32  r;

    if((!srcVol.isValid   () && !srcVol.isEmpty()) ||
         srcVol.isInfinite()                       ||
         srcVol.isStatic  ()                         )
    {
        return;
    }

    if(!vol.isValid())
        return;

    if(srcVol.isEmpty())
    {
        if(vol.isEmpty())
        {
            return;
        }
        else
        {
            vol.getBounds(min, max);
            vol.getCenter(c);

            r = (min - c).length();

            srcVol.setValue(c, r);

            return;
        }
    }
    else if(vol.isEmpty())
    {
        return;
    }

    srcVol.getBounds(min,  max);
    vol   .getBounds(min1, max1);

    min2 = Pnt3f(osgMin(min.x(), min1.x()), 
                 osgMin(min.y(), min1.y()),
                 osgMin(min.z(), min1.z()));

    max2 = Pnt3f(osgMax(max.x(), max1.x()), 
                 osgMax(max.y(), max1.y()),
                 osgMax(max.z(), max1.z()));

    c = Pnt3f((min2.x() + max2.x()) * 0.5f, 
              (min2.y() + max2.y()) * 0.5f,
              (min2.z() + max2.z()) * 0.5f);

    r = ((max2 - min2).length()) * 0.5f;

    srcVol.setValue(c, r);

    return;
}
开发者ID:mlimper,项目名称:OpenSG1x,代码行数:60,代码来源:OSGVolumeFunctions.cpp

示例2: sprintf

OSG_USING_NAMESPACE

Particles::Particles(std::string fileName, bool makeClone)
{
	int i;

	particleSystemInfo.pConfigFile = new char[512];
  	sprintf( (char *)particleSystemInfo.pConfigFile, "%s/effect.xml", fileName.c_str());
	particleSystemInfo.rUpdatesPerSecond = 30;
	particleSystemInfo.iRandomSeed = time( NULL );
	particleSystemInfo.rSynchronisationInterval = 1.0f;
	particleSystemInfo.iForwardThreshold = 50;
	pParticles = pCreateParticleSystem( particleSystemInfo );
//	delete particleSystemInfo.pConfigFile;

	particleNode = Node::create();
	particleModelNode = pParticles != 0 ? pParticles->pGetNodePtr() : Node::create();
// 	particleNode = pParticles != 0 ? pParticles->pGetNodePtr() : Node::create();

	Vec3f boundingBoxSize = pParticles->GetSize();
	
	particleTransNode = Node::create();
	particleTrans = Transform::create();

	particleModelTrans = Transform::create();
	
	Matrix m;
	m.setIdentity();
	beginEditCP(particleTrans, Transform::MatrixFieldMask);
		particleTrans->setMatrix(m);
	endEditCP(particleTrans, Transform::MatrixFieldMask);

	beginEditCP(particleModelTrans, Transform::MatrixFieldMask);
		particleModelTrans->setMatrix(m);
	endEditCP(particleModelTrans, Transform::MatrixFieldMask);

	beginEditCP(particleNode, Node::CoreFieldMask | Node::ChildrenFieldMask);
		particleNode->setCore(particleModelTrans);
		particleNode->addChild(particleModelNode);
	endEditCP(particleNode, Node::CoreFieldMask | Node::ChildrenFieldMask);
	
	beginEditCP(particleTransNode);
		particleTransNode->setCore(particleTrans);
		if (makeClone)
			particleTransNode->addChild(cloneTree(particleNode));
		else
			particleTransNode->addChild(particleNode);

		// set volume static to prevent constant update
		Volume &v = particleTransNode->getVolume( false ).getInstance();
		v.setEmpty();
		v.extendBy( Pnt3f( -boundingBoxSize[0], -boundingBoxSize[1], -boundingBoxSize[2] ) );
		v.extendBy( Pnt3f( boundingBoxSize[0], boundingBoxSize[1], boundingBoxSize[2] ) );
		v.setStatic();
		((DynamicVolume&)particleTransNode->getVolume()).instanceChanged();

	endEditCP(particleTransNode);

	cloned = false;
} // Particles
开发者ID:flair2005,项目名称:inVRs,代码行数:60,代码来源:Particles.cpp

示例3: Pnt3f

/*! Set the position and the orientation at once using a matrix.
*/
void FlyNavigator::set(Matrix new_matrix)
{
    _rFrom= Pnt3f(new_matrix[3]);
    _rAt  = Pnt3f(new_matrix[3] - new_matrix[2]);
    _vUp  = Vec3f(new_matrix[1]);
    set(_rFrom, _rAt, _vUp);
}
开发者ID:mlimper,项目名称:OpenSG1x,代码行数:9,代码来源:OSGFlyNavigator.cpp

示例4: createSizeDistribution

Distribution3DRefPtr createSizeDistribution(void)
{
    LineDistribution3DRefPtr TheLineDistribution = LineDistribution3D::create();
      TheLineDistribution->setPoint1(Pnt3f(3.0,3.0,3.0));
      TheLineDistribution->setPoint2(Pnt3f(1.0,1.0,1.0));

	return TheLineDistribution;
}
开发者ID:danguilliams,项目名称:OpenSGToolbox,代码行数:8,代码来源:02DynamicDistributions.cpp

示例5: createColorDistribution

Distribution3DRefPtr createColorDistribution(void)
{
    LineDistribution3DRefPtr TheLineDistribution = LineDistribution3D::create();
    TheLineDistribution->setPoint1(Pnt3f(0.5,0.5,0.5));
    TheLineDistribution->setPoint2(Pnt3f(1.0,1.0,1.0));

    return TheLineDistribution;
}
开发者ID:danguilliams,项目名称:OpenSGToolbox,代码行数:8,代码来源:02ParticleSysParticleTrailGenerator.cpp

示例6: createSmokeColorDistribution

Distribution3DRefPtr createSmokeColorDistribution(void)
{
    //Line Distribution
    LineDistribution3DRefPtr TheLineDistribution = LineDistribution3D::create();
    TheLineDistribution->setPoint1(Pnt3f(0.0,0.0,0.0));
    TheLineDistribution->setPoint2(Pnt3f(0.15,0.15,0.15));

    return TheLineDistribution;
}
开发者ID:ahuballah,项目名称:OpenSGToolbox,代码行数:9,代码来源:06Explosion.cpp

示例7: createSizeDistribution

Distribution3DRecPtr createSizeDistribution(void)
{
    //Line Distribution
    LineDistribution3DRefPtr TheLineDistribution = LineDistribution3D::create();
    TheLineDistribution->setPoint1(Pnt3f(1.2,1.2,1.0));
    TheLineDistribution->setPoint2(Pnt3f(1.4,1.4,1.0));

    return TheLineDistribution;
}
开发者ID:ahuballah,项目名称:OpenSGToolbox,代码行数:9,代码来源:06Explosion.cpp

示例8: createAccelerationDistribution

Distribution3DRefPtr createAccelerationDistribution(void)
{
    //Line Distribution
    LineDistribution3DRefPtr TheLineDistribution = LineDistribution3D::create();
    TheLineDistribution->setPoint1(Pnt3f(0.0,0.0,0.0));
    TheLineDistribution->setPoint2(Pnt3f(0.0,0.0,0.0));

    return TheLineDistribution;
}
开发者ID:Langkamp,项目名称:OpenSGToolbox,代码行数:9,代码来源:04BurstParticleGenerator.cpp

示例9: Inherited

CSMSceneParameterBase::CSMSceneParameterBase(void) :
    Inherited(),
    _sfSceneRef               (NULL),
    _sfDistScale              (Real32(1.f)),
    _sfSceneDiag              (Vec3f(1.f)),
    _sfInitViewPos            (Pnt3f(1.f)),
    _sfSceneCenter            (Pnt3f(1.f))
{
}
开发者ID:Langkamp,项目名称:OpenSGDevMaster_Toolbox,代码行数:9,代码来源:OSGCSMSceneParameterBase.cpp

示例10: createSizeDistribution

Distribution3DRefPtr createSizeDistribution(void)
{
    //Sphere Distribution
    LineDistribution3DRefPtr TheLineDistribution = LineDistribution3D::create();
    TheLineDistribution->setPoint1(Pnt3f(5.0,5.0,1.0));
    TheLineDistribution->setPoint2(Pnt3f(10.0,10.0,1.0));

    return TheLineDistribution;
}
开发者ID:rdgoetz,项目名称:OpenSGToolbox,代码行数:9,代码来源:07AgeSizeParticleAffector.cpp

示例11: createVelocityDistribution

Distribution3DRefPtr createVelocityDistribution(void)
{
    //Line Distribution, no velocity
    LineDistribution3DRefPtr TheLineDistribution = LineDistribution3D::create();
    TheLineDistribution->setPoint1(Pnt3f(0.0,0.0,0.0));
    TheLineDistribution->setPoint2(Pnt3f(0.0,0.0,0.0));

    return TheLineDistribution;
}
开发者ID:danguilliams,项目名称:OpenSGToolbox,代码行数:9,代码来源:14ParticleSorting.cpp

示例12: createSizeDistribution

Distribution3DRefPtr createSizeDistribution(void)
{
    //Line Distribution
    LineDistribution3DRefPtr TheLineDistribution = LineDistribution3D::create();
    TheLineDistribution->setPoint1(Pnt3f(4.45,4.45,4.45));
    TheLineDistribution->setPoint2(Pnt3f(4.45,4.45,4.45));

    return TheLineDistribution;
}
开发者ID:danguilliams,项目名称:OpenSGToolbox,代码行数:9,代码来源:02ParticleSysParticleTrailGenerator.cpp

示例13: createTrailSizeDistribution

Distribution3DRefPtr createTrailSizeDistribution(void)
{
    //Line Distribution
    LineDistribution3DRefPtr TheLineDistribution = LineDistribution3D::create();
    TheLineDistribution->setPoint1(Pnt3f(2.0,2.0,2.0));
    TheLineDistribution->setPoint2(Pnt3f(2.5,2.5,2.5));

    return TheLineDistribution;
}
开发者ID:danguilliams,项目名称:OpenSGToolbox,代码行数:9,代码来源:02ParticleSysParticleTrailGenerator.cpp

示例14: createPositionDistribution

Distribution3DRefPtr createPositionDistribution(void)
{
    LineDistribution3DRefPtr TheLineDistribution = LineDistribution3D::create();
    TheLineDistribution->setPoint1(Pnt3f(0.0f,0.0f,0.0f));
    TheLineDistribution->setPoint2(Pnt3f(0.1f,0.0f,0.0f));


    return TheLineDistribution;
}
开发者ID:Langkamp,项目名称:OpenSGToolbox,代码行数:9,代码来源:28ConserveVelocityParticleAffector.cpp

示例15: createSmokeVelocityDistribution

Distribution3DRefPtr createSmokeVelocityDistribution(void)
{
    //Sphere Distribution
    LineDistribution3DRefPtr TheLineDistribution = LineDistribution3D::create();
    TheLineDistribution->setPoint1(Pnt3f(0.0,1.0,1.0));
    TheLineDistribution->setPoint2(Pnt3f(0.0,1.0,3.0));

    return TheLineDistribution;
}
开发者ID:Himbeertoni,项目名称:OpenSGToolbox,代码行数:9,代码来源:20RocketLauncher.cpp


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