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

C++ Float2函数代码示例

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

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



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

示例1: CPage

CTopsManager::CTopsManager(std::shared_ptr<CTask> task) :
CPage(task, Page)
{
	Float2 PlacementPos[MaxNum];
	const float PosX = 550;
	const float PosY = CPageManager::PartsPosY;
	const float SpaceX = 132;
	const float SpaceY = 120;

	for (int i = 0; i < 4; i++)
	{
		PlacementPos[i] = Float2(PosX + (i * SpaceX), PosY);
		PlacementPos[i + 4] = Float2(PosX + (i * SpaceX), PosY + SpaceY * 1);
		PlacementPos[i + 4 * 2] = Float2(PosX + (i * SpaceX), PosY + SpaceY * 2);
		PlacementPos[i + 4 * 3] = Float2(PosX + (i * SpaceX), PosY + SpaceY * 3);
	}

	for (int i = 0; i < Page; i++)
	{
		for (auto& it : PlacementPos)
		{
			parts.push_back(std::make_unique<CTops>(task, it,i,Float2(0,-70)));
		}
	}

}
开发者ID:flair2005,项目名称:AvatarSystem,代码行数:26,代码来源:TopsManager.cpp


示例2: CharType

	inline std::basic_ostream<CharType>& operator << (std::basic_ostream<CharType>& os, const Mat3x2& mat)
	{
		return os << CharType('(')
			<< Float2(mat._11, mat._12) << CharType(',')
			<< Float2(mat._21, mat._22) << CharType(',')
			<< Float2(mat._31, mat._32) << CharType(')');
	}
开发者ID:7th-Douji,项目名称:Siv3D-Reference,代码行数:7,代码来源:Mat3x2.hpp


示例3: TextureAsset

void CParts::Draw()
{
	TextureAsset(CResource::GetInstance().GetGraphic(CResource::GraphicType::PartsBackGraohic_1)).
		resize(Float2(120, 120)).draw(pos + framepos);

	PartsDraw();

	TextureAsset(CResource::GetInstance().GetGraphic(CResource::GraphicType::PartsBackGraohic_2)).
		resize(Float2(120, 120)).draw(pos + framepos);

}
开发者ID:flair2005,项目名称:AvatarSystem,代码行数:11,代码来源:Parts.cpp


示例4: switch

		bool System::mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id )
		{
			if(!m_bEnableInput){
				return true;
			}
			if(id==OIS::MB_Left){
				Engine::Scene* pScene	=	GameSystem::GetSingleton()->GetCurrentSection()->GetScene();
				switch(m_CM){
				case enCM_Select:{

					break;}
				case enCM_SelectList:{

					break;}
				case enCM_Move:{
					if(m_MoveType!=Engine::eMRCT_None){
						m_bIsControl	=	true;
						m_MoveDir		=	Float2(arg.state.X.abs,arg.state.Y.abs);
						Engine::MeshEntityList::iterator i = m_lstSelectObj.begin();
						if(i!=m_lstSelectObj.end()){

							m_OldPos	=	(*i)->GetParentSceneNode()->GetPosition();
							Float3 vPositive	=	m_OldPos+Float3(10,10,10);
						}
					}
					break;}
				case enCM_Scale:{
					if(m_MoveType!=Engine::eMRCT_None){
						m_bIsControl	=	true;
						m_MoveDir		=	Float2(arg.state.X.abs,arg.state.Y.abs);
						Engine::MeshEntityList::iterator i = m_lstSelectObj.begin();
						if(i!=m_lstSelectObj.end()){
							m_OldPos	=	(*i)->GetParentSceneNode()->GetScale();
						}
					}
					break;}
				case enCM_Rotate:{
					if(m_MoveType!=Engine::eMRCT_None){
						m_bIsControl	=	true;
						m_MoveDir		=	Float2(arg.state.X.abs,arg.state.Y.abs);
						Engine::MeshEntityList::iterator i = m_lstSelectObj.begin();
						if(i!=m_lstSelectObj.end()){
							m_OldQuat	=	(*i)->GetParentSceneNode()->GetQuat();
						}
					}
								 }break;
				case enCM_Create:{
					
					break;}
				}
			}
			return true;
		}
开发者ID:ingeyu,项目名称:airengine,代码行数:53,代码来源:AirEditorSystem.cpp


示例5: while

void InputComponent::resetMovementInput()
{
	while(itrPlayer.hasNext())
	{
		AttributePtr<Attribute_Player> ptr_player = itrPlayer.getNext();

		if(ptr_player->ptr_inputDevice.isEmpty())
			continue;

		AttributePtr<Attribute_Input> input = ptr_player->ptr_input;
		input->position = Float2(0.0f, 0.0f);
		input->rotation = Float2(0.0f, 0.0f);
	}
}
开发者ID:CaterHatterPillar,项目名称:xkill-source,代码行数:14,代码来源:InputComponent.cpp


示例6: GmCameraMan

//-----------------------------------------------------------------------------
//! シャドウ書き込み開始
//-----------------------------------------------------------------------------
void CascadedShadow::begin(LightBase* pLight)
{
	// シャドウマップリスト数を上回っていたら処理しない
	if(_currentShadowNum >= SPLIT_COUNT ) return;

	static f32	minMax[6];
	
	// 現在のシャドウを保存
	_pCurrentShadow = _pShadow[_currentShadowNum];

	CameraBase*	cam		= GmCameraMan()->getCurrentCamera();
	Vector3		camPos	= cam->getPosition();
	Matrix		camMat  = cam->getMatrix();

	// 視錐台の8点を更新
//	updateFrustumPoints(f[_currentShadowNum], camPos, camMat);
	// クロップ行列作成
//	f32 minZ = applyCropMatrix(f[_currentShadowNum], pLight);

	

	if( !_isSetRender ) {
		calcAndSetViewMatrix(pLight->getLightDir().normalize(), -Vector3(camMat._m[2]).normalize(), camPos);
		// ビューポートを退避
		glPushAttrib(GL_VIEWPORT_BIT);
		// カメラからの距離リストを計算(コレを元にシェーダでテクスチャを使い分ける)
		calcFarDist();
		// 転送
		GmShader()->changeShader(SystemShader::SHADER_TEXTURE);
		GmShader()->setUniform1fv("farDist", _farDist, SPLIT_COUNT);
		GmShader()->beginPrevShader();

		if (!GmRender()->setRenderTarget(_depthTexture, Float2(0, 0), -1, &Size<s32>(DEPTH_SIZE, DEPTH_SIZE))) {
			MessageBoxA(NULL, "シャドウのバインドに失敗しました", "エラー", MB_OK);
		}
		glClear(GL_DEPTH_BUFFER_BIT);
		_isSetRender = true;	// 描画ターゲット設定フラグON
	}

	// モデルビュープロジェクション行列作成
	_depthMVP = _modelMatrix * _depthView[_currentShadowNum] * _depthProj[_currentShadowNum];

	// 現在のシャドウを描画開始する
	_pCurrentShadow->begin(pLight, _depthMVP, Float2((f32)( DEPTH_SIZE*_currentShadowNum ), 0.0f));
	
	// 次のシャドウマップへ
	++_currentShadowNum;

}
开发者ID:EKISUKE,项目名称:GitHubTest,代码行数:52,代码来源:CascadedShadow.cpp


示例7: Float2

void CTopsManager::PartsDraw()
{
	const Float2 BackPos = Float2(50, 70);
	if (select_id <= -1) return;
	TextureAsset(CResource::GetInstance().GetTops(select_id)).draw(BackPos);

}
开发者ID:flair2005,项目名称:AvatarSystem,代码行数:7,代码来源:TopsManager.cpp


示例8: TexturedQuad

	TexturedQuad TextureRegion::rotatedAt(const double x, const double y, const double angle) const
	{
		return TexturedQuad(texture,
			uvRect,
			RectF(size).rotatedAt(x, y, angle),
			Float2(x, y));
	}
开发者ID:Siv3D,项目名称:OpenSiv3D,代码行数:7,代码来源:SivTextureRegion.cpp


示例9: Change

void CParts::Change()
{
	if (utility::IsMousePointer(pos + framepos, Float2(120, 120)) && Input::MouseL.clicked)
	{
		Select();
	}
}
开发者ID:flair2005,项目名称:AvatarSystem,代码行数:7,代码来源:Parts.cpp


示例10: AString

			void Renderer::SetMaterialName( AString strMaterialName ){
				AString	strMaterial	=	AString("..\\Data\\UI\\")	+	strMaterialName	+	AString(".Material");
				AString	strImageSet	=	AString("..\\Data\\UI\\")	+	strMaterialName	+	AString(".ImageSet.Xml");
	
// 				Render::IMaterial*	pMaterial	=	Render::System::GetSingleton()->CreateProduct<Render::IMaterial*>(strMaterial,AString("Material"));
// 				if(pMaterial==NULL){
// 					EngineLogWarnning((AChar*)strMaterialName.c_str(),"UI材质更换失败!");
// 					return;
// 				}
// 				if(m_pMaterial!=NULL){
// 					EngineSystem::GetSingleton()->DestroyProduct(m_pMaterial);
// 					m_pMaterial	=	NULL;
// 				}
// 				m_pMaterial	=	pMaterial;
// 	
// 				if(pMaterial!=NULL){
// 					Render::IMaterial::Technique*	pTechnique	=	m_pMaterial->GetCurrentTechnique();
// 					if(pTechnique!=NULL){
// 						Render::ITexture*	pTex	=	(Render::ITexture*)pTechnique->GetParam("UI");
// 						if(pTex!=NULL){
// 							//Render::ITexture::Info	info	=	pTex->m_Info;
// 	
// 							m_vTextureSize.x	=	pTex->m_Info.width;
// 							m_vTextureSize.y	=	pTex->m_Info.height;
// 						}
// 					}
// 				}
	
				IImageSet::Info	info;
				info.vTextureSize	=	Float2(m_vTextureSize.x,m_vTextureSize.y);
				m_pImageSet	=	new	IImageSet(strImageSet,&info);
				m_pImageSet->Create();
			}
开发者ID:ingeyu,项目名称:airengine,代码行数:33,代码来源:AirInterfaceUIRenderer.cpp


示例11: Saturate

// Computes shadow depth bounds on the CPU using the mesh vertex positions
void MeshRenderer::ComputeShadowDepthBoundsCPU(const Camera& camera)
{
    Float4x4 viewMatrix = camera.ViewMatrix();
    const float nearClip = camera.NearClip();
    const float farClip = camera.FarClip();
    const float clipDist = farClip - nearClip;

    float minDepth = 1.0f;
    float maxDepth = 0.0f;
	for (int i = 0; i < _scene->getNumModels(); i++)
	{
		Model *model = _scene->getModel(i);
		const uint64 numMeshes = model->Meshes().size();
		for (uint64 meshIdx = 0; meshIdx < numMeshes; ++meshIdx)
		{
			const Mesh& mesh = model->Meshes()[meshIdx];
			const uint64 numVerts = mesh.NumVertices();
			const uint64 stride = mesh.VertexStride();
			const uint8* vertices = mesh.Vertices();
			for (uint64 i = 0; i < numVerts; ++i)
			{
				const Float3& position = *reinterpret_cast<const Float3*>(vertices);
				float viewSpaceZ = Float3::Transform(position, viewMatrix).z;
				float depth = Saturate((viewSpaceZ - nearClip) / clipDist);
				minDepth = std::min(minDepth, depth);
				maxDepth = std::max(maxDepth, depth);
				vertices += stride;
			}
		}
	}
    
    _shadowDepthBounds = Float2(minDepth, maxDepth);
}
开发者ID:bxs3514,项目名称:Realtime_GI,代码行数:34,代码来源:MeshRenderer.cpp


示例12: Float2

void CGroupManager::PartsDraw()
{
	const Float2 BackPos = Float2(350, 150);
	if (select_id <= -1) return;
	TextureAsset(CResource::GetInstance().GetGroup(select_id)).draw(BackPos);

}
开发者ID:flair2005,项目名称:AvatarSystem,代码行数:7,代码来源:GroupManager.cpp


示例13: Float2

	TextureRegion TextureRegion::fitted(double width, double height, const bool scaleUp) const
	{
		if (!scaleUp)
		{
			width = std::min<double>(width, size.x);
			height = std::min<double>(height, size.y);
		}

		const double w = size.x;
		const double h = size.y;
		double ws = width / w;	// 何% scalingするか
		double hs = height / h;

		double targetWidth, targetHeight;

		if (ws < hs)
		{
			targetWidth = width;
			targetHeight = h * ws;
		}
		else
		{
			targetWidth = w * hs;
			targetHeight = height;
		}

		TextureRegion result = *this;
		result.size = Float2(targetWidth, targetHeight);

		return result;
	}
开发者ID:Siv3D,项目名称:OpenSiv3D,代码行数:31,代码来源:SivTextureRegion.cpp


示例14: Float2

Float2<T> Float2<T>::randomPointInSquare(const Float2 &center, T width, T height, 
	Random &random)
{
	auto randDirection = Float2::randomDirection(random);
	return Float2(
		center.x + (width * randDirection.x),
		center.y + (height * randDirection.y));
}
开发者ID:pcercuei,项目名称:OpenTESArena,代码行数:8,代码来源:Float2.cpp


示例15: Float2

void CAccessoryManager::PartsFrontDraw()
{
	const Float2 BackPos = Float2(50, 70);
	for (auto& it : parts)
	{
		if (it->GetState() == CParts::State::None) continue;
		if (std::dynamic_pointer_cast<CAccessory>(it)->GetZBuffer() != CAccessory::ZBuffer::Front) continue;
		TextureAsset(CResource::GetInstance().GetAccessory(it->GetId())).draw(BackPos);
	}
}
开发者ID:flair2005,项目名称:AvatarSystem,代码行数:10,代码来源:AccessoryManager.cpp


示例16: m_rbf

Interpolate1D::Interpolate1D() :
m_rbf(NULL)
{ 
	m_bound = Float2(-1.f, 1.f); 
	m_covTrain = new Covariance<float, RbfKernel<float> >();
	m_xTrain = new DenseMatrix<float >();
	m_yTrain = new DenseMatrix<float >();
	m_xMean = new DenseVector<float >(1);
	m_yMean = new DenseVector<float >(1);
}
开发者ID:spinos,项目名称:aphid,代码行数:10,代码来源:Interpolate1D.cpp


示例17: Initialise

bool Water::Initialise(float height, float spacing, int size)
{
    m_height = height;

    if (CreateGrid(Float2(1.0f, 1.0f), spacing, size, size, false, false))
    {
        InitialiseMeshData();
        return true;
    }
    return false;
}
开发者ID:karajensen,项目名称:shader-editor,代码行数:11,代码来源:water.cpp


示例18: addObservation

void Interpolate1D::setObservation(const float & x,
					const float & y,
					const int & idx)
{
	if(idx >= numObservations() ) {
		addObservation(x, y);
		return;
	}
	
	m_observations[idx] = Float2(x, y);
}
开发者ID:spinos,项目名称:aphid,代码行数:11,代码来源:Interpolate1D.cpp


示例19: Float2

LoaderFbxTextureDesc::LoaderFbxTextureDesc()
{
	textureName_ = "Unknown";
	fileName_	 = "Unknown";
	
	scale_					= Float2(0.0f, 0.0f);
	translation_			= Float2(0.0f, 0.0f);
	rotation_				= Float3(0.0f, 0.0f, 0.0f);
	swap_					= false;
	alphaSource_			= 0;
	croppingLeft_			= 0;
	croppingTop_			= 0;
	croppingRight_			= 0;
	croppingBottom_			= 0;
	mappingType_			= 0;
	planarMappingNormal_	= 0;
	blendMode_				= 0;
	defaultAlpha_			= 0.0f;
	materialUse_			= 0;
	textureUse_				= 0;
}
开发者ID:CaterHatterPillar,项目名称:xkill-source,代码行数:21,代码来源:LoaderFbxTextureDesc.cpp


示例20: CPage

CGroupManager::CGroupManager(std::shared_ptr<CTask> task) :
CPage(task,0)
{
	const int MaxNum = CResource::MaxGroupNum;
	Float2 PlacementPos[MaxNum];
	const float PosX = 460;
	const float PosY = CPageManager::PartsPosY+50;
	const float SpaceX = 120;
	const float SpaceY = 130;

	for (int i = 0; i < 6; i++)
	{
		PlacementPos[i] = Float2(PosX + (i * SpaceX), PosY);
		PlacementPos[i + 6] = Float2(PosX + (i * SpaceX), PosY + SpaceY * 1);
		PlacementPos[i + 6 * 2] = Float2(PosX + (i * SpaceX), PosY + SpaceY * 2);
	}

	for (auto& it : PlacementPos)
	{
		parts.push_back(std::make_unique<CGroup>(task, it, 0));
	}
}
开发者ID:flair2005,项目名称:AvatarSystem,代码行数:22,代码来源:GroupManager.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ Float3函数代码示例发布时间:2022-05-30
下一篇:
C++ Flip函数代码示例发布时间: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