本文整理汇总了C++中Pnt3f函数的典型用法代码示例。如果您正苦于以下问题:C++ Pnt3f函数的具体用法?C++ Pnt3f怎么用?C++ Pnt3f使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Pnt3f函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: Pnt3f
// Represents a parametric line
Ray::Ray(const Pnt3f& _e, const Vec3f& _d, float _min, float _max)
{
e = Pnt3f(_e);
d = Vec3f(_d);
min = _min;
max = _max;
// Cache this to optimize bbox calculations
multInverseDir = Pnt3f(1.0f / d.x, 1.0f / d.y, 1.0f / d.z);
}
开发者ID:ecattell,项目名称:CattellRT,代码行数:11,代码来源:Ray.cpp
示例17: createPositionDistribution
Distribution3DRefPtr createPositionDistribution(void)
{
BoxDistribution3DRefPtr TheBoxDistribution = BoxDistribution3D::create();
TheBoxDistribution->setMinPoint(Pnt3f(-10.0f,-10.0f,-10.0f));
TheBoxDistribution->setMaxPoint(Pnt3f(10.0f,10.0f,10.0f));
TheBoxDistribution->setSurfaceOrVolume(BoxDistribution3D::VOLUME);
return TheBoxDistribution;
}
开发者ID:achvas88,项目名称:OpenSGToolbox,代码行数:10,代码来源:19UniformFieldParticleAffector.cpp
示例18: resetPoints
// provide a default set of points
void World::resetPoints()
{
points.clear();
points.push_back(ControlPoint(Pnt3f(50,5,0)));
points.push_back(ControlPoint(Pnt3f(0,5,50)));
points.push_back(ControlPoint(Pnt3f(-50,5,0)));
points.push_back(ControlPoint(Pnt3f(0,5,-50)));
// we had better put the train back at the start of the track...
trainU = 0.0;
}
开发者ID:yezhizhen,项目名称:OpenGL,代码行数:12,代码来源:World.cpp
示例19: getProjection
bool Camera::calcViewRay( Line &line,
Int32 x,
Int32 y,
const Viewport &port,
Real32 *t )
{
if(port.getPixelWidth() <= 0 || port.getPixelHeight() <= 0)
{
return false;
}
Matrix proj, projtrans, view;
getProjection(proj,
port.getPixelWidth(),
port.getPixelHeight());
getProjectionTranslation(projtrans,
port.getPixelWidth(),
port.getPixelHeight());
getViewing(view,
port.getPixelWidth(),
port.getPixelHeight());
Matrix wctocc = proj;
wctocc.mult(projtrans);
wctocc.mult(view);
Matrix cctowc;
cctowc.invertFrom(wctocc);
Real32 rx(0.f), ry(0.f);
port.getNormalizedCoordinates(rx, ry, x, y);
Pnt3f from, at;
cctowc.multFull(Pnt3f(rx, ry, -1), from);
cctowc.multFull(Pnt3f(rx, ry, 1), at );
Vec3f dir = at - from;
if(t != NULL)
{
*t = dir.length();
}
line.setValue(from, dir);
return true;
}
开发者ID:DaveHarrison,项目名称:OpenSGDevMaster,代码行数:53,代码来源:OSGCamera.cpp
示例20: osgMax
void SpaceNavigatorSSM::showAll(void)
{
if(_root == NullFC)
return;
_root->updateVolume();
Vec3f min,max;
_root->getVolume().getBounds( min, max );
Vec3f d = max - min;
if(d.length() < Eps) // Nothing loaded? Use a unity box
{
min.setValues(-1.f,-1.f,-1.f);
max.setValues( 1.f, 1.f, 1.f);
d = max - min;
}
SpaceNavigatorOSGClient::Instance()->setTranslationFactorToSceneSize(_root);
bool zUpAxis = SpaceNavigatorOSGClient::Instance()->getZUpAxis();
Real32 dist;
if(zUpAxis)
dist = osgMax(d[0],d[2]) / (2 * osgtan(_camera->getFov() / 2.f));
else
dist = osgMax(d[0],d[1]) / (2 * osgtan(_camera->getFov() / 2.f));
// get the correct up axis
Vec3f up = getNavigator()->getUp();
Pnt3f at;
if(zUpAxis)
at = Pnt3f((min[0] + max[0]) * .5f,(min[2] + max[2]) * .5f,(min[1] + max[1]) * .5f);
else
at = Pnt3f((min[0] + max[0]) * .5f,(min[1] + max[1]) * .5f,(min[2] + max[2]) * .5f);
Pnt3f from=at;
if(zUpAxis)
from[1]+=(dist+fabs(max[1]-min[1])*0.5f);
else
from[2]+=(dist+fabs(max[2]-min[2])*0.5f);
_navigator.set(from,at,up);
// set the camera to go from 1% of the object to twice its size
Real32 diag = osgMax(osgMax(d[0], d[1]), d[2]);
beginEditCP(_camera);
_camera->setNear (diag / 100.f);
_camera->setFar (10 * diag);
endEditCP(_camera);
}
开发者ID:ufz-vislab,项目名称:vislab,代码行数:50,代码来源:SpaceNavigatorSSM.cpp
注:本文中的Pnt3f函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论