• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetScale函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GetScale

OpRect WidgetThumbnailGenerator::ScaleRect(const OpRect& rect)
{
	int scale = GetScale();

	OpRect scaled_rect(rect.x * scale / 100,
					   rect.y * scale / 100,
					   rect.width * scale / 100,
					   rect.height * scale / 100);

	return scaled_rect;
}
开发者ID:prestocore,项目名称:browser,代码行数:11,代码来源:WidgetThumbnailGenerator.cpp


示例17: GetScale

	bool	Matrix::GetScale(double& sx) const
	{
		// return a uniform scale  (false if differential)
		double sy, sz;
		if(m_unit) {
			sx = 1;
			return true;
		}
		GetScale(sx, sy, sz);
		return (fabs(fabs(sx) - fabs(sy)) < 0.000001)?true : false;
	}
开发者ID:Fat-Zer,项目名称:FreeCAD_sf_master,代码行数:11,代码来源:Matrix.cpp


示例18: GetScale

//------------------------------------------------------------------------
void CView::SetViewShakeEx( const SShakeParams &params )
{
	float shakeMult = GetScale();
	if (shakeMult < 0.001f)
		return;

	int     shakes(m_shakes.size());
	SShake* pSetShake(nullptr);

	for (int i = 0; i < shakes; ++i)
	{
		SShake* pShake = &m_shakes[i];
		if (pShake->ID == params.shakeID)
		{
			pSetShake = pShake;
			break;
		}
	}

	if (!pSetShake)
	{
		m_shakes.push_back(SShake(params.shakeID));
		pSetShake = &m_shakes.back();
	}

	if (pSetShake)
	{
		// this can be set dynamically
		pSetShake->frequency = max(0.00001f, params.frequency);

		// the following are set on a 'new' shake as well
		if (params.bUpdateOnly == false)
		{
			pSetShake->amount               = params.shakeAngle * shakeMult;
			pSetShake->amountVector         = params.shakeShift * shakeMult;
			pSetShake->randomness           = params.randomness;
			pSetShake->doFlip               = params.bFlipVec;
			pSetShake->groundOnly           = params.bGroundOnly;
			pSetShake->isSmooth             = params.isSmooth;
			pSetShake->permanent            = params.bPermanent;
			pSetShake->fadeInDuration       = params.fadeInDuration;
			pSetShake->sustainDuration      = params.sustainDuration;
			pSetShake->fadeOutDuration      = params.fadeOutDuration;
			pSetShake->timeDone             = 0;
			pSetShake->updating             = true;
			pSetShake->interrupted          = false;
			pSetShake->goalShake            = Quat(ZERO);
			pSetShake->goalShakeSpeed       = Quat(ZERO);
			pSetShake->goalShakeVector      = Vec3(ZERO);
			pSetShake->goalShakeVectorSpeed = Vec3(ZERO);
			pSetShake->nextShake            = 0.0f;
		}
	}
}
开发者ID:joewan,项目名称:pycmake,代码行数:55,代码来源:View.cpp


示例19: GetGlobalTransformation

void Sprite::Draw(Renderer& renderer)
{
    if(!IsEnabled())
        return;
    
    mat3f t = GetGlobalTransformation();
    bool scaled = GetScale() != vec2f(1);
    renderer.DrawImage(m_image, t, scaled);
    
    Node::Draw(renderer);
}
开发者ID:Teivaz,项目名称:OctoBoom,代码行数:11,代码来源:Sprite.cpp


示例20: b2Vec2

void PhysicsSystem::OnEntityAdded(Entity* _entity)
{
	auto collision = _entity->GetComponent<CollisionComponent>();
	auto position = _entity->GetComponent<PositionComponent>();
	auto velocity = _entity->GetComponent<VelocityComponent>();
	auto rotation = _entity->GetComponent<RotationComponent>();
	auto scale = _entity->GetComponent<ScaleComponent>();

	if (scale && (scale->GetScale().x != 1 || scale->GetScale().y != 1))
	{
		auto fixDefs = collision->GetFixtureDefs();
		for (auto it = fixDefs.begin(); it != fixDefs.end(); ++it)
		{
			b2FixtureDef* fix = *it;
			if (fix->shape->m_type == b2Shape::Type::e_polygon)
			{
				b2PolygonShape* polygonShape = (b2PolygonShape*)fix->shape;

				for (int i = 0; i < polygonShape->GetVertexCount(); ++i)
                                    polygonShape->m_vertices[i] = b2Vec2(polygonShape->m_vertices[i].x * scale->GetScale().x, polygonShape->m_vertices[i].y * scale->GetScale().y);
			}
			else if (fix->shape->m_type == b2Shape::Type::e_circle)
			{
				b2CircleShape* circleShape = (b2CircleShape*)fix->shape;
				if (scale->GetScale().x > scale->GetScale().y)
					circleShape->m_radius *= scale->GetScale().x;
				else
					circleShape->m_radius *= scale->GetScale().y;
			}
		}
	}
	if (position)
		collision->GetBodyDef()->position = b2Vec2(position->GetPosition().x, position->GetPosition().y);
	if (velocity)
		collision->GetBodyDef()->linearVelocity = b2Vec2(velocity->m_velocity.x, velocity->m_velocity.y);
	if (rotation)
		collision->GetBodyDef()->angle = rotation->GetRotation().z;
	
	collision->CreateBody(m_b2World);
}
开发者ID:kelkka,项目名称:Agile,代码行数:40,代码来源:PhysicsSystem.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetScene函数代码示例发布时间:2022-05-30
下一篇:
C++ GetSaveFileName函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap