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


C++ GetScale函数代码示例

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


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

示例1: sRect

sRect CCBFrameLook::GetClientRect(CCFrame* pFrame, sRect& r)
{
    if(GetCustomLook() == 1)
    {
        int al = FRAME_OUTLINE_WIDTH+FRAME_WIDTH+FRAME_INLINE_WIDTH+RECT_DEFAULT_SPACE;
        int au = m_pFrameBitmaps[7]->GetHeight() + FRAME_OUTLINE_WIDTH + FRAME_INLINE_WIDTH+RECT_DEFAULT_SPACE;
        return sRect(r.x+al, r.y+au, r.w-(al*2), r.h-(al+au));
    }
    if( GetCustomLook() == 2 )
    {
#define CUSTOM2_FRAME_OFFSET_WIDTH 2
#define CUSTOM2_FRAME_OFFSET_HEIGHT 10
        return sRect(r.x + CUSTOM2_FRAME_OFFSET_WIDTH, r.y + CUSTOM2_FRAME_OFFSET_HEIGHT , r.w - 2 * CUSTOM2_FRAME_OFFSET_WIDTH, r.h - 2 * CUSTOM2_FRAME_OFFSET_HEIGHT);
    }
    else
    {
        if(IsNull(m_pFrameBitmaps, FRAME_BITMAP_COUNT)==true) return r;

        float fScale = GetScale();
        int al = (int)(fScale * m_pFrameBitmaps[3]->GetWidth());
        int au = (int)(fScale * m_pFrameBitmaps[7]->GetHeight());
        int ar = (int)(fScale * m_pFrameBitmaps[5]->GetWidth());
        int ab = (int)(fScale * m_pFrameBitmaps[1]->GetHeight());
        return sRect(r.x+al, r.y+au, r.w-(al+ar), r.h-(au+ab));
    }
}
开发者ID:Kallontz,项目名称:gunz-the-tps-mmorpg,代码行数:26,代码来源:CCBFrameLook.cpp

示例2: NNode

NStar::NStar() : NNode(NodeStar)
{
    Texture = NULL;
    Changed = true;
    glGenBuffers(2,Buffers);
    Shader = GetGame()->GetRender()->GetShader("flat");
    if (Shader != NULL)
    {
        MatrixLoc = Shader->GetUniformLocation("Model");
        TextureLoc = Shader->GetUniformLocation("Texture");
        ColorLoc = Shader->GetUniformLocation("Color");
    }
    Texture = GetGame()->GetRender()->GetTexture("star");
    if (Texture)
    {
        unsigned int AnimationCount = Texture->GetAnimationCount();
        Texture->Play(rand()%AnimationCount);
    }
    float Size = Rand(5,32);
    SetScale(glm::vec3(Size,Size,1));
    //float Rot = Rand(0,360);
    //SetAng(glm::vec3(0,0,Rot));
    SetParent(GetGame()->GetRender()->GetCamera());
    SetPos(glm::vec3(GetGame()->GetWindowWidth()+GetScale().x,Rand(0,GetGame()->GetWindowHeight()),0));
}
开发者ID:ZenX2,项目名称:Astrostruct,代码行数:25,代码来源:NSpace.cpp

示例3: GetScale

//*******************************************************************************
void CBCGPKnob::SetPointer(const CBCGPKnobPointer& pointer, BOOL bRedraw)
{
    CBCGPCircularGaugeScale* pScale = GetScale(0);
    if (pScale == NULL)
    {
        ASSERT(FALSE);
        return;
    }

    double dblVal = pScale->GetStart();

    if (m_arData.GetSize() > 0)
    {
        dblVal = GetValue();

        delete m_arData[0];
        m_arData.RemoveAt(0);
    }

    CBCGPKnobPointer* pData = new CBCGPKnobPointer;
    pData->CopyFrom(pointer);

    pData->SetValue(dblVal);

    AddData(pData);

    if (bRedraw)
    {
        Redraw();
    }
}
开发者ID:iclosure,项目名称:jframework,代码行数:32,代码来源:BCGPKnob.cpp

示例4: NOTARY_ID

void OTOffer::UpdateContents()
{
    const String NOTARY_ID(GetNotaryID()),
        INSTRUMENT_DEFINITION_ID(GetInstrumentDefinitionID()),
        CURRENCY_TYPE_ID(GetCurrencyID());

    // I release this because I'm about to repopulate it.
    m_xmlUnsigned.Release();

    Tag tag("marketOffer");

    tag.add_attribute("version", m_strVersion.Get());

    tag.add_attribute("isSelling", formatBool(!IsBid()));
    tag.add_attribute("notaryID", NOTARY_ID.Get());
    tag.add_attribute("instrumentDefinitionID", INSTRUMENT_DEFINITION_ID.Get());
    tag.add_attribute("currencyTypeID", CURRENCY_TYPE_ID.Get());
    tag.add_attribute("priceLimit", formatLong(GetPriceLimit()));
    tag.add_attribute("totalAssetsOnOffer",
                      formatLong(GetTotalAssetsOnOffer()));
    tag.add_attribute("finishedSoFar", formatLong(GetFinishedSoFar()));
    tag.add_attribute("marketScale", formatLong(GetScale()));
    tag.add_attribute("minimumIncrement", formatLong(GetMinimumIncrement()));
    tag.add_attribute("transactionNum", formatLong(GetTransactionNum()));
    tag.add_attribute("validFrom", formatTimestamp(GetValidFrom()));
    tag.add_attribute("validTo", formatTimestamp(GetValidTo()));

    std::string str_result;
    tag.output(str_result);

    m_xmlUnsigned.Concatenate("%s", str_result.c_str());
}
开发者ID:yamamushi,项目名称:opentxs,代码行数:32,代码来源:OTOffer.cpp

示例5: v

LTVector HeadBobMgr::GetWeaponRotations() const
{
	LTVector v(	m_aAmpsActive[ HBE_WEAPONROTATION_X ],
				m_aAmpsActive[ HBE_WEAPONROTATION_Y ],
				m_aAmpsActive[ HBE_WEAPONROTATION_Z ] );

	return ( v * GetScale() );
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:8,代码来源:HeadBobMgr.cpp

示例6: mMuzzleSpeed

Yarn::Yarn() :
	mMuzzleSpeed( 400.f ),
	mVelocity( Vector3::Zero ),
	mPlayerId( 0 )
{
	SetScale( GetScale() * .02f );
	SetCollisionRadius( 15.f );
}
开发者ID:Resinderate,项目名称:ShadowMultiplayer,代码行数:8,代码来源:Yarn.cpp

示例7: mVelocity

Yarn::Yarn() :
	mVelocity( Vector3::Zero )
{
	SetScale( GetScale() * 0.25f );
	SetCollisionRadius( 0.125f );
	mSpriteComponent = std::make_shared<SpriteComponent>( this );
	mSpriteComponent->SetTexture( TextureManager::sInstance->GetTexture( "yarn" ) );
}
开发者ID:caldera,项目名称:MultiplayerBook,代码行数:8,代码来源:Yarn.cpp

示例8: GetScale

Vect4 SceneItem::GetCrop()
{
    Vect4 scaledCrop = crop;
    Vect2 scale = GetScale();
    scaledCrop.x /= scale.x; scaledCrop.y /= scale.y;
    scaledCrop.z /= scale.y; scaledCrop.w /= scale.x;
    return scaledCrop;
}
开发者ID:373137461,项目名称:OBS,代码行数:8,代码来源:Scene.cpp

示例9: GetScale

		//-----------------------------------------------------------------------------
		bool Matrix22::IsUniformScale()const
		{
			float xScale, yScale = 0.0f;
			GetScale(xScale, yScale);

			return (!Dia::Maths::Float::FEqual(xScale, 1.0f) && 
					!Dia::Maths::Float::FEqual(yScale, 1.0f) &&
					Dia::Maths::Float::FEqual(xScale, yScale));
		}
开发者ID:LenihanConor,项目名称:Cluiche,代码行数:10,代码来源:Matrix22.cpp

示例10: GetPosition

void Entity::SetRotation(float a_fRotation)
{
	Vector3 vPosition = GetPosition();
	Vector3 vScale = GetScale();

	m_oLocalTransform = Matrix3x3::setupTranslation(vPosition)
		* Matrix3x3::setupRotation(a_fRotation)
		* Matrix3x3::setupScale(vScale);
}
开发者ID:JeffreyMJohnson,项目名称:Misc_File_Dump,代码行数:9,代码来源:Entity.cpp

示例11: GetScale

sRect CCBButtonLook::GetClientRect(CCButton* pButton, sRect& r)
{
	float fScale = GetScale();

	int al = (int)(fScale * GETWIDTH(m_pUpBitmaps[3]));
	int au = (int)(fScale * GETHEIGHT(m_pUpBitmaps[7]));
	int ar = (int)(fScale * GETWIDTH(m_pUpBitmaps[5]));
	int ab = (int)(fScale * GETHEIGHT(m_pUpBitmaps[1]));
	return sRect(r.x+al, r.y+au, r.w-(al+ar), r.h-(au+ab));
}
开发者ID:Kallontz,项目名称:gunz-the-tps-mmorpg,代码行数:10,代码来源:CCBButtonLook.cpp

示例12: while

void wxTextPrintout::NextTab(float *x, int /* tabcount */)
{
  float tab=0.0f;
  while (tab<*x)
    {
      tab+=GetTabSize()*GetScale();
    }
  // return the new Value
  *x=tab;
}
开发者ID:msperl,项目名称:Period,代码行数:10,代码来源:wxtxtprint.cpp

示例13: GetScale

Box2D GUITexture::GetBounds(void) const
{
    Vector2f dims = GetScale();
    if (tex != 0)
    {
        if (rotation == 0.0f)
        {
            dims = ToV2f(Vector2u(tex->GetWidth(), tex->GetHeight()));
            dims.MultiplyComponents(GetScale());
        }
        else
        {
            float diameter = 2.0f * ToV2f(Vector2u(tex->GetWidth(), tex->GetHeight())).Length();
            dims = Vector2f(diameter, diameter);
        }
    }

    return Box2D(Vector2f(), dims);
}
开发者ID:heyx3,项目名称:K1LL,代码行数:19,代码来源:GUITexture.cpp

示例14: GetRotation

	//get the inverse transform matrix
	mat4f  PhysicsComponent::GetInverse()
	{
		mat4f trans;
		vec3f rot = GetRotation();
		vec3f pos = GetPosition();
		pos.x *= -1;

        mat4f::Inverse(pos * Config::s_PPM, rot.x, rot.y, rot.z, GetScale(), &trans);
		return trans;
	}
开发者ID:erdnaxela01,项目名称:WonderEmporium,代码行数:11,代码来源:PhysicsComponent.cpp

示例15: GetScale

void Animation::DrawAnimation(const Point2D& position)
{
	Point2D sCenter = position + scalingCenter - offset;
	Point2D rCenter = position + rotationCenter - offset;

	sprite->DrawSprite(bounds, position - offset, sCenter, rCenter, GetScale(), GetRotation(), ColorARGB(GetOpacity(), color.GetR(), color.GetG(), color.GetB()));

	SetFloatValue(ANIM_VAR_SCALE, 0);
	SetFloatValue(ANIM_VAR_OPACITY, 0);
	SetFloatValue(ANIM_VAR_ROTATION, 0);
}
开发者ID:Dingf,项目名称:Paper-TD,代码行数:11,代码来源:animation.cpp


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