这篇教程C++ Float4函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中Float4函数的典型用法代码示例。如果您正苦于以下问题:C++ Float4函数的具体用法?C++ Float4怎么用?C++ Float4使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了Float4函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ConvertToStaticSamplerD3D12_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,
示例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,
示例3: Float4LightDescPoint::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,
示例4: OnGrassClickvoid 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,
示例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,
示例6: Float4Float4 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,
示例7: Float3void 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,
示例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,
示例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,
示例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,
示例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,
示例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,
示例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,
示例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,
示例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,
示例16: WindowApplication3//----------------------------------------------------------------------------BlendedAnimations::BlendedAnimations () : WindowApplication3("SampleGraphics/BlendedAnimations", 0, 0, 768, 768, Float4(0.5f, 0.0f, 1.0f, 1.0f)), mTextColor(1.0f, 1.0f, 1.0f, 1.0f), mManager(ThePath + "Data/", "Biped"), mAnimTime(0.0), mUpArrowPressed(false), mShiftPressed(false){ // Set animation information. The counts differ in debug and release // builds because of the differing frame rates of those builds.#ifdef _DEBUG int idleWalkCount = 100; int walkCount = 10; int walkRunCount = 100; mAnimTimeDelta = 0.01;#else int idleWalkCount = 1000; int walkCount = 100; int walkRunCount = 1000; mAnimTimeDelta = 0.001;#endif // The idle head turning occurs too frequently (frequency = 1 in the // original model). Reduce the turning by half. mManager.SetIdle(0.5, 0.0); // The walk and run cycles must be aligned properly for blending. A // phase of 0.2 for the run cycle aligns the biped feet. mManager.SetRun(1.0, 0.2); // The initial state is 'idle'. mManager.Initialize(idleWalkCount, walkCount, walkRunCount);}
开发者ID:bhlzlx,项目名称:WildMagic,代码行数:36,
示例17: WindowApplication3//----------------------------------------------------------------------------ClipMesh::ClipMesh () : WindowApplication3("SampleMathematics/ClipMesh", 0, 0, 640, 480, Float4(0.75f, 0.75f, 0.75f, 1.0f)), mTextColor(1.0f, 1.0f, 1.0f, 1.0f){}
开发者ID:vijaynerella,项目名称:GeometricTools,代码行数:8,
示例18: WindowApplication2//----------------------------------------------------------------------------PolygonDistance::PolygonDistance () : WindowApplication2("SamplePhysics/PolygonDistance", 0, 0, 512, 512, Float4(1.0f, 1.0f, 1.0f, 1.0f)){ mSize = GetWidth();}
开发者ID:bhlzlx,项目名称:WildMagic,代码行数:8,
示例19: OnInit virtual void OnInit() { MGUI::FontManager::Instance()->Load("Sample.font"); MGUI::InputManager::Instance()->E_MouseUp += new ncListener1<const MGUI::MouseEvent *>(OnPick); MGUI::InputManager::Instance()->E_TouchUp += new ncListener1<const MGUI::TouchEvent *>(OnPickTE); World::Instance()->MainRenderContext()->SetColorClear(eClearMode::ALL, Float4(0.15f, 0.15f, 0.15f)); World::Instance()->MainCamera()->SetPosition(Float3(0, 5, -10)); World::Instance()->MainCamera()->SetDirection(Float3(0, -5, 10)); World::Instance()->MainLight()->SetDirection(Float3(0, -0.5f, 1)); gMeshFloor = MeshManager::Instance()->NewPlane(Plane(0, 1, 0, 0), 10, 10); gMeshFloor->GetSubMesh(0)->GetMaterial()->ambient = Float3(0.3f, 0.0f, 0.3f); gMeshFloor->GetSubMesh(0)->GetMaterial()->diffuse = Float3(0.0f, 0.0f, 0.0f); gMeshBox = MeshManager::Instance()->NewBox(1, 1, 1); gMeshBox->GetSubMesh(0)->GetMaterial()->ambient = Float3(0.1f, 0.1f, 0.1f); gMeshBox->GetSubMesh(0)->GetMaterial()->diffuse = Float3(0.0f, 0.5f, 0.0f); gMeshBox->SetPosition(Float3(0, 3, 0)); PhyWorld::Instance()->SetWorldGravity(0, -9.8f, 0); PhyWorld::Instance()->SetWorldContactSurfaceLayer(0.01f); gPhyEntityFloor = new PhyPlane; gPhyEntityFloor->SetCollisionFlag(FLAG_FLOOR); gPhyEntityBox = new PhyBox(PhyEntity::RIGID_BODY); gPhyEntityBox->SetBodyAutoDisable(false); gPhyEntityBox->SetLength(1, 1, 1); gPhyEntityBox->SetMass(5, 1, 1, 1); gPhyEntityBox->SetPosition(Float3(0, 3, 0)); gPhyEntityBox->SetBounceParam(1.0f, 1.0f); gPhyEntityBox->SetCollisionFlag(FLAG_BOX); gPhyEntityBox->SetAngularVel(Float3(2, 2, 2)); }
开发者ID:MSoft1115,项目名称:Rad3D,代码行数:35,
示例20: Float3void ExplosionSpherePhysicsObject::onUpdate(float delta){ //-------------------------------------------------------------------------------------- // Update scaling. Expand explosion sphere according to mutator settings retrieved in "subClassSpecificInitHook()" //-------------------------------------------------------------------------------------- std::vector<int> explosionSphereEntityId = itrPhysics.ownerAt(attributeIndex_)->getAttributes(ATTRIBUTE_EXPLOSIONSPHERE); for(unsigned int i = 0; i < explosionSphereEntityId.size(); i++) { AttributePtr<Attribute_ExplosionSphere> ptr_explosionSphere = itrExplosionSphere.at(explosionSphereEntityId.at(i)); ptr_explosionSphere->currentRadius += explosionSphereExpansionRate_*delta; if(ptr_explosionSphere->currentRadius >= explosionSphereFinalRadius_) { ptr_explosionSphere->currentRadius = explosionSphereFinalRadius_; } itrPhysics.at(attributeIndex_)->ptr_spatial->scale = Float3(ptr_explosionSphere->currentRadius,ptr_explosionSphere->currentRadius,ptr_explosionSphere->currentRadius); localCollisionShape_->setLocalScaling(btVector3(ptr_explosionSphere->currentRadius, ptr_explosionSphere->currentRadius, ptr_explosionSphere->currentRadius)); } //-------------------------------------------------------------------------------------- // Update rotation //-------------------------------------------------------------------------------------- btQuaternion randomRotationQuaternion (randomRotation_.x()*delta,randomRotation_.y()*delta,randomRotation_.z()*delta); btQuaternion rotateWithRandomRotationQuaternion = randomRotationQuaternion*getWorldTransform().getRotation(); getWorldTransform().setRotation(rotateWithRandomRotationQuaternion); itrPhysics.at(attributeIndex_)->ptr_spatial->rotation = Float4(rotateWithRandomRotationQuaternion.x(),rotateWithRandomRotationQuaternion.y(),rotateWithRandomRotationQuaternion.z(),rotateWithRandomRotationQuaternion.w());}
开发者ID:CaterHatterPillar,项目名称:xkill-source,代码行数:26,
示例21: WindowApplication3//----------------------------------------------------------------------------IntersectConvexPolyhedra::IntersectConvexPolyhedra () : WindowApplication3("SampleMathematics/IntersectConvexPolyhedra", 0, 0, 640, 480, Float4(0.75f, 0.75f, 0.75f, 1.0f)), mTextColor(1.0f, 1.0f, 1.0f, 1.0f){}
开发者ID:rasslingcats,项目名称:calico,代码行数:8,
示例22: WindowApplication2//----------------------------------------------------------------------------BSplineCurveExamples::BSplineCurveExamples () : WindowApplication2("SamplePhysics/BSplineCurveExamples", 0, 0, 128, 128, Float4(1.0f, 1.0f, 1.0f, 1.0f)){ mSpline = 0; mCtrlPoint = 0; mKnot = 0; mCurveType = 0; mModified = false; mLocCtrlMin[0] = 1.0f/3.0f; mLocCtrlMax[0] = 5.0f/6.0f; mLocCtrlMin[1] = 1.0f/5.0f; mLocCtrlMax[1] = 4.0f/5.0f; mLocCtrlMin[2] = 1.0f/3.0f; mLocCtrlMax[2] = 5.0f/6.0f; mLocCtrlMin[3] = 2.0f/7.0f; mLocCtrlMax[3] = 5.0f/7.0f; mLocCtrlMin[4] = 1.0f/5.0f; mLocCtrlMax[4] = 4.0f/5.0f; mLocCtrlMin[5] = 1.0f/4.0f; mLocCtrlMax[5] = 5.0f/8.0f; mSize = GetWidth(); mV0 = mSize/16.0f; mV1 = 0.5f*mSize; mV2 = 15.0f*mSize/16.0f;}
开发者ID:2asoft,项目名称:GeometricTools,代码行数:30,
示例23: WindowApplication3//----------------------------------------------------------------------------Delaunay3D::Delaunay3D () : WindowApplication3("SampleMathematics/Delaunay3D", 0, 0, 640, 480, Float4(1.0f, 1.0f, 1.0f, 1.0f)){ mDelaunay = 0;}
开发者ID:rasslingcats,项目名称:calico,代码行数:8,
示例24: WindowApplication3//----------------------------------------------------------------------------ReflectionsAndShadows::ReflectionsAndShadows () : WindowApplication3("SampleGraphics/ReflectionsAndShadows", 0, 0, 640, 480, Float4(0.5f, 0.0f, 1.0f, 1.0f)), mTextColor(0.0f, 0.0f, 0.0f, 1.0f){ mUpdateTime = 0.0;}
开发者ID:rasslingcats,项目名称:calico,代码行数:9,
注:本文中的Float4函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ FloatAsInt函数代码示例 C++ Float3函数代码示例 |