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


C++ Float4函数代码示例

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


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

示例1: ConvertToStaticSampler

D3D12_STATIC_SAMPLER_DESC ConvertToStaticSampler(const D3D12_SAMPLER_DESC& samplerDesc, uint32 shaderRegister,
                                                 uint32 registerSpace, D3D12_SHADER_VISIBILITY visibility)
{
    D3D12_STATIC_SAMPLER_DESC staticDesc = { };
    staticDesc.Filter = samplerDesc.Filter;
    staticDesc.AddressU = samplerDesc.AddressU;
    staticDesc.AddressV = samplerDesc.AddressV;
    staticDesc.AddressW = samplerDesc.AddressW;
    staticDesc.MipLODBias = samplerDesc.MipLODBias;
    staticDesc.MaxAnisotropy = samplerDesc.MaxAnisotropy;
    staticDesc.ComparisonFunc = samplerDesc.ComparisonFunc;
    staticDesc.MinLOD = samplerDesc.MinLOD;
    staticDesc.MaxLOD = samplerDesc.MaxLOD;
    staticDesc.ShaderRegister = shaderRegister;
    staticDesc.RegisterSpace = registerSpace;
    staticDesc.ShaderVisibility = visibility;

    Float4 borderColor = Float4(samplerDesc.BorderColor[0], samplerDesc.BorderColor[1], samplerDesc.BorderColor[2], samplerDesc.BorderColor[3]);
    if(borderColor == Float4(1.0f, 1.0f, 1.0f, 1.0f))
        staticDesc.BorderColor = D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE;
    else if(borderColor == Float4(0.0f, 0.0f, 0.0f, 1.0f))
        staticDesc.BorderColor = D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK;
    else
        staticDesc.BorderColor =  D3D12_STATIC_BORDER_COLOR_TRANSPARENT_BLACK;

    return staticDesc;
}
开发者ID:TheRealMJP,项目名称:DeferredTexturing,代码行数:27,代码来源:DX12_Helpers.cpp

示例2: lightGray

//----------------------------------------------------------------------------
void Delaunay3D::DoSearch ()
{
    // Make all tetra wireframe.
    const int numSimplices = mDelaunay->GetNumSimplices();
    Float4 lightGray(0.75f, 0.75f, 0.75f, 1.0f);
    int i;
    for (i = 0; i < numSimplices; ++i)
    {
        ChangeTetraStatus(i, lightGray, true);
    }

    // Generate random point in AABB of data set.
    Vector3f random;
    random.X() = Mathf::IntervalRandom(mMin.X(), mMax.X());
    random.Y() = Mathf::IntervalRandom(mMin.Y(), mMax.Y());
    random.Z() = Mathf::IntervalRandom(mMin.Z(), mMax.Z());

    // Move sphere to this location.
    Spatial* sphere = mScene->GetChild(0);
    sphere->Culling = Spatial::CULL_DYNAMIC;
    sphere->LocalTransform.SetTranslate(random);
    sphere->Update();

    if (mDelaunay->GetContainingTetrahedron(random) >= 0)
    {
        // Make all tetra on the path solid.
        const int pathLast = mDelaunay->GetPathLast();
        for (i = 0; i <= pathLast; ++i)
        {
            int index = mDelaunay->GetPath()[i];
            float red, blue;
            if (pathLast > 0)
            {
                red = i/(float)pathLast;
                blue = 1.0f - red;
            }
            else
            {
                red = 1.0f;
                blue = 0.0f;
            }
            ChangeTetraStatus(index, Float4(red, 0.0f, blue, 0.5f), false);
        }
    }
    else
    {
        // The point is outside the convex hull.  Change the wireframe
        // color for the last visited face in the search path.
        int index = mDelaunay->GetPath()[mDelaunay->GetPathLast()];
        int v0, v1, v2, v3;
        int vOpposite = mDelaunay->GetLastFace(v0, v1, v2, v3);
        ChangeLastTetraStatus(index, vOpposite,
            Float4(0.0f, 1.0f, 0.0f, 0.5f),
            Float4(0.0f, 0.25f, 0.0f, 0.5f));
    }

    mCuller.ComputeVisibleSet(mScene);
}
开发者ID:rasslingcats,项目名称:calico,代码行数:59,代码来源:Delaunay3D.cpp

示例3: Float4

LightDescPoint::LightDescPoint()
{
	ambient		= Float4(0.0f, 0.0f, 0.0f, 0.0f);
	diffuse		= Float4(0.0f, 0.0f, 0.0f, 0.0f);
	specular	= Float4(0.0f, 0.0f, 0.0f, 0.0f);

	range		= 0.0f;
	attenuation	= Float3(0.0f, 0.0f, 0.0f);
}
开发者ID:CaterHatterPillar,项目名称:xkill-source,代码行数:9,代码来源:LightDesc.cpp

示例4: OnGrassClick

void GrassModule::OnGrassClick(const MGUI::MouseEvent * e)
{
	if (mImageBox_Selected)
		mImageBox_Selected->SetColor(Float4(1.0f, 1.0f, 1.0f));

	mImageBox_Selected = (MGUI::ImageBox *)e->sender;

	if (mImageBox_Selected)
		mImageBox_Selected->SetColor(Float4(0.7f, 0.7f, 1.0f));
}
开发者ID:MSoft1115,项目名称:Rad3D,代码行数:10,代码来源:GrassModule.cpp

示例5: lerp3d

 Point lerp3d(const Point& px0y0z0, const Point& px1y0z0, const Point& px0y1z0, const Point& px1y1z0,
     const Point& px0y0z1, const Point& px1y0z1, const Point& px0y1z1, const Point& px1y1z1,
     float xPoint, float yPoint, float zPoint) {
         return Point(lerp3d(Float4(px0y0z0), Float4(px1y0z0), Float4(px0y1z0), Float4(px1y1z0), 
             Float4(px0y0z1), Float4(px1y0z1), Float4(px0y1z1), Float4(px1y1z1), 
             xPoint, yPoint, zPoint));
 }
开发者ID:atanas1054,项目名称:ray_tracer,代码行数:7,代码来源:interpolate.cpp

示例6: Float4

Float4 Quaternion::getAxisAndAngle() const
{
    float ha = std::acos(w);
    float sha = std::sin(ha);

    return Float4(x / sha, y / sha, z / sha, ha*2.0f);
}
开发者ID:pendingchaos,项目名称:WIP12,代码行数:7,代码来源:quaternion.cpp

示例7: Float3

void GrassModule::OnRender()
{
	if (!mLayout->IsVisible() || mImageBox_Selected == NULL || !Terrain::Instance()->IsValid())
		return ;

	Aabb aabb;
	aabb.minimum = mBrushPosition - Float3(mBrushSize * 0.5f, 1, mBrushSize * 0.5f);
	aabb.maximum = mBrushPosition + Float3(mBrushSize * 0.5f, 1, mBrushSize * 0.5f);

	RenderSystem::Instance()->SetWorldTM(Mat4::Identity);

	for (int y = 0; y < Terrain::Instance()->GetInfo()->BlockCount.x; ++y)
	{
		for (int x = 0; x < Terrain::Instance()->GetInfo()->BlockCount.y; ++x)
		{
			TerrainMesh * mesh = Terrain::Instance()->_getBlock(x, y);
			const Aabb & bound = mesh->GetWorldAabb();

			float x0 = Max(aabb.minimum.x, bound.minimum.x);
			float z0 = Max(aabb.minimum.z, bound.minimum.z);

			float x1 = Min(aabb.maximum.x, bound.maximum.x);
			float z1 = Min(aabb.maximum.z, bound.maximum.z);

			if (x0 <= x1 && z0 <= z1)
			{
				mShaderFX_Brush->GetPass(0)->SetConst("u_MinInvSize", Float4(aabb.minimum.x, aabb.minimum.z, 1 / mBrushSize, 1 / mBrushSize));
				mShaderFX_Brush->GetPass(0)->SetConst("u_XZTransform", mesh->GetXZTransform());

				RenderSystem::Instance()->SetTexture(0, MGUI::Helper::Instance()->GetWhiteTexture().c_ptr());
				RenderSystem::Instance()->Render(mShaderFX_Brush, mesh->GetRenderOp());
			}
		}
	}
}
开发者ID:MSoft1115,项目名称:Rad3D,代码行数:35,代码来源:GrassModule.cpp

示例8: WindowApplication3

//----------------------------------------------------------------------------
BSplineSurfaceFitter::BSplineSurfaceFitter ()
	:
	WindowApplication3("SampleMathematics/BSplineSurfaceFitter", 0, 0, 640,
	                   480, Float4(0.0f, 0.5f, 0.75f, 1.0f)),
	mTextColor(0.0f, 0.0f, 0.0f, 1.0f)
{
}
开发者ID:bhlzlx,项目名称:WildMagic,代码行数:8,代码来源:BSplineSurfaceFitter.cpp

示例9: WindowApplication3

//----------------------------------------------------------------------------
PolyhedronDistance::PolyhedronDistance ()
    :
    WindowApplication3("SamplePhysics/PolyhedronDistance", 0, 0, 640, 480,
        Float4(0.5f, 0.0f, 1.0f, 1.0f)),
        mTextColor(1.0f, 1.0f, 1.0f, 1.0f)
{
}
开发者ID:rasslingcats,项目名称:calico,代码行数:8,代码来源:PolyhedronDistance.cpp

示例10: WindowApplication3

//----------------------------------------------------------------------------
FoucaultPendulum::FoucaultPendulum ()
    :
    WindowApplication3("SamplePhysics/FoucaultPendulum", 0, 0, 640, 480,
        Float4(0.819607f, 0.909803f, 0.713725f, 1.0f)),
        mTextColor(1.0f, 1.0f, 1.0f, 1.0f)
{
}
开发者ID:vijaynerella,项目名称:GeometricTools,代码行数:8,代码来源:FoucaultPendulum.cpp

示例11: WindowApplication2

//----------------------------------------------------------------------------
RoughPlaneThinRod2::RoughPlaneThinRod2 ()
	:
	WindowApplication2("SamplePhysics/RoughPlaneThinRod2", 0, 0, 256, 256,
	                   Float4(1.0f, 1.0f, 1.0f, 1.0f))
{
	mSize = GetWidth();
}
开发者ID:bhlzlx,项目名称:WildMagic,代码行数:8,代码来源:RoughPlaneThinRod2.cpp

示例12: WindowApplication3

//----------------------------------------------------------------------------
BillboardNodes::BillboardNodes ()
    :
    WindowApplication3("SampleGraphics/BillboardNodes",0, 0, 640, 480,
        Float4(0.9f, 0.9f, 0.9f, 1.0f)),
        mTextColor(1.0f, 1.0f, 1.0f, 1.0f)
{
}
开发者ID:rasslingcats,项目名称:calico,代码行数:8,代码来源:BillboardNodes.cpp

示例13: WindowApplication3

//----------------------------------------------------------------------------
ClodMeshes::ClodMeshes ()
    :
    WindowApplication3("SampleGraphics/ClodMeshes", 0, 0, 640, 480,
        Float4(0.9f, 0.9f, 0.9f, 1.0f)),
        mTextColor(0.0f, 0.0f, 0.0f, 1.0f)
{
}
开发者ID:vijaynerella,项目名称:GeometricTools,代码行数:8,代码来源:ClodMeshes.cpp

示例14: Float4

			const Ray operator * ( const Ray& lhs, const Matrix4x4& world )
			{
				const Float3 origin = lhs.origin * world;
				const Float3 direction = ( Float4( lhs.direction, 0 ) * world );
				Ray result( origin, direction );
				return result;
			}
开发者ID:kpongky,项目名称:At-Math,代码行数:7,代码来源:Ray.cpp

示例15: WindowApplication3

//----------------------------------------------------------------------------
NonuniformScale::NonuniformScale ()
    :
    WindowApplication3("SampleGraphics/NonuniformScale", 0, 0, 640, 480,
        Float4(0.5f, 0.0f, 1.0f, 1.0f)),
        mTextColor(1.0f, 1.0f, 1.0f, 1.0f)
{
}
开发者ID:rasslingcats,项目名称:calico,代码行数:8,代码来源:NonuniformScale.cpp


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