Gitlab.kitware.com will be offline between 8am and midnight (EST/UTC-0500) on Saturday, December 15th.

Commit 67331323 authored by Sreekanth Arikatla's avatar Sreekanth Arikatla

Merge branch 'modifyExamples' into 'master'

REFAC: Clean the examples

See merge request !273
parents 3cf901c7 77ae7a5f
Pipeline #125482 passed with stage
in 0 seconds
Announcement: iMSTK 1.0.0
===============================
We are introducing Interactive Medical Simulation Toolkit (iMSTK)-a free & open source software toolkit written in C++ that aids rapid prototyping of interactive multi-modal surgical simulations.
For more information, visit our website
http://www.imstk.org/
Features
------------
- Cross-platform build
- CMake automated superbuild
- Test infrastructure (via google test)
- Continuous Integration
- Scene and simulation management
- Vulkan and VTK rendering backends
- Advanced rendering: Physically based rendering, Subsurface scattering, Decals, Shadows,
- Graphical overlays (Vulkan backend only)
- Standard user controls (pause, run, exit, pan-zoom-rotate)
- VR support (Oculus, HTC Vive)
- Finite elements (linear, co-rotational, non-linear formulations)
- Position based dynamics
- Penalty and constraint based collision handling
- Linear solvers: Direct and Iterative matrix solvers
- Non-linear Newton solver
- Collision detection (CCD, Spatial hash based collision, narrow phase queries)
- External device support
- Support for standard mesh input formats (.obj, .dae, .fbx., .stl, .vtk, .vtu, etc.)
- Asynchronous logging (using g3log)
- Audio support
- Haptic rendering
Contributors for this release
-----------------------------
Venkata Sreekanth Arikatla
Alexis Girault
Nicholas Boris Milef
Ricardo Ortiz
Thien Nguyen
Rachel Clipp
Mohit Tyagi
Samantha Horvath
Jean-Baptiste Vimort
Sean Radigan
David Thompson
Dženan Zukić
Mayeul Chassagnard
Tansel Halic
Hina Shah
Andinet Enquobahrie
Hong Li
Shusil Dangi
......@@ -80,22 +80,6 @@ int main()
scene->addDebugGeometry(debugLinesGeo);
// Create debug points
auto debugPointsGeo = std::make_shared<DebugRenderPoints>("debugPoints", 50);
StdVectorOfVec3d points;
for (unsigned int i = 0; i < 50; ++i)
{
points.push_back(Vec3d(i, i, i));
}
debugPointsGeo->setVertexData(points);
auto materialPoints = std::make_shared<RenderMaterial>();
materialPoints->setBackFaceCulling(false);
materialPoints->setDebugColor(Color::Pink);
debugPointsGeo->setRenderMaterial(materialPoints);
scene->addDebugGeometry(debugPointsGeo);
// Add light
auto light = std::make_shared<DirectionalLight>("light");
light->setFocalPoint(Vec3d(5, -8, -5));
......
......@@ -37,16 +37,16 @@ using namespace imstk;
///
/// \brief This example demonstrates the soft body simulation
/// using FEM
/// using Finite elements
///
int main()
{
// a. SDK and Scene
// SDK and Scene
auto sdk = std::make_shared<SimulationManager>();
auto scene = sdk->createNewScene("DeformableBody");
auto scene = sdk->createNewScene("DeformableBodyFEM");
scene->getCamera()->setPosition(0, 2.0, 15.0);
// b. Load a tetrahedral mesh
// Load a tetrahedral mesh
auto tetMesh = MeshIO::read(iMSTK_DATA_ROOT "/asianDragon/asianDragon.veg");
if (!tetMesh)
{
......@@ -54,7 +54,7 @@ int main()
return 1;
}
// c. Extract the surface mesh
// Extract the surface mesh
auto surfMesh = std::make_shared<SurfaceMesh>();
auto volTetMesh = std::dynamic_pointer_cast<TetrahedralMesh>(tetMesh);
if (!volTetMesh)
......@@ -70,20 +70,20 @@ int main()
wct.start();
cput.start();
// d. Construct a map
// Construct a map
// d.1 Construct one to one nodal map based on the above meshes
// Construct one to one nodal map based on the above meshes
auto oneToOneNodalMap = std::make_shared<OneToOneMap>();
oneToOneNodalMap->setMaster(tetMesh);
oneToOneNodalMap->setSlave(surfMesh);
// d.2 Compute the map
// Compute the map
oneToOneNodalMap->compute();
LOG(INFO) << "wall clock time: " << wct.getTimeElapsed() << " ms.";
LOG(INFO) << "CPU time: " << cput.getTimeElapsed() << " ms.";
// e. Scene object 1: Dragon
// Scene object 1: Dragon
// Configure dynamic model
auto dynaModel = std::make_shared<FEMDeformableBodyModel>();
......@@ -100,13 +100,13 @@ int main()
// Scene Object
auto deformableObj = std::make_shared<DeformableObject>("Dragon");
deformableObj->setVisualGeometry(surfMesh);
deformableObj->addVisualModel(surfMeshModel);
deformableObj->setPhysicsGeometry(volTetMesh);
deformableObj->setPhysicsToVisualMap(oneToOneNodalMap); //assign the computed map
deformableObj->setDynamicalModel(dynaModel);
scene->addSceneObject(deformableObj);
// f. Scene object 2: Plane
// Scene object 2: Plane
auto planeGeom = std::make_shared<Plane>();
planeGeom->setWidth(40);
planeGeom->setPosition(0, -6, 0);
......@@ -115,11 +115,6 @@ int main()
planeObj->setCollidingGeometry(planeGeom);
scene->addSceneObject(planeObj);
// g. Add collision detection
//auto collisioDet = std::make_shared<CollisionDetection>();
// h. Add collision handling
// create a nonlinear system
auto nlSystem = std::make_shared<NonLinearSystem>(
dynaModel->getFunction(),
......
......@@ -16,27 +16,31 @@
#
###########################################################################
project(Example-GUIOverlay)
if(iMSTK_USE_Vulkan)
#-----------------------------------------------------------------------------
# Create executable
#-----------------------------------------------------------------------------
add_executable(${PROJECT_NAME} GUIOverlayExample.cpp)
project(Example-GUIOverlay)
#-----------------------------------------------------------------------------
# Link libraries to executable
#-----------------------------------------------------------------------------
target_link_libraries(${PROJECT_NAME} SimulationManager)
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Associate external data
#-----------------------------------------------------------------------------
list(APPEND FILE_LIST
decals/,REGEX:.*)
imstk_add_data(${PROJECT_NAME} ${FILE_LIST})
\ No newline at end of file
#-----------------------------------------------------------------------------
# Create executable
#-----------------------------------------------------------------------------
add_executable(${PROJECT_NAME} GUIOverlayExample.cpp)
#-----------------------------------------------------------------------------
# Link libraries to executable
#-----------------------------------------------------------------------------
target_link_libraries(${PROJECT_NAME} SimulationManager)
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Associate external data
#-----------------------------------------------------------------------------
list(APPEND FILE_LIST
decals/,REGEX:.*)
imstk_add_data(${PROJECT_NAME} ${FILE_LIST})
endif()
\ No newline at end of file
###########################################################################
#
# Copyright (c) Kitware, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
###########################################################################
if(iMSTK_USE_OMNI)
project(Example-LapToolController)
#-----------------------------------------------------------------------------
# Create executable
#-----------------------------------------------------------------------------
add_executable(${PROJECT_NAME} lapToolControllerExample.cpp)
#-----------------------------------------------------------------------------
# Link libraries to executable
#-----------------------------------------------------------------------------
target_link_libraries(${PROJECT_NAME} SimulationManager)
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Associate external data
#-----------------------------------------------------------------------------
list(APPEND FILE_LIST
laptool/,REGEX:.*)
imstk_add_data(${PROJECT_NAME} ${FILE_LIST})
endif()
\ No newline at end of file
/*=========================================================================
Library: iMSTK
Copyright (c) Kitware, Inc. & Center for Modeling, Simulation,
& Imaging in Medicine, Rensselaer Polytechnic Institute.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0.txt
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=========================================================================*/
#include "imstkSimulationManager.h"
#include "imstkAPIUtilities.h"
#include "imstkHDAPIDeviceClient.h"
#include "imstkHDAPIDeviceServer.h"
#include "imstkLaparoscopicToolController.h"
const std::string phantomOmni1Name = "Phantom1";
using namespace imstk;
///
/// \brief This example demonstrates controlling laparoscopic
/// tool with two jaws with an external device.
/// NOTE: Requires GeoMagic Touch device
///
int main()
{
#ifdef iMSTK_USE_OPENHAPTICS
// SDK and Scene
auto sdk = std::make_shared<SimulationManager>();
auto scene = sdk->createNewScene("LapToolController");
// Device clients
auto client0 = std::make_shared<HDAPIDeviceClient>(phantomOmni1Name);
// Device Server
auto server = std::make_shared<HDAPIDeviceServer>();
server->addDeviceClient(client0);
sdk->addModule(server);
// Plane
auto planeObj = apiutils::createVisualAnalyticalSceneObject(
Geometry::Type::Plane, scene, "VisualPlane", 100., Vec3d(0., -20., 0.));
// laparoscopic tool
auto pivot = apiutils::createAndAddVisualSceneObject(scene, iMSTK_DATA_ROOT "/laptool/pivot.obj", "pivot");
auto upperJaw = apiutils::createAndAddVisualSceneObject(scene, iMSTK_DATA_ROOT "/laptool/upper.obj", "upperJaw");
auto lowerJaw = apiutils::createAndAddVisualSceneObject(scene, iMSTK_DATA_ROOT "/laptool/lower.obj", "lowerJaw");
auto trackingCtrl = std::make_shared<DeviceTracker>(client0);
trackingCtrl->setTranslationScaling(0.5);
auto lapToolController = std::make_shared<LaparoscopicToolController>(pivot, upperJaw, lowerJaw, trackingCtrl);
lapToolController->setJawRotationAxis(Vec3d(1.0, 0, 0));
lapToolController->setJawAngleChange(0.1);
scene->addObjectController(lapToolController);
// Set Camera
auto cam = scene->getCamera();
cam->setPosition(Vec3d(0, 30, 60));
cam->setFocalPoint(Vec3d(0, 0, 0));
// Light
auto light = std::make_shared<DirectionalLight>("light");
light->setFocalPoint(Vec3d(5, -8, -5));
light->setIntensity(1);
scene->addLight(light);
// Run
sdk->setActiveScene(scene);
sdk->startSimulation(SimulationStatus::PAUSED);
return 0;
#else if
std::cout << "LaparoscopicToolController example needs haptic device to be enabled at build time" << std::endl;
return 1;
#endif
}
......@@ -55,6 +55,7 @@ int main()
auto volumeMesh = std::dynamic_pointer_cast<VolumetricMesh>(vegaMesh); // change to any volumetric mesh above
volumeMesh->computeAttachedSurfaceMesh();
auto surfaceMesh = volumeMesh->getAttachedSurfaceMesh();
surfaceMesh->correctWindingOrder();
// Create object and add to scene
auto object = std::make_shared<VisualObject>("meshObject");
......
......@@ -47,6 +47,8 @@ int main()
auto volumeMeshA = std::dynamic_pointer_cast<VolumetricMesh>(volMeshA); // change to any volumetric mesh above
volumeMeshA->computeAttachedSurfaceMesh();
auto surfaceMeshA = volumeMeshA->getAttachedSurfaceMesh();
surfaceMeshA->correctWindingOrder();
surfaceMeshA->flipNormals();
// Create object A
auto objectA = std::make_shared<VisualObject>("meshObjectMSH");
......@@ -72,10 +74,12 @@ int main()
auto volumeMeshB = std::dynamic_pointer_cast<VolumetricMesh>(volMeshB); // change to any volumetric mesh above
volumeMeshB->computeAttachedSurfaceMesh();
auto surfaceMeshB = volumeMeshB->getAttachedSurfaceMesh();
surfaceMeshB->correctWindingOrder();
surfaceMeshB->flipNormals();
// Create object B
auto objectB = std::make_shared<VisualObject>("meshObjectVEGA");
surfaceMeshB->translate(Vec3d(3, 0, 0), Geometry::TransformType::ApplyToData);
surfaceMeshB->translate(Vec3d(10, 0, 0), Geometry::TransformType::ApplyToData);
objectB->setVisualGeometry(surfaceMeshB);
// Add objects to the scene
......
......@@ -37,9 +37,7 @@ int main()
auto sdk = std::make_shared<SimulationManager>(runSimWithoutRendering);
auto scene = sdk->createNewScene("PBDCloth");
// a. Construct a sample triangular mesh
// b. Add nodal data
// Create surface mesh
auto surfMesh = std::make_shared<SurfaceMesh>();
StdVectorOfVec3d vertList;
const double width = 10.0;
......@@ -59,7 +57,7 @@ int main()
surfMesh->setInitialVertexPositions(vertList);
surfMesh->setVertexPositions(vertList);
// c. Add connectivity data
// Add connectivity data
std::vector<SurfaceMesh::TriangleArray> triangles;
for (std::size_t i = 0; i < nRows - 1; ++i)
{
......@@ -75,7 +73,7 @@ int main()
surfMesh->setTrianglesVertices(triangles);
// Object & Model
// Create Object & Model
auto deformableObj = std::make_shared<PbdObject>("Cloth");
auto pbdModel = std::make_shared<PbdModel>();
pbdModel->setModelGeometry(surfMesh);
......
......@@ -39,7 +39,7 @@ int main()
scene->getCamera()->setPosition(0, 10.0, 15.0);
// dragon
// Load a sample mesh
auto tetMesh = MeshIO::read(iMSTK_DATA_ROOT "/asianDragon/asianDragon.veg");
if (!tetMesh)
{
......@@ -81,7 +81,7 @@ int main()
scene->addSceneObject(deformableObj);
// box
// Create a box to hold the fluid
StdVectorOfVec3d vertList;
int nSides = 5;
double width = 40.0;
......
......@@ -38,7 +38,7 @@ int main()
auto scene = sdk->createNewScene("PBDVolume");
scene->getCamera()->setPosition(0, 2.0, 15.0);
// b. Load a tetrahedral mesh
// Load a sample mesh
auto tetMesh = MeshIO::read(iMSTK_DATA_ROOT "/asianDragon/asianDragon.veg");
if (!tetMesh)
{
......@@ -46,7 +46,7 @@ int main()
return 1;
}
// c. Extract the surface mesh
// Extract the surface mesh
auto surfMesh = std::make_shared<SurfaceMesh>();
auto volTetMesh = std::dynamic_pointer_cast<TetrahedralMesh>(tetMesh);
if (!volTetMesh)
......@@ -61,14 +61,14 @@ int main()
auto surfMeshModel = std::make_shared<VisualModel>(surfMesh);
surfMeshModel->setRenderMaterial(material);
// d. Construct a map
// Construct a map
// d.1 Construct one to one nodal map based on the above meshes
// Construct one to one nodal map based on the above meshes
auto oneToOneNodalMap = std::make_shared<OneToOneMap>();
oneToOneNodalMap->setMaster(tetMesh);
oneToOneNodalMap->setSlave(surfMesh);
// d.2 Compute the map
// Compute the map
oneToOneNodalMap->compute();
auto deformableObj = std::make_shared<PbdObject>("Beam");
......@@ -84,7 +84,7 @@ int main()
);
deformableObj->setDynamicalModel(pbdModel);
deformableObj->setVisualGeometry(surfMesh);
deformableObj->addVisualModel(surfMeshModel);
deformableObj->setPhysicsGeometry(volTetMesh);
deformableObj->setPhysicsToVisualMap(oneToOneNodalMap); //assign the computed map
......
###########################################################################
#
# Copyright (c) Kitware, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0.txt
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
###########################################################################
if(iMSTK_USE_OMNI)
project(Example-Picking)
#-----------------------------------------------------------------------------
# Create executable
#-----------------------------------------------------------------------------
add_executable(${PROJECT_NAME} PickingExample.cpp)
#-----------------------------------------------------------------------------
# Link libraries to executable
#-----------------------------------------------------------------------------
target_link_libraries(${PROJECT_NAME} SimulationManager)
#-----------------------------------------------------------------------------
# Add shaders
#-----------------------------------------------------------------------------
include(imstkCopyAndCompileShaders)
CopyAndCompileShaders()
#-----------------------------------------------------------------------------
# Associate external data
#-----------------------------------------------------------------------------
list(APPEND FILE_LIST
oneTet/,REGEX:.*)
imstk_add_data(${PROJECT_NAME} ${FILE_LIST})
endif()
\ No newline at end of file
/*=========================================================================
Library: iMSTK
Copyright (c) Kitware, Inc. & Center for Modeling, Simulation,
& Imaging in Medicine, Rensselaer Polytechnic Institute.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0.txt
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=========================================================================*/
#include "imstkSimulationManager.h"
#include "imstkMeshIO.h"
#include "imstkAPIUtilities.h"
#include "imstkPickingCH.h"
#include "imstkTetrahedralMesh.h"
#include "imstkOneToOneMap.h"
#include "imstkBackwardEuler.h"
#include "imstkDeformableObject.h"
#include "imstkConjugateGradient.h"
#include "imstkHDAPIDeviceServer.h"
#include "imstkHDAPIDeviceClient.h"
#include "imstkPointSetToSpherePickingCD.h"
#include "imstkSceneObjectController.h"
// global variables
const std::string phantomOmni1Name = "Phantom1";
using namespace imstk;
///
/// \brief This example demonstrates picking nodes of soft object.
/// NOTE: Requires GeoMagic Touch device
///
int main()
{
#ifndef iMSTK_USE_OPENHAPTICS
std::cout << "LaparoscopicToolController example needs haptic device to be enabled at build time" << std::endl;
return 1;
#else if
// SDK and Scene
auto sdk = std::make_shared<SimulationManager>();
auto scene = sdk->createNewScene("Picking");
//----------------------------------------------------------
// Create plane visual scene object
//----------------------------------------------------------
auto planeObj = apiutils::createVisualAnalyticalSceneObject(
Geometry::Type::Plane, scene, "VisualPlane", 100, Vec3d(0., -20., 0.));
//----------------------------------------------------------
// Create Nidus FE deformable scene object
//----------------------------------------------------------
// Load a tetrahedral mesh
auto tetMesh = MeshIO::read(iMSTK_DATA_ROOT "/oneTet/oneTet.veg");
if (!tetMesh)
{
LOG(WARNING) << "Could not read mesh from file.";
return 1;
}
tetMesh->scale(10., Geometry::TransformType::ApplyToData);
// Extract the surface mesh
auto volTetMesh = std::dynamic_pointer_cast<TetrahedralMesh>(tetMesh);
if (!volTetMesh)
{
LOG(WARNING) << "Dynamic pointer cast from PointSet to TetrahedralMesh failed!";
return 1;
}
auto surfMesh = std::make_shared<SurfaceMesh>();
volTetMesh->extractSurfaceMesh(surfMesh);
// Construct one to one nodal map based on the above meshes
auto oneToOneNodalMap = std::make_shared<OneToOneMap>();
oneToOneNodalMap->setMaster(tetMesh);
oneToOneNodalMap->setSlave(surfMesh);
oneToOneNodalMap->compute();
// Configure the dynamic model
auto dynaModel = std::make_shared<FEMDeformableBodyModel>();
dynaModel->configure(iMSTK_DATA_ROOT "/oneTet/oneTet.config");
dynaModel->setModelGeometry(volTetMesh);
// Create and add Backward Euler time integrator
auto timeIntegrator = std::make_shared<BackwardEuler>(0.01);
dynaModel->setTimeIntegrator(timeIntegrator);
// Configure Scene Object
auto physicsObj = std::make_shared<DeformableObject>("deformableObj");
physicsObj->setVisualGeometry(surfMesh);
physicsObj->setCollidingGeometry(volTetMesh);
physicsObj->setPhysicsGeometry(volTetMesh);
physicsObj->setPhysicsToVisualMap(oneToOneNodalMap);
physicsObj->setDynamicalModel(dynaModel);
//physicsObj->initialize();
scene->addSceneObject(physicsObj);
//----------------------------------------------------------
// Create a nonlinear system and its solver
//----------------------------------------------------------
auto nlSystem = std::make_shared<NonLinearSystem>(dynaModel->getFunction(), dynaModel->getFunctionGradient());
std::vector<LinearProjectionConstraint> linProj;
linProj.push_back(LinearProjectionConstraint(0, true));
linProj.push_back(LinearProjectionConstraint(2, true));
nlSystem->setUnknownVector(dynaModel->getUnknownVec());
nlSystem->setUpdateFunction(dynaModel->getUpdateFunction());
nlSystem->setUpdatePreviousStatesFunction(dynaModel->getUpdatePrevStateFunction());
std::vector<LinearProjectionConstraint> dynLinProj;
// create a non-linear solver and add to the scene
auto nlSolver = std::make_shared<NewtonSolver>();
auto cgLinSolver = std::make_shared<ConjugateGradient>();// create a linear solver to be used in the NL solver
cgLinSolver->setLinearProjectors(&linProj);
cgLinSolver->setDynamicLinearProjectors(&dynLinProj);
nlSolver->setLinearSolver(cgLinSolver);
nlSolver->setSystem(nlSystem);
scene->addNonlinearSolver(nlSolver);
//----------------------------------------------------------
// Create object controller
//----------------------------------------------------------
// Device clients
auto client = std::make_shared<HDAPIDeviceClient>(phantomOmni1Name);
// Device Server
auto server = std::make_shared<HDAPIDeviceServer>();
server->addDeviceClient(client);
sdk->addModule(server);
// Sphere0
auto sphereForPickObj = apiutils::createCollidingAnalyticalSceneObject(
Geometry::Type::Sphere, scene, "Sphere0", 0.5, Vec3d(0., 0., 0.));
auto pickTrackingCtrl = std::make_shared<DeviceTracker>(client);
//pickTrackingCtrl->setTranslationOffset(Vec3d(0., 0., 24.));
auto pickController = std::make_shared<SceneObjectController>(sphereForPickObj, pickTrackingCtrl);
scene->addObjectController(pickController);
CollisionData coldata;
auto sphereGeo = std::dynamic_pointer_cast<Sphere>(sphereForPickObj->getCollidingGeometry());
// Create collision detection for picking
auto pickingCD = std::make_shared<PointSetToSpherePickingCD>(volTetMesh, sphereGeo, coldata);
pickingCD->setDeviceTrackerAndButton(pickTrackingCtrl, 0);
// Create contact handling for picking
auto pickingCH = std::make_shared<PickingCH>(CollisionHandling::Side::A, coldata, physicsObj);
pickingCH->setDynamicLinearProjectors(&dynLinProj);
// Create collision pair
scene->getCollisionGraph()->addInteractionPair(physicsObj, sphereForPickObj, pickingCD, pickingCH, nullptr);
// Set Camera configuration
auto cam = scene->getCamera();
auto camPosition = Vec3d(0, 40, 80);
cam->setPosition(camPosition);
cam->setFocalPoint(Vec3d(0, 0, 0));
// Run
sdk->setActiveScene(scene);
sdk->startSimulation(SimulationStatus::PAUSED);
return 0;
#endif
}
......@@ -24,7 +24,7 @@
using namespace imstk;
///
/// \brief This example show how to write plotting code for matlab and python
/// \brief This example shows how to write plotting code for matlab and python
///
int main()
{
......@@ -36,12 +36,15 @@ int main()
b.resize(100);