本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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));
}
示例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));
}
示例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);
}
示例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());
}
}
}
}
示例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)
{
}
示例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)
{
}
示例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)
{
}
示例11: WindowApplication2
//----------------------------------------------------------------------------
RoughPlaneThinRod2::RoughPlaneThinRod2 ()
:
WindowApplication2("SamplePhysics/RoughPlaneThinRod2", 0, 0, 256, 256,
Float4(1.0f, 1.0f, 1.0f, 1.0f))
{
mSize = GetWidth();
}
示例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)
{
}
示例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)
{
}
示例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;
}
示例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)
{
}