Commit 5bf2da77 authored by Sreekanth Arikatla's avatar Sreekanth Arikatla
Browse files

REFAC: Remove name from the light class

Remove name from the light class. It is now maintained exclusively in the scene class.
parent c01ea335
Pipeline #234587 failed with stage
......@@ -88,10 +88,10 @@ main()
InteractionType::CollidingObjToCollidingObjBoneDrilling, CollisionDetection::Type::PointSetToSphere));
// Light
imstkNew<DirectionalLight> light("light");
imstkNew<DirectionalLight> light;
light->setFocalPoint(Vec3d(5.0, -8.0, -5.0));
light->setIntensity(1.0);
scene->addLight(light);
scene->addLight("light0", light);
scene->getActiveCamera()->setPosition(Vec3d(0.0, 3.0, 25.0));
......
......@@ -77,10 +77,10 @@ main()
scene->addController(camController);
// Light
imstkNew<DirectionalLight> light("light");
imstkNew<DirectionalLight> light;
light->setFocalPoint(Vec3d(5.0, -8.0, -5.0));
light->setIntensity(1.0);
scene->addLight(light);
scene->addLight("light0", light);
// Run the simulation
{
......
......@@ -456,15 +456,15 @@ main()
scene->getActiveCamera()->setPosition(Vec3d(0.0, 15.0, 50.0));
// Light
imstkNew<DirectionalLight> light1("Light1");
imstkNew<DirectionalLight> light1;
light1->setFocalPoint(Vec3d(-1.0, -1.0, -1.0));
light1->setIntensity(1.0);
scene->addLight(light1);
scene->addLight("light1", light1);
imstkNew<DirectionalLight> light2("Light2");
imstkNew<DirectionalLight> light2;
light2->setFocalPoint(Vec3d(1.0, -1.0, -1.0));
light2->setIntensity(1.0);
scene->addLight(light2);
scene->addLight("light2", light2);
// Run the simulation
{
......
......@@ -84,10 +84,10 @@ main()
scene->addSceneObject(volObject);
// Light
imstkNew<DirectionalLight> light("light");
imstkNew<DirectionalLight> light;
light->setFocalPoint(Vec3d(5.0, -8.0, -5.0));
light->setIntensity(1);
scene->addLight(light);
scene->addLight("light0", light);
}
// Run the simulation
......
......@@ -178,15 +178,15 @@ main()
scene->getActiveCamera()->setPosition(Vec3d(0.0, 0.0, 50.0));
// Light
imstkNew<DirectionalLight> light1("light1");
imstkNew<DirectionalLight> light1;
light1->setFocalPoint(Vec3d(-1.0, -1.0, -1.0));
light1->setIntensity(1.0);
scene->addLight(light1);
scene->addLight("light1", light1);
imstkNew<DirectionalLight> light2("light2");
imstkNew<DirectionalLight> light2;
light2->setFocalPoint(Vec3d(1.0, -1.0, -1.0));
light2->setIntensity(1.0);
scene->addLight(light2);
scene->addLight("light2", light2);
// Run the simulation
{
......
......@@ -106,10 +106,10 @@ main()
scene->addSceneObject(planeObj);
// Light
imstkNew<DirectionalLight> light("light");
imstkNew<DirectionalLight> light;
light->setFocalPoint(Vec3d(5.0, -8.0, -5.0));
light->setIntensity(1);
scene->addLight(light);
scene->addLight("light", light);
}
// Run the simulation
......
......@@ -131,10 +131,10 @@ main()
scene->getCollisionGraph()->addInteraction(interaction);
// Light (white)
imstkNew<DirectionalLight> whiteLight("whiteLight");
imstkNew<DirectionalLight> whiteLight;
whiteLight->setDirection(Vec3d(0.0, -8.0, 5.0));
whiteLight->setIntensity(1.0);
scene->addLight(whiteLight);
scene->addLight("whiteLight", whiteLight);
// Adjust camera
scene->getActiveCamera()->setFocalPoint(0.25, 0.83, 1.58);
......
......@@ -109,10 +109,10 @@ main()
scene->getActiveCamera()->setPosition(Vec3d(0.0, 12.0, 12.0));
// Light
imstkNew<DirectionalLight> light("light");
imstkNew<DirectionalLight> light;
light->setFocalPoint(Vec3d(5.0, -8.0, -5.0));
light->setIntensity(1);
scene->addLight(light);
scene->addLight("light", light);
// Run the simulation
{
......
......@@ -113,10 +113,10 @@ main()
scene->getActiveCamera()->setPosition(Vec3d(0.0, 30.0, 30.0));
// Light
imstkNew<DirectionalLight> light("light");
imstkNew<DirectionalLight> light;
light->setDirection(Vec3d(5.0, -8.0, -5.0));
light->setIntensity(1.0);
scene->addLight(light);
scene->addLight("light", light);
// Run the simulation
{
......
......@@ -111,10 +111,10 @@ main()
scene->addSceneObject(obj);
// Light (white)
imstkNew<DirectionalLight> whiteLight("whiteLight");
imstkNew<DirectionalLight> whiteLight;
whiteLight->setFocalPoint(Vec3d(5.0, -8.0, -5.0));
whiteLight->setIntensity(1.0);
scene->addLight(whiteLight);
scene->addLight("whitelight", whiteLight);
// Adjust camera
scene->getActiveCamera()->setPosition(0.0, 10.0, -10.0);
......
......@@ -211,19 +211,19 @@ createClothScene(std::string sceneName)
scene->addSceneObject(clothObj);
// Light (white)
imstkNew<DirectionalLight> whiteLight("whiteLight");
imstkNew<DirectionalLight> whiteLight;
whiteLight->setFocalPoint(Vec3d(5.0, -8.0, -5.0));
whiteLight->setIntensity(1.0);
scene->addLight(whiteLight);
scene->addLight("whitelight", whiteLight);
// Light (red)
imstkNew<SpotLight> colorLight("colorLight");
imstkNew<SpotLight> colorLight;
colorLight->setPosition(Vec3d(-5.0, -3.0, 5.0));
colorLight->setFocalPoint(Vec3d(0.0, -5.0, 5.0));
colorLight->setIntensity(100.);
colorLight->setColor(Color::Red);
colorLight->setSpotAngle(30.0);
scene->addLight(colorLight);
scene->addLight("colorlight", colorLight);
// Adjust camera
scene->getActiveCamera()->setFocalPoint(0.0, -5.0, 5.0);
......
......@@ -81,10 +81,10 @@ main()
cam->setFocalPoint(geometries[0]->getPosition());
// Light
imstkNew<DirectionalLight> light("light");
imstkNew<DirectionalLight> light;
light->setDirection(Vec3d(5.0, -8.0, -5.0));
light->setIntensity(1.0);
scene->addLight(light);
scene->addLight("light", light);
//Run the simulation
{
......
......@@ -77,10 +77,10 @@ main()
scene->getActiveCamera()->setFocalPoint(geom->getPosition());
// Light
imstkNew<DirectionalLight> light("light");
imstkNew<DirectionalLight> light;
light->setFocalPoint(Vec3d(5.0, -8.0, -5.0));
light->setIntensity(1.0);
scene->addLight(light);
scene->addLight("light", light);
// Run the simulation
{
......
......@@ -264,15 +264,15 @@ main()
// Lights
{
imstkNew<DirectionalLight> light1("Light 1");
imstkNew<DirectionalLight> light1;
light1->setFocalPoint(Vec3d(-1.0, -1.0, -1.0));
light1->setIntensity(1.0);
scene->addLight(light1);
scene->addLight("light 1", light1);
imstkNew<DirectionalLight> light2("Light 2");
imstkNew<DirectionalLight> light2;
light2->setFocalPoint(Vec3d(1.0, -1.0, -1.0));
light2->setIntensity(1.0);
scene->addLight(light2);
scene->addLight("light 2", light2);
}
// Run the simulation
......
......@@ -118,10 +118,10 @@ main()
scene->addSceneObject(tableObj);
// Lights
imstkNew<DirectionalLight> dirLight("DirLight");
imstkNew<DirectionalLight> dirLight;
dirLight->setIntensity(4);
dirLight->setColor(Color(1.0, 0.95, 0.8));
scene->addLight(dirLight);
scene->addLight("dirlight", dirLight);
{
// Add a module to run the viewer
......
......@@ -167,19 +167,19 @@ main()
scene->addSceneObject(clothObj);
// Light (white)
imstkNew<DirectionalLight> whiteLight("whiteLight");
imstkNew<DirectionalLight> whiteLight;
whiteLight->setFocalPoint(Vec3d(5.0, -8.0, -5.0));
whiteLight->setIntensity(1.0);
scene->addLight(whiteLight);
scene->addLight("whitelight", whiteLight);
// Light (red)
imstkNew<SpotLight> colorLight("colorLight");
imstkNew<SpotLight> colorLight;
colorLight->setPosition(Vec3d(-5.0, -3.0, 5.0));
colorLight->setFocalPoint(Vec3d(0.0, -5.0, 5.0));
colorLight->setIntensity(100.);
colorLight->setColor(Color::Red);
colorLight->setSpotAngle(30.0);
scene->addLight(colorLight);
scene->addLight("colorlight", colorLight);
// Adjust camera
scene->getActiveCamera()->setFocalPoint(0.0, -5.0, 5.0);
......
......@@ -147,10 +147,10 @@ main()
}
// Light
imstkNew<DirectionalLight> light("light");
imstkNew<DirectionalLight> light;
light->setFocalPoint(Vec3d(5, -8, -5));
light->setIntensity(1);
scene->addLight(light);
scene->addLight("light", light);
// Set Camera configuration
std::shared_ptr<Camera> cam = scene->getActiveCamera();
......
......@@ -159,10 +159,10 @@ main()
InteractionType::PbdObjToPbdObjCollision, CollisionDetection::Type::MeshToMeshBruteForce));
// Light
imstkNew<DirectionalLight> light("Light");
imstkNew<DirectionalLight> light;
light->setFocalPoint(Vec3d(5, -8, -5));
light->setIntensity(1);
scene->addLight(light);
scene->addLight("light0", light);
}
// Run the simulation
......
......@@ -209,15 +209,15 @@ main()
InteractionType::PbdObjToPbdObjCollision, CollisionDetection::Type::MeshToMeshBruteForce));
// Light
imstkNew<DirectionalLight> light("Light1");
imstkNew<DirectionalLight> light;
light->setFocalPoint(Vec3d(5.0, -8.0, 5.0));
light->setIntensity(1.0);
scene->addLight(light);
scene->addLight("light", light);
imstkNew<DirectionalLight> light2("Light2");
imstkNew<DirectionalLight> light2;
light2->setFocalPoint(-Vec3d(5, -8, 5));
light2->setIntensity(1.2);
scene->addLight(light2);
scene->addLight("light2", light2);
}
// Run the simulation
......
......@@ -65,10 +65,10 @@ main()
scene->addSceneObject(createAndAddPbdObject(tetMeshFileName));
// Light
imstkNew<DirectionalLight> light("light");
imstkNew<DirectionalLight> light;
light->setFocalPoint(Vec3d(5, -8, -5));
light->setIntensity(1.1);
scene->addLight(light);
scene->addLight("light", light);
// Run the simulation
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment