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


C++ PointLight::SetRange方法代码示例

本文整理汇总了C++中PointLight::SetRange方法的典型用法代码示例。如果您正苦于以下问题:C++ PointLight::SetRange方法的具体用法?C++ PointLight::SetRange怎么用?C++ PointLight::SetRange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PointLight的用法示例。


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

示例1: OnAddPointLight_Click

void MainForm::OnAddPointLight_Click(wxMouseEvent & evt)
{
	PointLightPtr ptr = scene->AddPointLight();
	PointLight * p = ptr.Get();
	p->SetPosition(0.0f, 0.0f, 0.0f);
	p->SetDiffuse(1.0f,1.0f,1.0f,1.0f);
	p->SetRange(100.0f);

	EditorPointLight * pl = new EditorPointLight(ptr);
	EditorSceneObjectsManager::GetPtr()->AddElement(pl);

	ActiveTool::Set(new SelectTool());
}
开发者ID:dgi09,项目名称:D3D,代码行数:13,代码来源:MainForm.cpp

示例2: Init

void Dragon_Dogs_ParticleSystem::Init(Scene * scene)
{

    StaticEntityPtr skyPtr = scene->AddStaticEntity("assets/sphere.smodel", "sky");
    StaticEntity * sky = skyPtr.Get();
    sky->Illuminate(false);
    sky->SetScale(10000, 10000, 10000);

    Material * m = sky->GetMaterial(0);
    m->SetDiffuseMap("assets/risinger.jpg");
    m->UseDiffuseMap(true);

    psPtr = scene->AddParticleSystem();
    ParticleSystem * ps = psPtr.Get();
    ps->SetColorTexture("assets/fire.png");
    ps->SetEmmiterPosition(Vector3(45.0f, 0.0f, 0.0f));
    ps->SetMinSpawnPosition(Vector3(-1.0f, 0.0f, 0.0f));
    ps->SetMaxSpawnPosition(Vector3(1.0f, 0.0f, 0.0f));
    ps->SetMaxLifeTime(70);
    ps->SetMinLifeTime(50);
    ps->SetMaxParticles(70);
    ps->SetSpawnTime(4.0);
    ps->SetMinSize(10);
    ps->SetMaxSize(14);
    ////entitiy->SetPosition(10.0f,0.0f,0.0f);


    drPtr = scene->AddParticleSystem();
    ps = drPtr.Get();

    ps->SetColorTexture("assets/fire.png");
    ps->SetEmmiterPosition(Vector3(-30.0f, 150.0, 10.0f));
    ps->SetMinSpawnPosition(Vector3(-0.2f, 0.3f, 0.0f));
    ps->SetMaxSpawnPosition(Vector3(0.2f, -0.3f, 0.0f));
    ps->SetMinSpawnVelocity(Vector3(-1.0f, -2.0f, -1.8f));
    ps->SetMaxSpawnVelocity(Vector3(1.0f, -2.0f, -1.0f));
    ps->SetMaxLifeTime(30);
    ps->SetMinLifeTime(45);
    ps->SetMaxParticles(70);
    ps->SetSpawnTime(4.0);
    ps->SetMinSize(10);
    ps->SetMaxSize(14);
    ps->AllowParticleAdd(false);

    plDragon = scene->AddPointLight();
    PointLight * plD = plDragon.Get();
    plD->SetDiffuse(1.0f, 0.4f, 0.0f, 1.0f);
    plD->SetRange(1.0f);
    plD->SetPosition(-30.0f, 150.0, 10.0f);

    dragonTime = 0;
    dragonOn = false;
    enPtr = scene->AddAnimatedEntity("assets/ninja.model", "ninja");

    AnimatedEntity * en = enPtr.Get();
    en->SetPosition(0.0f, 0.0f, 0.0f);
    en->Illuminate(true);
    en->SetScale(10.0f, 10.0f, 10.0f);
    en->SetPosZ(-100);
    //en->SetRotationY(90.0f);

    Material * mat = en->GetMaterial(0);
    mat->UseDiffuseMap(true);
    mat->SetDiffuseColor(Color::White());
    mat->SetDiffuseMap("assets/nskin.jpg");

    mat->SetEmmisivePower(1);
    mat->SetSpecularPower(0);
    mat->SetSpecularIntesity(0);

    mat = en->GetMaterial(1);
    mat->UseDiffuseMap(false);
    mat->SetEmmisivePower(1);
    mat->SetSpecularIntesity(0);
    mat->SetSpecularPower(0);
    mat->SetDiffuseColor(Color(0.3f, 0.3f, 0.3f, 1.0f));

    pointLight = scene->AddPointLight();

    PointLight * p = pointLight.Get();
    p->SetDiffuse(1.0f, 0.4f, 0.0f, 1.0f);
    p->SetRange(500.0f);
    p->SetPosition(45.0f, 4.0f, 0.0f);

    planePtr = scene->AddStaticEntity("assets/plane.model", "plane");
    StaticEntity * plane = planePtr.Get();
    plane->Illuminate(true);
    plane->SetScale(500.0f, 1.0f, 500.0f);

    Material * pMat = plane->GetMaterial(0);
    pMat->UseDiffuseMap(false);
    pMat->SetDiffuseColor(Color(0.3f, 0.3f, 0.3f, 1.0f));
    pMat->SetEmmisivePower(1);
    pMat->SetSpecularPower(0);
    pMat->SetSpecularIntesity(0);

    plane->SetPosition(0.0f, -7.0f, 0.0f);

    dogPtr = scene->AddStaticEntity("assets/dog.smodel", "dog");
    StaticEntity * dog = dogPtr.Get();
//.........这里部分代码省略.........
开发者ID:dgi09,项目名称:D3D,代码行数:101,代码来源:Dragon_Dogs_ParticleSystem.cpp


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