这篇教程C++ GetScale函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetScale函数的典型用法代码示例。如果您正苦于以下问题:C++ GetScale函数的具体用法?C++ GetScale怎么用?C++ GetScale使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetScale函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: sRectsRect 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,
示例2: NNodeNStar::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,
示例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,
示例4: NOTARY_IDvoid 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,
示例5: vLTVector 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,
示例6: mMuzzleSpeedYarn::Yarn() : mMuzzleSpeed( 400.f ), mVelocity( Vector3::Zero ), mPlayerId( 0 ){ SetScale( GetScale() * .02f ); SetCollisionRadius( 15.f );}
开发者ID:Resinderate,项目名称:ShadowMultiplayer,代码行数:8,
示例7: mVelocityYarn::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,
示例8: GetScaleVect4 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,
示例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,
示例10: GetPositionvoid 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,
示例11: GetScalesRect 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,
示例12: whilevoid 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,
示例13: GetScaleBox2D 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,
示例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,
示例15: GetScalevoid 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,
示例16: GetScaleOpRect 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,
示例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,
示例18: GetScale//------------------------------------------------------------------------void CView::SetViewShakeEx( const SShakeParams ¶ms ){ 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,
示例19: GetGlobalTransformationvoid 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,
示例20: b2Vec2void 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,
示例21: Storevoid FileIO::Store(const char* filename, LibraryPanel* library, StagePanel* stage, ee::GroupTreePanel* grouptree){ Json::Value value; SettingCfg* cfg = SettingCfg::Instance(); std::string dir = ee::FileHelper::GetFileDir(filename) + "//"; // settings value["settings"]["terrain2d"] = cfg->m_terrain2d_anim; // size value["size"]["width"] = cfg->m_map_width; value["size"]["height"] = cfg->m_map_height; value["size"]["view width"] = cfg->m_view_width; value["size"]["view height"] = cfg->m_view_height; value["size"]["view offset x"] = cfg->m_view_dx; value["size"]["view offset y"] = cfg->m_view_dy; // camera auto canvas = std::dynamic_pointer_cast<ee::CameraCanvas>(stage->GetCanvas()); if (canvas->GetCamera()->Type() == s2::CAM_ORTHO2D) { auto cam = std::dynamic_pointer_cast<s2::OrthoCamera>(canvas->GetCamera()); value["camera"]["scale"] = cam->GetScale(); value["camera"]["x"] = cam->GetPosition().x; value["camera"]["y"] = cam->GetPosition().y; } // screen value["screen"]["multi_col"] = gum::color2str(stage->GetScreenMultiColor(), s2s::RGBA); value["screen"]["add_col"] = gum::color2str(stage->GetScreenAddColor(), s2s::RGBA); if (!cfg->m_post_effect_file.empty()) { value["screen"]["post effect"] = ee::FileHelper::GetRelativePath(dir, cfg->m_post_effect_file); } // layers StoreLayers(value["layer"], stage->GetLayers(), dir); // libraries library->StoreToFile(value["library"], dir); Json::StyledStreamWriter writer; std::locale::global(std::locale("")); std::ofstream fout(filename); std::locale::global(std::locale("C")); writer.write(fout, value); fout.close(); wxMessageBox("Success");}
开发者ID:xzrunner,项目名称:easyeditor,代码行数:52,
示例22: GetPosition void Node::Save(pugi::xml_node& node) const { node.append_attribute("name").set_value(GetName().c_str()); auto position = GetPosition(); if (position != VECTOR3_ZERO) node.append_attribute("position").set_value(ToString(position).c_str()); auto orientation = GetOrientation(); if (orientation != QUATERNION_IDENTITY) node.append_attribute("orientation").set_value(ToString(orientation).c_str()); auto scale = GetScale(); if (scale != VECTOR3_ONE) node.append_attribute("scale").set_value(ToString(scale).c_str()); }
开发者ID:dreamsxin,项目名称:nsg-library,代码行数:13,
示例23: VertMirrorvoid RightPopupMenu::VertMirror(){ bool dirty = false; for (size_t i = 0, n = m_edited_sprs.size(); i < n; ++i) { auto spr = m_edited_sprs[i]; const sm::vec2& scale = spr->GetScale(); spr->SetScale(sm::vec2(scale.x, -scale.y)); dirty = true; } if (dirty) { SetCanvasDirtySJ::Instance()->SetDirty(); }}
开发者ID:xzrunner,项目名称:easyeditor,代码行数:13,
示例24: GetTranslationvoid GameObject::SetShape(Shape p_shapeType){ glm::vec3 translation = GetTranslation(); glm::quat orientation = GetOrientation(); glm::vec3 scale = GetScale(); //TODO: if not in dynamics world Physics::dynamicsWorld->removeRigidBody(rigidbody); delete rigidbody; SetShape(translation, orientation, scale, p_shapeType);}
开发者ID:a-roy,项目名称:blobcast,代码行数:13,
示例25: NTextvoid NButton::SetText(std::wstring Text){ if (DisplayText == NULL) { DisplayText = new NText("didactgothic",Text); DisplayText->SetMode(1); DisplayText->SetSize(GetScale().y/1.3); DisplayText->SetParent(this); DisplayText->SetPos(glm::vec3(0,4,0)); return; } DisplayText->SetText(Text);}
开发者ID:Tamschi,项目名称:Astrostruct,代码行数:13,
注:本文中的GetScale函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetScene函数代码示例 C++ GetSaveFileName函数代码示例 |