Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Ogre 1.12 #1526

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
bedffa7
[CORE] Added a macro that indicates the OGRE version
Dec 4, 2024
3afccd1
[CORE] Removed a deprecated warning in vpAROgre
Dec 4, 2024
7853efd
[FIX] Fix "no matching function for call to showConfigDialog" when us…
Dec 4, 2024
1715f01
[FIX] Fixed "error: 'Ogre::WindowEventUtilities' has not been declare…
Dec 4, 2024
36fe776
[FIX] Fixed "mBackground->setMaterial(BackgroundMaterial);" related e…
Dec 4, 2024
5537544
[FIX] Fixed "cannot convert 'Ogre::Matrix4' to 'const Ogre::Affine3&'"
Dec 4, 2024
8bb0792
[FIX] Fixed visp-images dataset detection
Dec 5, 2024
6c7cc06
[FIX] Fixed deprecated warnings due to the setting of the lights in A…
Dec 10, 2024
9d18137
[FIX] Fixed resource loading and setMaterial issue
Dec 10, 2024
8472d16
[FIX] Fix deprecated warning due to createSceneManager
Dec 10, 2024
0ea8a35
[FIX] Fixed deprecated warning due to getSceneManagerIterator
Dec 10, 2024
31a128b
[WIP] Working on the CMake file for Ogre
Dec 10, 2024
f6b69c2
[CORE] Fixed deprecated warnings due to light->setPosition in tutorials
Dec 11, 2024
2f49d90
[CORE] Add Ogre dir log during CMake configuration if USE_OGRE
Dec 11, 2024
e675804
[FIX] Initialize the VISP_HAVE_OGRE_RESOURCES_PATH to empty string be…
Dec 11, 2024
852dd7a
[KO] Pbs : of include in 1.12.10, of linkage in 1.9.0
Dec 12, 2024
c5dbc8a
[FIX] Fixed warnings when loading the resources using Ogre 1.12.10
Dec 16, 2024
492c99f
[FIX] Fixed segfault that occured in tuto-ibvs-ogre-tracking
Dec 16, 2024
343aea9
[FIX] FIx include + linkage problems for ogre 1.12+
Dec 16, 2024
963737e
[FIX] Fixed CMake errors related to v1.9
Dec 17, 2024
2706336
[FIX] Fixed release of the shared ptr for ogre v1.9
Dec 17, 2024
6e01309
[WIP] Working on a fix for Ogre v1.10 and v1.11
Dec 17, 2024
abb8395
[FIX] Fixed compilation error for ogre 1.10
Dec 19, 2024
52745ec
[FIX] Avoid creating Ogre targets if they already exist
Dec 19, 2024
bf95f77
[CLEAN] Solved a warning when using ogre 1.9.1 from apt
Dec 19, 2024
213589e
[CORE] Added CMakes lines that might be useful for compiled versions …
Dec 19, 2024
1fdc37b
[CLEAN] Removed commented CMake lines
Dec 19, 2024
4f3e592
[CORE] Made vpAROgre compatible with Ogre 13.1.0
Dec 19, 2024
d1a0749
Cleanup Ogre location feedback in ViSP-third-party.txt
fspindle Jan 6, 2025
a4aef0b
Merge branch 'master' into ogre-wip
Jan 6, 2025
b353855
[FIX] Fix tutorial-ibvs-ogre-tracking when using Ogre 14.0
Jan 6, 2025
5b8c7d7
[CORE] Replaced hard-coded scene manager name by a 'computed' one
Jan 7, 2025
b34b113
[CORE] Added AROgreBasic to the unit tests list
Jan 7, 2025
84a6550
[TEST] Test AROgreBasic only if dataset is available
Jan 7, 2025
8a89f86
[FIX] Fix multiple insertion of same resource and segfault when destr…
Jan 7, 2025
24b352e
Merge branch 'ogre-1_12' of github.com:rolalaro/visp into ogre-1_12
Jan 7, 2025
be230d3
[TEST] Added github action to test ogre
Jan 7, 2025
6330e1d
[TEST] Renamed ogre github action
Jan 7, 2025
6349a39
[TEST] Installing ogre dependencies in the github action
Jan 7, 2025
988d23d
[TEST] Fix Ogre CI : Ogre cannot be run without a valid X11 context
Jan 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 117 additions & 0 deletions .github/workflows/ubuntu-ogre-apt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Ubuntu-ogre-apt

# https://www.jeffgeerling.com/blog/2020/running-github-actions-workflow-on-schedule-and-other-events
on:
pull_request:
types: [opened, reopened, synchronize]
schedule:
- cron: '0 2 * * SUN'

# https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre#comment133398800_72408109
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true

jobs:
build-ubuntu-ogre-apt:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-latest]
compiler: [ {CC: /usr/bin/gcc-9, CXX: /usr/bin/g++-9}, {CC: /usr/bin/gcc-10, CXX: /usr/bin/g++-10}, {CC: /usr/bin/clang, CXX: /usr/bin/clang++} ]
standard: [ 11, 17 ]
ogre: [ogre-1.9, ogre-1.12]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Print system information
run: lscpu

- name: Print OS information
run: lsb_release -a

- name: Print compiler information
run: dpkg --list | grep compiler

- name: Install ViSP dependencies
run: sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev nlohmann-json3-dev

- name: Install dependencies for Ogre 1.9
if: matrix.ogre == 'ogre-1.9'
run: sudo apt-get update && sudo apt-get install -y libgles2-mesa-dev libvulkan-dev glslang-dev libxrandr-dev libxaw7-dev libx11-dev libzzip-dev libsdl2-dev libogre-1.9-dev

- name: Install dependencies for Ogre 1.12
if: matrix.ogre == 'ogre-1.12'
run: sudo apt-get update && sudo apt-get install -y libgles2-mesa-dev libvulkan-dev glslang-dev libxrandr-dev libxaw7-dev libx11-dev libzzip-dev libsdl2-dev libogre-1.12-dev

- name: Clone visp-images
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
# https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/
run: |
git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images
echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV
echo ${VISP_INPUT_IMAGE_PATH}

- name: Clone visp_sample
run: |
git clone --depth 1 https://github.com/lagadic/visp_sample ${HOME}/visp_sample

- name: Configure CMake
run: |
mkdir build
cd build
CC=${{ matrix.compiler.CC }}
CXX=${{ matrix.compiler.CXX }}
CXX_STANDARD=${{ matrix.standard }}
echo "CC: $CC"
echo "CXX: $CXX"
echo "Standard: $CXX_STANDARD"
cmake .. -DCMAKE_C_COMPILER="${CC}" -DCMAKE_CXX_COMPILER="${CXX}" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/usr/local -DCMAKE_VERBOSE_MAKEFILE=ON -DUSE_CXX_STANDARD=$CXX_STANDARD
cat ViSP-third-party.txt

- name: Compile
working-directory: build
run: |
make -j$(nproc) install

- name: Run unit tests
working-directory: build
run: ctest -j$(nproc) --output-on-failure

- name: ViSP as 3rdparty with cmake
run: |
cd ${HOME}/visp_sample
mkdir visp_sample-build
cd visp_sample-build
CC=${{ matrix.compiler.CC }}
CXX=${{ matrix.compiler.CXX }}
cmake .. -DCMAKE_C_COMPILER="${CC}" -DCMAKE_CXX_COMPILER="${CXX}" -DVISP_DIR=/tmp/usr/local/lib/cmake/visp -DCMAKE_VERBOSE_MAKEFILE=ON
make -j$(nproc)

- name: ViSP as 3rdparty with visp.pc and pkg-config
run: |
cd ${HOME}/visp_sample
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/tmp/usr/local/lib/pkgconfig
CC=${{ matrix.compiler.CC }}
CXX=${{ matrix.compiler.CXX }}
pkg-config --cflags visp
pkg-config --libs visp
make CXX=${{ matrix.compiler.CXX }} -j$(nproc) -f Makefile.visp.pc
make CXX=${{ matrix.compiler.CXX }} -j$(nproc) -f Makefile.visp.pc clean

- name: ViSP as 3rdparty with visp-config
run: |
cd ${HOME}/visp_sample
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/tmp/usr/local/lib/pkgconfig
export VISP_INSTALL_PREFIX=/tmp/usr/local
CC=${{ matrix.compiler.CC }}
CXX=${{ matrix.compiler.CXX }}
$VISP_INSTALL_PREFIX/bin/visp-config --cflags
$VISP_INSTALL_PREFIX/bin/visp-config --libs
make CXX=${{ matrix.compiler.CXX }} -j$(nproc) -f Makefile.visp-config
make CXX=${{ matrix.compiler.CXX }} -j$(nproc) -f Makefile.visp-config clean
17 changes: 17 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ set(VISP_SOVERSION "${VISP_VERSION_MAJOR}.${VISP_VERSION_MINOR}")
# Package revision number
set(VISP_REVISION "1")

# Try to locate visp-images and, if it exists, its version
vp_find_dataset(VISP_DATASET_FOUND VISP_DATASET_LOCATION
VISP_DATASET_VERSION
VISP_DATASET_VERSION_MAJOR
VISP_DATASET_VERSION_MINOR
VISP_DATASET_VERSION_PATCH)

#-----------------------------------------------------------------------------
# TO BE CHECKED BEFORE NEXT RELEASE
#
Expand Down Expand Up @@ -984,6 +991,7 @@ include(cmake/VISPExtraTargets.cmake)
include(cmake/OgreTools.cmake)
if(USE_OGRE)
vp_set_ogre_media()
set(VISP_HAVE_OGRE_VERSION "(${OGRE_VERSION_MAJOR}<<16 | ${OGRE_VERSION_MINOR}<<8 | ${OGRE_VERSION_PATCH})") # for vpConfig.h
endif()

#----------------------------------------------------------------------
Expand Down Expand Up @@ -1904,6 +1912,15 @@ endif()
if(USE_YARP)
status(" Yarp dir:" "${YARP_DIR}")
endif()
if(USE_OGRE)
if(NOT ${OGRE_DIR} STREQUAL "")
status(" Ogre dir:" "${OGRE_DIR}")
else()
status(" Ogre inc dir:" "${OGRE_INCLUDE_DIR}")
status(" Ogre Main lib:" "${OGRE_LIBRARY_REL}")
status(" Ogre plugin dir:" "${OGRE_PLUGIN_DIR_REL}")
endif()
endif()

# ========================== auxiliary ==========================
status("")
Expand Down
151 changes: 72 additions & 79 deletions cmake/OgreTools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ function(vp_set_ogre_media)
/usr/share/OGRE-1.8.0/media
/usr/share/OGRE-1.8.1/media
/usr/share/OGRE-1.9.0/media
/usr/share/OGRE/Media
)
endif()

Expand Down Expand Up @@ -274,105 +275,97 @@ function(vp_set_ogre_media)
# Here we copy all the minimal media files
# - media/materials/...
# - media/models/...
if(OGRE_MEDIA_NOT_AVAILABLE)
file(COPY modules/ar/data/ogre-simulator/media DESTINATION ${VISP_BINARY_DIR}/data/ogre-simulator)
endif()
file(COPY modules/ar/data/ogre-simulator/media DESTINATION ${VISP_BINARY_DIR}/data/ogre-simulator)

# Initialize the variable
set(VISP_HAVE_OGRE_RESOURCES_PATH "" CACHE INTERNAL "Ogre resources location")
if(ogre_resources_cfg_exists)
set(VISP_HAVE_OGRE_RESOURCES_PATH "${ogre_resources_cfg_exists}" CACHE INTERNAL "Ogre resources location")
else()
# Here we create a resources.cfg if it was not found
set(VISP_HAVE_OGRE_RESOURCES_PATH "${ogre_resources_cfg_exists};" CACHE INTERNAL "Ogre resources location")
endif()
# Here we create a resources.cfg if it was not found

# we create a resources.cfg file for vpAROgre.cpp
# case 1: normal case
# If OGRE_MEDIA_DIR is not found, we set it to VISP_HAVE_OGRE_RESOURCES_PATH in order to use
# the minimal requested media to run the examples
#--------------
set(OGRE_DATA_ROOT_DIR "${VISP_BINARY_DIR}/data/ogre-simulator")
set(VISP_HAVE_OGRE_RESOURCES_PATH "${VISP_HAVE_OGRE_RESOURCES_PATH}${OGRE_DATA_ROOT_DIR}" CACHE INTERNAL "Ogre resources location")

set(OGRE_VISP_MEDIA_DIR "${VISP_BINARY_DIR}/data/ogre-simulator/media")

# Here we add all the subdirs in @OGRE_VISP_MEDIA_DIR@/* as resource location.
vp_get_relative_subdirs(media_subdirs ${OGRE_VISP_MEDIA_DIR})
set(OGRE_RESOURCES_FileSystem "FileSystem=${OGRE_VISP_MEDIA_DIR}\n")
foreach(m ${media_subdirs})
set(OGRE_RESOURCES_FileSystem "${OGRE_RESOURCES_FileSystem}FileSystem=${OGRE_VISP_MEDIA_DIR}/${m}\n")
endforeach()

# we create a resources.cfg file for vpAROgre.cpp
# case 1: normal case
# If OGRE_MEDIA_DIR is not found, we set it to VISP_HAVE_OGRE_RESOURCES_PATH in order to use
# the minimal requested media to run the examples
#--------------
set(VISP_HAVE_OGRE_RESOURCES_PATH "${VISP_BINARY_DIR}/data/ogre-simulator" CACHE INTERNAL "Ogre resources location")
configure_file(
${VISP_SOURCE_DIR}/cmake/templates/resources.cfg.in
${OGRE_DATA_ROOT_DIR}/resources.cfg
IMMEDIATE @ONLY
)

if(OGRE_MEDIA_NOT_AVAILABLE)
set(OGRE_MEDIA_DIR ${VISP_HAVE_OGRE_RESOURCES_PATH}/media)
endif()
# case 2: install or packaging case
# If OGRE_MEDIA_DIR is not found, we set it to VISP_INSTALL_DIR_OGRE_RESOURCES in order to use
# the minimal requested media to run the examples
#--------------
set(VISP_INSTALL_DIR_OGRE_RESOURCES "${CMAKE_INSTALL_PREFIX}/${VISP_INSTALL_DATAROOTDIR}/data/ogre-simulator")

# Here we add all the subdirs in @OGRE_MEDIA_DIR@/* as resource location.
vp_get_relative_subdirs(media_subdirs ${OGRE_MEDIA_DIR})
set(OGRE_RESOURCES_FileSystem "FileSystem=${OGRE_MEDIA_DIR}\n")
foreach(m ${media_subdirs})
set(OGRE_RESOURCES_FileSystem "${OGRE_RESOURCES_FileSystem}FileSystem=${OGRE_MEDIA_DIR}/${m}\n")
endforeach()
# make the var global
set(VISP_INSTALL_DIR_OGRE_RESOURCES ${VISP_INSTALL_DIR_OGRE_RESOURCES} CACHE INTERNAL "Ogre media install dir")

set(OGRE_VISP_INSTALL_MEDIA_DIR ${VISP_INSTALL_DIR_OGRE_RESOURCES}/media)

# Here we add all the subdirs in @OGRE_VISP_INSTALL_MEDIA_DIR@/* as resource location.
set(OGRE_RESOURCES_FileSystem "FileSystem=${OGRE_VISP_INSTALL_MEDIA_DIR}\n")
foreach(m ${media_subdirs})
set(OGRE_RESOURCES_FileSystem "${OGRE_RESOURCES_FileSystem}FileSystem=${OGRE_VISP_INSTALL_MEDIA_DIR}/${m}\n")
endforeach()

# install rule for resources.cfg and Ogre media if they are not available:
if(UNIX)
configure_file(
${VISP_SOURCE_DIR}/cmake/templates/resources.cfg.in
${VISP_HAVE_OGRE_RESOURCES_PATH}/resources.cfg
${VISP_BINARY_DIR}/unix-install/resources.cfg
IMMEDIATE @ONLY
)

# case 2: install or packaging case
# If OGRE_MEDIA_DIR is not found, we set it to VISP_INSTALL_DIR_OGRE_RESOURCES in order to use
# the minimal requested media to run the examples
#--------------
set(VISP_INSTALL_DIR_OGRE_RESOURCES "${CMAKE_INSTALL_PREFIX}/${VISP_INSTALL_DATAROOTDIR}/data/ogre-simulator")

# make the var global
set(VISP_INSTALL_DIR_OGRE_RESOURCES ${VISP_INSTALL_DIR_OGRE_RESOURCES} CACHE INTERNAL "Ogre media install dir")

if(OGRE_MEDIA_NOT_AVAILABLE)
set(OGRE_MEDIA_DIR ${VISP_INSTALL_DIR_OGRE_RESOURCES}/media)
endif()

# Here we add all the subdirs in @OGRE_MEDIA_DIR@/* as resource location.
set(OGRE_RESOURCES_FileSystem "FileSystem=${OGRE_MEDIA_DIR}\n")
foreach(m ${media_subdirs})
set(OGRE_RESOURCES_FileSystem "${OGRE_RESOURCES_FileSystem}FileSystem=${OGRE_MEDIA_DIR}/${m}\n")
endforeach()

# install rule for resources.cfg and Ogre media if they are not available:
if(UNIX)
configure_file(
${VISP_SOURCE_DIR}/cmake/templates/resources.cfg.in
${VISP_BINARY_DIR}/unix-install/resources.cfg
IMMEDIATE @ONLY
)
install(FILES
${VISP_BINARY_DIR}/unix-install/resources.cfg
install(FILES
${VISP_BINARY_DIR}/unix-install/resources.cfg
DESTINATION ${VISP_INSTALL_DATAROOTDIR}/data/ogre-simulator
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE
COMPONENT dev
)
install(DIRECTORY
${VISP_BINARY_DIR}/data/ogre-simulator/media
DESTINATION ${VISP_INSTALL_DATAROOTDIR}/data/ogre-simulator
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE
FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE
COMPONENT dev
)
if(OGRE_MEDIA_NOT_AVAILABLE)
install(DIRECTORY
${VISP_BINARY_DIR}/data/ogre-simulator/media
DESTINATION ${VISP_INSTALL_DATAROOTDIR}/data/ogre-simulator
FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE
COMPONENT dev
)
endif()
else()
configure_file(
${VISP_SOURCE_DIR}/cmake/templates/resources.cfg.in
${VISP_BINARY_DIR}/win-install/resources.cfg
IMMEDIATE @ONLY
)
install(FILES
${VISP_BINARY_DIR}/win-install/resources.cfg
else()
configure_file(
${VISP_SOURCE_DIR}/cmake/templates/resources.cfg.in
${VISP_BINARY_DIR}/win-install/resources.cfg
IMMEDIATE @ONLY
)
install(FILES
${VISP_BINARY_DIR}/win-install/resources.cfg
DESTINATION ${VISP_INSTALL_DATAROOTDIR}/data/ogre-simulator
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE
COMPONENT dev
)
install(DIRECTORY
${VISP_BINARY_DIR}/data/ogre-simulator/media
DESTINATION ${VISP_INSTALL_DATAROOTDIR}/data/ogre-simulator
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE
FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE
COMPONENT dev
)
if(OGRE_MEDIA_NOT_AVAILABLE)
install(DIRECTORY
${VISP_BINARY_DIR}/data/ogre-simulator/media
DESTINATION ${VISP_INSTALL_DATAROOTDIR}/data/ogre-simulator
FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE
COMPONENT dev
)
endif()
endif()
endif()
endfunction()

macro(vp_set_ogre_advanced_var)
set(ogre_components_ Paging Terrain Plugin_BSPSceneManager Plugin_CgProgramManager Plugin_OctreeSceneManager Plugin_OctreeZone Plugin_PCZSceneManager Plugin_ParticleFX RenderSystem_Direct3D11 RenderSystem_Direct3D9 RenderSystem_GLES2 RenderSystem_GLES RenderSystem_GL)
set(ogre_components_ Paging Terrain Plugin_BSPSceneManager Plugin_CgProgramManager Plugin_OctreeSceneManager Plugin_OctreeZone Plugin_PCZSceneManager Plugin_ParticleFX RenderSystem_Direct3D11 RenderSystem_Direct3D9 RenderSystem_GLES2 RenderSystem_GLES RenderSystem_GL RTShaderSystem)
foreach(component_ ${ogre_components_})
mark_as_advanced(OGRE_${component_}_INCLUDE_DIR)
mark_as_advanced(OGRE_${component_}_LIBRARY_DBG)
Expand Down
6 changes: 0 additions & 6 deletions cmake/VISPModule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -990,12 +990,6 @@ macro(vp_add_tests)
if(BUILD_TESTS AND EXISTS "${test_path}")
__vp_parse_test_sources(TEST ${ARGN})

vp_find_dataset(VISP_DATASET_FOUND VISP_DATASET_LOCATION
VISP_DATASET_VERSION
VISP_DATASET_VERSION_MAJOR
VISP_DATASET_VERSION_MINOR
VISP_DATASET_VERSION_PATCH)

set(__exclude_ctest "")
foreach(__folder ${VISP_TEST_${the_module}_CTEST_EXCLUDE_FOLDER} )
file(GLOB_RECURSE __files "${CMAKE_CURRENT_LIST_DIR}/test/${__folder}/*.cpp")
Expand Down
3 changes: 3 additions & 0 deletions cmake/templates/vpConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ namespace vp = VISP_NAMESPACE_NAME;

// Defined if Ogre3d is available.
#cmakedefine VISP_HAVE_OGRE
#ifdef VISP_HAVE_OGRE
# define VISP_HAVE_OGRE_VERSION ${VISP_HAVE_OGRE_VERSION}
#endif

// Defined if Ogre3d plugins.cfg is available.
#cmakedefine VISP_HAVE_OGRE_PLUGINS_PATH "${VISP_HAVE_OGRE_PLUGINS_PATH}"
Expand Down
9 changes: 7 additions & 2 deletions example/ogre-simulator/AROgre.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,13 @@ class vpAROgreExample : public vpAROgre
light->setDiffuseColour(1.0, 1.0, 1.0); // scaled RGB values
light->setSpecularColour(1.0, 1.0, 1.0); // scaled RGB values
// Lumiere ponctuelle
#if (VISP_HAVE_OGRE_VERSION < (1 << 16 | 10 << 8 | 0))
light->setPosition(-5, -5, 10);
#else
Ogre::SceneNode *spotLightNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
spotLightNode->attachObject(light);
spotLightNode->setPosition(Ogre::Vector3(-5, -5, 10));
#endif
light->setType(Ogre::Light::LT_POINT);
light->setAttenuation((Ogre::Real)100, (Ogre::Real)1.0, (Ogre::Real)0.045, (Ogre::Real)0.0075);
// Ombres
Expand Down Expand Up @@ -655,7 +661,6 @@ int main(int argc, const char **argv)
vpAROgreExample ogre(mcam, (unsigned int)grabber.getWidth(), (unsigned int)grabber.getHeight());
// Initialize it
ogre.init(IC);

double t0 = vpTime::measureTimeMs();

// Rendering loop
Expand Down Expand Up @@ -734,5 +739,5 @@ int main()
std::cout << "- Install Ogre3D, configure again ViSP using cmake and build again this example" << std::endl;
#endif
return EXIT_SUCCESS;
}
}
#endif
Loading
Loading