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


C++ Real32函数代码示例

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


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

示例1: Inherited

CSMPerspectiveCameraBase::CSMPerspectiveCameraBase(void) :
    Inherited(),
    _sfEyeSeparation          (Real32(0.5f)),
    _sfZeroParallax           (Real32(10.0f)),
    _sfHeadBeacon             (NULL)
{
}
开发者ID:baibaiwei,项目名称:OpenSGDevMaster,代码行数:7,代码来源:OSGCSMPerspectiveCameraBase.cpp

示例2: main

int main(int argc, char** argv)
{

    try
    {
	const String NAMESPACE = "/ggg";

	SimpleDeclContext context;

	CIMClass x(CIMName ("X"));
	x.addProperty(CIMProperty(CIMName ("one"), Uint32(111)));
	x.addProperty(CIMProperty(CIMName ("two"), Real32(222.222)));
	x.addProperty(CIMProperty(CIMName ("three"), String("Three")));
	context.addClass(NAMESPACE, x);
	Resolver::resolveClass (x, &context, NAMESPACE);

	CIMClass y(CIMName ("Y"), CIMName ("X"));
	y.addProperty(CIMProperty(CIMName ("three"), String("Three - Three")));
	y.addProperty(CIMProperty(CIMName ("four"), Boolean(false)));
	y.addProperty(CIMProperty(CIMName ("five"), Real32(555.555)));
	context.addClass(NAMESPACE, y);
	Resolver::resolveClass (y, &context, NAMESPACE);

	// y.print();
    }
    catch (Exception& e)
    {
	cout << "Exception: " << e.getMessage() << endl;
    }

    cout << argv[0] << " +++++ passed all tests" << endl;

    return 0;
}
开发者ID:ncultra,项目名称:Pegasus-2.5,代码行数:34,代码来源:ValidateClass.cpp

示例3: getDecoratee

void OffsetCameraDecorator::getProjection( Matrix &result, 
                                         UInt32 width, UInt32 height)
{
    if(width == 0 || height == 0)
    {
        result.setIdentity();
        return;
    }

    CameraPtr camera = getDecoratee();
    if(camera == NullFC)
    {
        FWARNING(("OffsetCameraDecorator::getProjection: no decoratee!\n"));
        result.setIdentity();
        return;
    }

    if(getFullWidth() != 0)
        width = getFullWidth();

    if(getFullHeight() != 0)
        height = getFullHeight();

    camera->getProjection(result, width, height);

    Real32 x = getOffsetX() / Real32(width);
    Real32 y = getOffsetY() / Real32(height);

    Matrix sm(  1, 0, 0, x,
                0, 1, 0, y,
                0, 0, 1, 0, 
                0, 0, 0, 1);

    result.multLeft(sm);
}
开发者ID:mlimper,项目名称:OpenSG1x,代码行数:35,代码来源:OSGOffsetCameraDecorator.cpp

示例4: _sfForceCompressedData

ImageBase::ImageBase(void) :
    _mfParents                (), 
    _sfDimension              (Int32(0)), 
    _sfWidth                  (Int32(0)), 
    _sfHeight                 (Int32(1)), 
    _sfDepth                  (Int32(1)), 
    _sfBpp                    (Int32(1)), 
    _sfMipMapCount            (Int32(1)), 
    _sfFrameCount             (Int32(1)), 
    _sfFrameDelay             (Time(0)), 
    _sfPixelFormat            (UInt32(0)), 
    _mfPixel                  (), 
    _sfFrameSize              (Int32(0)), 
    _sfName                   (), 
    _sfDataType               (Int32(GL_UNSIGNED_BYTE)), 
    _sfComponentSize          (Int32(1)), 
    _sfSideCount              (Int32(1)), 
    _sfSideSize               (Int32(0)), 
    _sfForceCompressedData    (bool(false)), 
    _sfForceAlphaChannel      (bool(false)), 
    _sfForceColorChannel      (bool(false)), 
    _sfForceAlphaBinary       (bool(false)), 
    _sfResX                   (Real32(72.0f)), 
    _sfResY                   (Real32(72.0f)), 
    _sfResUnit                (UInt16(2)), 
    Inherited() 
{
}
开发者ID:mlimper,项目名称:OpenSG1x,代码行数:28,代码来源:OSGImageBase.cpp

示例5: setLastMousePos

void Manipulator::mouseButtonPress(const UInt16 button,
                                   const Int16  x,
                                   const Int16  y     )
{
    setLastMousePos(Pnt2f(Real32(x), Real32(y)));
    setActive(true);
}
开发者ID:Himbeertoni,项目名称:OpenSGDevMaster,代码行数:7,代码来源:OSGManipulator.cpp

示例6: Real32

bool Navigator::calcFromTo(Int16   x,     Int16   y,
                           Real32& fromX, Real32& fromY,
                           Real32& toX,   Real32& toY)
{
    Real32 width  = Real32(_vp->getPixelWidth());
    Real32 height = Real32(_vp->getPixelHeight());

    if(width <= 0 || height <= 0) return false;

    Window *par = _vp->getParent();
    Real32 winHeight;
    
    if(par != NULL)
        winHeight = Real32(par->getHeight());
    else
        winHeight = height;
        
    fromX = (2.0f * (_lastX - _vp->getPixelLeft())- width) /  width;
    fromY = (2.0f * (winHeight-_lastY-_vp->getPixelBottom())-height) / height;

    toX   = (2.0f * (x - _vp->getPixelLeft()) - width) / width;
    toY   = (2.0f * (winHeight - y - _vp->getPixelBottom()) - height) / height;

    return true;
}
开发者ID:Langkamp,项目名称:OpenSGDevMaster_Toolbox,代码行数:25,代码来源:OSGNavigator.cpp

示例7: Inherited

AnimChannelBase::AnimChannelBase(void) :
    Inherited(),
    _sfAnimation              (NULL),
    _sfWeight                 (Real32(1.f)),
    _sfInValue                (Real32(0.0))
{
}
开发者ID:baibaiwei,项目名称:OpenSGDevMaster,代码行数:7,代码来源:OSGAnimChannelBase.cpp

示例8: Inherited

GaussianNormalDistribution2DBase::GaussianNormalDistribution2DBase(void) :
    Inherited(),
    _sfMean                   (Pnt2f(0.0,0.0)),
    _sfStandardDeviationX     (Real32(1.0)),
    _sfStandardDeviationY     (Real32(1.0))
{
}
开发者ID:Himbeertoni,项目名称:OpenSGToolbox,代码行数:7,代码来源:OSGGaussianNormalDistribution2DBase.cpp

示例9: Inherited

OrthographicCameraBase::OrthographicCameraBase(void) :
    Inherited(),
    _sfVerticalSize           (),
    _sfHorizontalSize         (Real32(-1)),
    _sfAspect                 (Real32(1))
{
}
开发者ID:Himbeertoni,项目名称:OpenSGDevMaster,代码行数:7,代码来源:OSGOrthographicCameraBase.cpp

示例10: switch

	float ImageHeightDataSource::getHeightSample( const Pnt2i& samplePos ) const
	{
		// todo: replace this with a higher level clip:
		if( samplePos[ 0 ] < 0 || samplePos[ 0 ] >= size_[ 0 ] || 
			samplePos[ 1 ] < 0 || samplePos[ 1 ] >= size_[ 1 ] )
		{
			return 0.0f;
		}

		// todo: replace this calulation with incremental addition
		int index = ( image_->getWidth() * samplePos[ 1 ] + samplePos[ 0 ] );
	
		// todo: move this switch up higher.. (possibly into a template accessor??)
		switch( image_->getDataType() )
		{
		default:
		case Image::OSG_INVALID_IMAGEDATATYPE:
		case Image::OSG_UINT8_IMAGEDATA:
			return ( ( UInt8* )image_->getData() )[ index ] / Real32( TypeTraits< UInt8 >::getMax() );

		case Image::OSG_UINT16_IMAGEDATA:
			return ( ( UInt16* )image_->getData())[ index ] / Real32( TypeTraits< UInt16 >::getMax() );

		case Image::OSG_UINT32_IMAGEDATA:
			return ( ( UInt32* )image_->getData() )[ index ] / Real32( TypeTraits< UInt32 >::getMax() );

		case Image::OSG_FLOAT16_IMAGEDATA:
			return ( ( Real16* )image_->getData() )[ index ];

		case Image::OSG_FLOAT32_IMAGEDATA:
			return ( ( Real32* )image_->getData() )[ index ];
		};
		return 0.0f;
	}
开发者ID:chengzg,项目名称:OSGAddOnsGV,代码行数:34,代码来源:OSGImageHeightDataSource.cpp

示例11: Inherited

OffsetCameraDecoratorBase::OffsetCameraDecoratorBase(void) :
    _sfOffsetX                (Real32(0)), 
    _sfOffsetY                (Real32(0)), 
    _sfFullWidth              (UInt32(0)), 
    _sfFullHeight             (UInt32(0)), 
    Inherited() 
{
}
开发者ID:mlimper,项目名称:OpenSG1x,代码行数:8,代码来源:OSGOffsetCameraDecoratorBase.cpp

示例12: Inherited

ShaderShadowMapEngineBase::ShaderShadowMapEngineBase(void) :
    Inherited(),
    _sfShadowVertexProgram    (NULL),
    _sfShadowFragmentProgram  (NULL),
    _sfForceTextureUnit       (Int32(-1)),
    _sfShadowNear             (Real32(0.f)),
    _sfShadowFar              (Real32(0.f))
{
}
开发者ID:baibaiwei,项目名称:OpenSGDevMaster,代码行数:9,代码来源:OSGShaderShadowMapEngineBase.cpp

示例13: Inherited

DepthChunkBase::DepthChunkBase(void) :
    Inherited(),
    _sfEnable                 (bool(true)),
    _sfFunc                   (GLenum(GL_LEQUAL)),
    _sfNear                   (Real32(-1.f)),
    _sfFar                    (Real32(-1.f)),
    _sfReadOnly               (bool(false))
{
}
开发者ID:Himbeertoni,项目名称:OpenSGDevMaster,代码行数:9,代码来源:OSGDepthChunkBase.cpp

示例14: Inherited

FogChunkBase::FogChunkBase(void) :
    Inherited(),
    _sfMode                   (GLenum(GL_EXP)),
    _sfColor                  (Color4f(0.f, 0.f, 0.f, 0.f)),
    _sfStart                  (Real32(0.f)),
    _sfEnd                    (Real32(1.f)),
    _sfDensity                (Real32(1.f))
{
}
开发者ID:marcusl,项目名称:OpenSG,代码行数:9,代码来源:OSGFogChunkBase.cpp

示例15: Inherited

DVRIsoSurfaceBase::DVRIsoSurfaceBase(void) :
    _sfIsoValue               (Real32(0.1)), 
    _sfIsoThickness           (Real32(0.1)), 
    _sfIsoOpacity             (Real32(0.5)), 
    _sfAlphaMode              (UInt32(GL_GREATER)), 
    _sfSpecularLighting       (bool(true)), 
    Inherited() 
{
}
开发者ID:BackupTheBerlios,项目名称:opensgplus,代码行数:9,代码来源:OSGDVRIsoSurfaceBase.cpp


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