Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8351


Ignore:
Timestamp:
Apr 28, 2011, 7:15:14 AM (8 years ago)
Author:
rgrieder
Message:

Merged kicklib2 branch back to trunk (includes former branches ois_update, mac_osx and kicklib).

Notes for updating

Linux:
You don't need an extra package for CEGUILua and Tolua, it's already shipped with CEGUI.
However you do need to make sure that the OgreRenderer is installed too with CEGUI 0.7 (may be a separate package).
Also, Orxonox now recognises if you install the CgProgramManager (a separate package available on newer Ubuntu on Debian systems).

Windows:
Download the new dependency packages versioned 6.0 and use these. If you have problems with that or if you don't like the in game console problem mentioned below, you can download the new 4.3 version of the packages (only available for Visual Studio 2005/2008).

Key new features:

  • *Support for Mac OS X*
  • Visual Studio 2010 support
  • Bullet library update to 2.77
  • OIS library update to 1.3
  • Support for CEGUI 0.7 —> Support for Arch Linux and even SuSE
  • Improved install target
  • Compiles now with GCC 4.6
  • Ogre Cg Shader plugin activated for Linux if available
  • And of course lots of bug fixes

There are also some regressions:

  • No support for CEGUI 0.5, Ogre 1.4 and boost 1.35 - 1.39 any more
  • In game console is not working in main menu for CEGUI 0.7
  • Tolua (just the C lib, not the application) and CEGUILua libraries are no longer in our repository. —> You will need to get these as well when compiling Orxonox
  • And of course lots of new bugs we don't yet know about
Location:
code/trunk
Files:
15 deleted
401 edited
45 copied

Legend:

Unmodified
Added
Removed
  • code/trunk/CMakeLists.txt

    r7383 r8351  
    2424 #
    2525
     26# Defined LINUX
     27IF(UNIX AND NOT APPLE)
     28  SET(LINUX TRUE)
     29ENDIF()
     30
    2631IF(WIN32)
    27   CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR)
     32  IF(MSVC10)
     33    CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3 FATAL_ERROR)
     34  ELSE()
     35    CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR)
     36  ENDIF()
    2837ELSE()
    29   CMAKE_MINIMUM_REQUIRED(VERSION 2.6   FATAL_ERROR)
     38  CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
    3039ENDIF()
    3140
     
    5766SET(DEFAULT_CONFIG_PATH  config)
    5867SET(DEFAULT_LOG_PATH     log)
     68SET(DEFAULT_BUNDLE_PATH  bundle)
    5969
    6070# Set output directories
     
    98108ENDIF()
    99109
     110# Debug builds can not be installed
     111INSTALL(SCRIPT cmake/InstallCheck.cmake)
     112
    100113# Enable expensive optimisations: use this for a binary release build
    101114OPTION(ORXONOX_RELEASE "Enable when building restributable releases" FALSE)
    102115
     116IF(APPLE)
     117  # Set 10.5 as the base SDK by default
     118  SET(XCODE_ATTRIBUTE_SDKROOT macosx10.5)
     119
     120  # 10.6 sets x86_64 as the default architecture.
     121  # Because Carbon isn't supported on 64-bit and we still need it, force the architectures to ppc and i386
     122  IF(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
     123    SET(CMAKE_OSX_ARCHITECTURES "i386")
     124  ENDIF()
     125  IF(CMAKE_OSX_ARCHITECTURES MATCHES "ppc64")
     126    SET(CMAKE_OSX_ARCHITECTURES "ppc")
     127  ENDIF()
     128  IF(NOT CMAKE_OSX_ARCHITECTURES)
     129    SET(CMAKE_OSX_ARCHITECTURES "i386")
     130  ENDIF()
     131ENDIF()
     132
    103133########### Subfolders and Subscripts ###########
     134
     135# General build and compiler options and configurations
     136INCLUDE(CompilerConfig)
    104137
    105138# Library finding
    106139INCLUDE(LibraryConfig)
    107 
    108 # General build and compiler options and configurations
    109 INCLUDE(CompilerConfig)
    110140
    111141# Configure installation paths and options
     
    121151ADD_SUBDIRECTORY(bin)
    122152
     153# System specific files (mostly for installation)
     154ADD_SUBDIRECTORY(contrib)
     155
    123156# Last but not least: Try to make a doc target with Doxygen
    124157ADD_SUBDIRECTORY(doc)
     158
     159########### CPack Packaging ###########
     160
     161# Currently only testing on Apple
     162#IF(APPLE)
     163#  INCLUDE(BundleConfig)
     164#ENDIF(APPLE)
  • code/trunk/INSTALL

    r7248 r8351  
    99(for windows there are already precompiled packages on the website)
    1010
    11 OGRE 3D Graphics Engine          1.4 - 1.7
    12 CEGUI (Crazy Eddie's GUI System) 0.5 - 0.6
     11OGRE 3D Graphics Engine          1.6 - 1.7
     12CEGUI (Crazy Eddie's GUI System) 0.6
    1313Boost libraries                  1.35 -
    14 ENet (Network library)           1.1 - 1.2
    1514Lua (scripting language)         5.0 - 5.1
    1615Tcl (shell script language)      8.4 - 8.5
  • code/trunk/bin/CMakeLists.txt

    r7801 r8351  
    6969# Make a symlink to be able to run from the root directory when installing copyable on Unix
    7070IF(UNIX AND INSTALL_COPYABLE)
    71   INSTAll(CODE "EXECUTE_PROCESS(COMMAND ln -sf ${RUNTIME_INSTALL_DIRECTORY}/${ORXONOX_EXECUTABLE_NAME} ${CMAKE_INSTALL_PREFIX}/orxonox)")
     71  INSTAll(CODE "EXECUTE_PROCESS(COMMAND cmake -E create_symlink \"${CMAKE_INSTALL_PREFIX}/${RUNTIME_INSTALL_DIRECTORY}/${ORXONOX_EXECUTABLE_NAME}\" \"${CMAKE_INSTALL_PREFIX}/${ORXONOX_EXECUTABLE_NAME}\")")
    7272ENDIF()
  • code/trunk/bin/client1.bat.in

    r5781 r8351  
    11title @PROJECT_NAME@
    22path @RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
    3 @CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --client --writingPathSuffix client1
     3"@CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@" --client --writingPathSuffix client1
    44pause
  • code/trunk/bin/client2.bat.in

    r5781 r8351  
    11title @PROJECT_NAME@
    22path @RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
    3 @CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --client --writingPathSuffix client2
     3"@CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@" --client --writingPathSuffix client2
    44pause
  • code/trunk/bin/dedicated.bat.in

    r5781 r8351  
    11title @PROJECT_NAME@
    22path @RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
    3 @CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --dedicated --writingPathSuffix dedicated
     3"@CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@" --dedicated --writingPathSuffix dedicated
    44pause
  • code/trunk/bin/dedicatedClient.bat.in

    r6417 r8351  
    11title @PROJECT_NAME@
    22path @RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
    3 @CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --dedicatedClient --writingPathSuffix dedicatedClient
     3"@CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@" --dedicatedClient --writingPathSuffix dedicatedClient
    44pause
  • code/trunk/bin/masterserver.bat.in

    • Property svn:eol-style set to native
    r7801 r8351  
    11title @PROJECT_NAME@
    22path @RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
    3 @CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --masterserver --writingPathSuffix masterserver
     3"@CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@" --masterserver --writingPathSuffix masterserver
    44pause
  • code/trunk/bin/masterserver.in

    • Property svn:eol-style set to native
  • code/trunk/bin/run.bat.in

    r5695 r8351  
    11title @PROJECT_NAME@
    22path @RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
    3 @CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@
     3"@CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@"
    44pause
  • code/trunk/bin/server.bat.in

    r5781 r8351  
    11title @PROJECT_NAME@
    22path @RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
    3 @CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --server --writingPathSuffix server
     3"@CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@" --server --writingPathSuffix server
    44pause
  • code/trunk/bin/standalone.bat.in

    r5781 r8351  
    11title @PROJECT_NAME@
    22path @RUNTIME_LIBRARY_DIRECTORY_WINDOWS@;%path%
    3 @CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@ --standalone --writingPathSuffix standalone
     3"@CURRENT_RUNTIME_DIR_WINDOWS@\@ORXONOX_EXECUTABLE_NAME@" --standalone --writingPathSuffix standalone
    44pause
  • code/trunk/bin/vld.ini.in

    r5929 r8351  
    5656;   Default: None.
    5757;
    58 ForceIncludeModules = boost_date_time-vc80-mt-gd-1_39.dll, boost_filesystem-vc80-mt-gd-1_39.dll, boost_system-vc80-mt-gd-1_39.dll, boost_thread-vc80-mt-gd-1_39.dll, enet_d.dll, lua_d.dll, ogg_d.dll, vorbis_d.dll, vorbifile_d.dll
     58ForceIncludeModules = boost_date_time-vc90-mt-gd-1_44.dll, boost_filesystem-vc90-mt-gd-1_44.dll, boost_system-vc90-mt-gd-1_44.dll, boost_thread-vc90-mt-gd-1_44.dll, lua_d.dll, ogg_d.dll, vorbis_d.dll, vorbifile_d.dll
    5959
    6060; Maximum number of data bytes to display for each leaked block. If zero, then
  • code/trunk/cmake/CompilerConfig.cmake

    r5781 r8351  
    3434  MESSAGE(STATUS "Warning: Your compiler is not officially supported.")
    3535ENDIF()
    36 
    37 SET(COMPILER_CONFIG_USER_SCRIPT "" CACHE FILEPATH
    38     "Specify a CMake script if you wish to write your own compiler config.
    39      See CompilerConfigGCC.cmake or CompilerConfigMSVC.cmake for examples.")
    40 IF(COMPILER_CONFIG_USER_SCRIPT)
    41   IF(EXISTS ${CMAKE_MODULE_PATH}/${COMPILER_CONFIG_USER_SCRIPT})
    42     INCLUDE(${CMAKE_MODULE_PATH}/${COMPILER_CONFIG_USER_SCRIPT})
    43   ENDIF()
    44 ENDIF(COMPILER_CONFIG_USER_SCRIPT)
  • code/trunk/cmake/CompilerConfigGCC.cmake

    r7458 r8351  
    2626INCLUDE(FlagUtilities)
    2727INCLUDE(CompareVersionStrings)
     28INCLUDE(CheckCXXCompilerFlag)
    2829
    2930# Shortcut for CMAKE_COMPILER_IS_GNUCXX and ..._GNUC
     
    3637  OUTPUT_VARIABLE GCC_VERSION
    3738)
    38 
    39 # Complain about incompatibilities
    40 COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.4.0" _compare_result)
    41 IF(NOT _compare_result LESS 0)
    42   IF(${Boost_VERSION} LESS 103700)
    43     MESSAGE(STATUS "Warning: Boost versions earlier than 1.37 may not compile with GCC 4.4 or later!")
    44   ENDIF()
    45 ENDIF()
    46 
    47 # GCC may not support #pragma GCC system_header correctly when using
    48 # templates. According to Bugzilla, it was fixed March 07 but tests
    49 # have confirmed that GCC 4.0.0 does not pose a problem for our cases.
    50 COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.0.0" _compare_result)
    51 IF(_compare_result LESS 0)
    52   SET(GCC_NO_SYSTEM_HEADER_SUPPORT TRUE)
    53 ENDIF()
    5439
    5540# GCC only supports PCH in versions 3.4 and above
     
    7257
    7358# CMake doesn't seem to set the PIC flags right on certain 64 bit systems
    74 IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
     59IF(NOT MINGW AND ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
    7560  ADD_COMPILER_FLAGS("-fPIC" CACHE)
     61ENDIF()
     62
     63# Enable non standard floating point optimisations
     64ADD_COMPILER_FLAGS("-ffast-math" CACHE)
     65
     66# Use SSE if possible
     67# Commented because this might not work for cross compiling
     68#CHECK_CXX_COMPILER_FLAG(-msse _gcc_have_sse)
     69#IF(_gcc_have_sse)
     70#  ADD_COMPILER_FLAGS("-msse" CACHE)
     71#ENDIF()
     72
     73IF(NOT MINGW)
     74  # Have GCC visibility?
     75  CHECK_CXX_COMPILER_FLAG("-fvisibility=hidden" _gcc_have_visibility)
     76  IF(_gcc_have_visibility)
     77    # Note: There is a possible bug with the flag in gcc < 4.2 and Debug versions
     78    COMPARE_VERSION_STRINGS("${GCC_VERSION}" "4.2.0" _compare_result)
     79    IF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug" OR _compare_result GREATER -1)
     80      ADD_COMPILER_FLAGS("-DORXONOX_GCC_VISIBILITY -fvisibility=default -fvisibility-inlines-hidden" CACHE)
     81    ENDIF()
     82  ENDIF(_gcc_have_visibility)
    7683ENDIF()
    7784
    7885# We have some unconformant code, disable an optimisation feature
    7986ADD_COMPILER_FLAGS("-fno-strict-aliasing" CACHE)
    80 
    81 # For GCC older than version 4, do not display sign compare warnings
    82 # because of boost::filesystem (which creates about a hundred per include)
    83 ADD_COMPILER_FLAGS("-Wno-sign-compare" GCC_NO_SYSTEM_HEADER_SUPPORT CACHE)
    8487
    8588# For newer GCC (4.3 and above), don't display hundreds of annoying deprecated
     
    98101ENDIF()
    99102
    100 # General linker flags
    101 SET_LINKER_FLAGS("--no-undefined" CACHE)
     103# Linker flags
     104IF(LINUX)
     105  # Don't allow undefined symbols in a shared library
     106  SET_LINKER_FLAGS("-Wl,--no-undefined" CACHE)
     107ENDIF()
    102108
    103109# Add compiler and linker flags for MinGW
  • code/trunk/cmake/CompilerConfigMSVC.cmake

    r7818 r8351  
    6060
    6161# Overwrite CMake default flags here for the individual configurations
    62 SET_COMPILER_FLAGS("-MDd -Od -Zi -D_DEBUG -RTC1" Debug          CACHE)
    63 SET_COMPILER_FLAGS("-MD  -O2     -DNDEBUG"       Release        CACHE)
    64 SET_COMPILER_FLAGS("-MD  -O2 -Zi -DNDEBUG"       RelWithDebInfo CACHE)
    65 SET_COMPILER_FLAGS("-MD  -O1     -DNDEBUG"       MinSizeRel     CACHE)
    66 ADD_COMPILER_FLAGS("-D_SECURE_SCL=0"       MSVC9 ReleaseAll     CACHE)
     62SET_COMPILER_FLAGS("-MDd -Od -Oi -Zi -D_DEBUG -RTC1" Debug          CACHE)
     63SET_COMPILER_FLAGS("-MD  -O2         -DNDEBUG"       Release        CACHE)
     64SET_COMPILER_FLAGS("-MD  -O2     -Zi -DNDEBUG"       RelWithDebInfo CACHE)
     65SET_COMPILER_FLAGS("-MD  -O1         -DNDEBUG"       MinSizeRel     CACHE)
     66
     67# Enable non standard floating point optimisations
     68ADD_COMPILER_FLAGS("-fp:fast" CACHE)
    6769
    6870# Use Link time code generation for Release config if ORXONOX_RELEASE is defined
  • code/trunk/cmake/InstallConfig.cmake

    r7163 r8351  
    3939ENDIF()
    4040
    41 # Default installation paths
    42 SET(RUNTIME_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_RUNTIME_PATH})
    43 SET(LIBRARY_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LIBRARY_PATH})
    44 SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_ARCHIVE_PATH})
    45 SET(MODULE_INSTALL_DIRECTORY  ${CMAKE_INSTALL_PREFIX}/${DEFAULT_MODULE_PATH})
    46 SET(DOC_INSTALL_DIRECTORY     ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DOC_PATH})
    47 SET(DATA_INSTALL_DIRECTORY    ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DATA_PATH})
    48 SET(CONFIG_INSTALL_DIRECTORY  ${CMAKE_INSTALL_PREFIX}/${DEFAULT_CONFIG_PATH})
    49 SET(LOG_INSTALL_DIRECTORY     ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LOG_PATH})
     41# Default relative installation paths
     42SET(RUNTIME_INSTALL_DIRECTORY ${DEFAULT_RUNTIME_PATH})
     43SET(LIBRARY_INSTALL_DIRECTORY ${DEFAULT_LIBRARY_PATH})
     44SET(ARCHIVE_INSTALL_DIRECTORY ${DEFAULT_ARCHIVE_PATH})
     45SET(MODULE_INSTALL_DIRECTORY  ${DEFAULT_MODULE_PATH})
     46SET(DOC_INSTALL_DIRECTORY     ${DEFAULT_DOC_PATH})
     47SET(DATA_INSTALL_DIRECTORY    ${DEFAULT_DATA_PATH})
     48SET(CONFIG_INSTALL_DIRECTORY  ${DEFAULT_CONFIG_PATH})
     49SET(LOG_INSTALL_DIRECTORY     ${DEFAULT_LOG_PATH})
    5050
    5151IF(NOT INSTALL_COPYABLE)
    52   IF(UNIX) # Apple too?
     52  IF(LINUX)
    5353    # Using absolute paths
    54     SET(RUNTIME_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/games)
    55     SET(LIBRARY_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/games/orxonox)
    56     SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/games/orxonox/static)
    57     SET(MODULE_INSTALL_DIRECTORY  ${CMAKE_INSTALL_PREFIX}/lib/games/orxonox/modules)
    58     SET(DOC_INSTALL_DIRECTORY     ${CMAKE_INSTALL_PREFIX}/share/doc/orxonox)
    59     SET(DATA_INSTALL_DIRECTORY    ${CMAKE_INSTALL_PREFIX}/share/games/orxonox)
     54    SET(RUNTIME_INSTALL_DIRECTORY games)
     55    SET(LIBRARY_INSTALL_DIRECTORY lib/games/orxonox)
     56    SET(ARCHIVE_INSTALL_DIRECTORY lib/games/orxonox/static)
     57    SET(MODULE_INSTALL_DIRECTORY  lib/games/orxonox/modules)
     58    SET(DOC_INSTALL_DIRECTORY     share/doc/orxonox)
     59    SET(DATA_INSTALL_DIRECTORY    share/games/orxonox)
     60  ELSEIF(WIN32)
     61    # Leave on default (installs to only one location anyway)
     62  ELSEIF(APPLE)
     63    # TODO: Figure out what's the best way to install the application
    6064  ENDIF()
    6165
     
    6771################## Unix rpath ###################
    6872
     73# Use, i.e. don't skip the full RPATH for the build tree
     74SET(CMAKE_SKIP_BUILD_RPATH  FALSE)
     75
    6976# When building, don't use the install RPATH already
    7077# (but later on when installing)
     
    7380# The RPATH to be used when installing
    7481IF(INSTALL_COPYABLE)
    75   SET(CMAKE_INSTALL_RPATH ${DEFAULT_LIBRARY_PATH})
     82  # Get relative paths from run to lib and from module to lib directory.
     83  FILE(RELATIVE_PATH _runtime_rpath "/${RUNTIME_INSTALL_DIRECTORY}" "/${LIBRARY_INSTALL_DIRECTORY}")
     84  FILE(RELATIVE_PATH _module_rpath  "/${MODULE_INSTALL_DIRECTORY}" "/${LIBRARY_INSTALL_DIRECTORY}")
     85  # $ORIGIN (with $ escaped) refers to the actual location of the library
     86  # The UNIX loader recognises this special variable
     87  SET(RUNTIME_RPATH "\$ORIGIN/${_runtime_rpath}")
     88  SET(LIBRARY_RPATH "\$ORIGIN")
     89  SET(MODULE_RPATH  "\$ORIGIN:\$ORIGIN/${_module_rpath}")
    7690ELSE()
    77   SET(CMAKE_INSTALL_RPATH ${LIBRARY_INSTALL_DIRECTORY})
     91  SET(RUNTIME_RPATH "${CMAKE_INSTALL_PREFIX}/${LIBRARY_INSTALL_DIRECTORY}")
     92  SET(LIBRARY_RPATH "${CMAKE_INSTALL_PREFIX}/${LIBRARY_INSTALL_DIRECTORY}")
     93  SET(MODULE_RPATH  "${LIBRARY_RPATH}:${CMAKE_INSTALL_PREFIX}/${MODULE_INSTALL_DIRECTORY}")
    7894ENDIF()
    7995
  • code/trunk/cmake/LibraryConfig.cmake

    r8264 r8351  
    4040# On Windows using a package causes way less problems
    4141SET(_option_msg "Set this to true to use precompiled dependecy archives")
    42 IF(WIN32)
     42IF(WIN32 OR APPLE)
    4343  OPTION(DEPENDENCY_PACKAGE_ENABLE "${_option_msg}" ON)
    44 ELSE(WIN32)
     44ELSE()
    4545  OPTION(DEPENDENCY_PACKAGE_ENABLE "${_option_msg}" FALSE)
    46 ENDIF(WIN32)
     46ENDIF()
    4747
    4848# Scripts for specific library and CMake config
    4949INCLUDE(LibraryConfigTardis)
    50 INCLUDE(LibraryConfigApple)
    5150
    5251IF(DEPENDENCY_PACKAGE_ENABLE)
     52  IF(APPLE AND NOT EXISTS ${CMAKE_SOURCE_DIR}/dependencies)
     53    # Let CMake automatically download and extract the dependency package on Mac OS X
     54    # TODO: Handle download errors and always select newest package
     55    SET(_dep_package_current "OrxonoxDeps_110428_2.0_OSX.tar.bz2")
     56    SET(_dep_package_url "http://svn.orxonox.net/ogre/apple/precompiled_dependencies")
     57    MESSAGE(STATUS "Downloading Mac OS X dependency package.")
     58    FILE(DOWNLOAD
     59      ${_dep_package_url}/${_dep_package_current}
     60      ${CMAKE_SOURCE_DIR}/${_dep_package_current}
     61    )
     62    MESSAGE(STATUS "Extracting Mac OS X dependency package.")
     63    EXECUTE_PROCESS(
     64      COMMAND ${CMAKE_COMMAND} -E tar -jxf ${_dep_package_current}
     65      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
     66      OUTPUT_FILE ${CMAKE_BINARY_DIR}/dep_pack_extract_log.keep_me
     67    )
     68    # Delete the dependency archive once we no longer need it
     69    FILE(REMOVE ${CMAKE_SOURCE_DIR}/${_dep_package_current})
     70  ENDIF()
     71
    5372  GET_FILENAME_COMPONENT(_dep_dir_1 ${CMAKE_SOURCE_DIR}/../dependencies ABSOLUTE)
    5473  GET_FILENAME_COMPONENT(_dep_dir_2 ${CMAKE_SOURCE_DIR}/../lib_dist ABSOLUTE)
     
    5978  ELSEIF(MSVC90)
    6079    SET(_compiler_prefix msvc9)
     80  ELSEIF(MSVC10)
     81    SET(_compiler_prefix msvc10)
    6182  ENDIF()
    6283  FIND_PATH(DEPENDENCY_PACKAGE_DIR
     
    7394                   "Disable LIBRARY_USE_PACKAGE if you have none intalled.")
    7495  ELSE()
    75     INCLUDE(PackageConfigMinGW)
    76     INCLUDE(PackageConfigMSVC)
    77     INCLUDE(PackageConfig) # For both msvc and mingw
     96    IF(WIN32)
     97      INCLUDE(PackageConfigMinGW)
     98      INCLUDE(PackageConfigMSVC)
     99      INCLUDE(PackageConfig) # For both msvc and mingw
     100    ELSEIF(APPLE)
     101      INCLUDE(PackageConfigOSX)
     102    ENDIF(WIN32)
    78103  ENDIF()
    79104ENDIF(DEPENDENCY_PACKAGE_ENABLE)
     
    93118# Performs the search and sets the variables    #
    94119
    95 FIND_PACKAGE(OGRE  1.4       REQUIRED)
    96 #FIND_PACKAGE(ENet  1.1       REQUIRED)
     120#FIND_PACKAGE(ENet     1.2    REQUIRED)
     121FIND_PACKAGE(CEGUI    0.6    REQUIRED)
     122FIND_PACKAGE(Lua5.1          REQUIRED)
    97123FIND_PACKAGE(Ogg             REQUIRED)
    98124FIND_PACKAGE(Vorbis          REQUIRED)
    99125FIND_PACKAGE(ALUT            REQUIRED)
    100126FIND_PACKAGE(ZLIB            REQUIRED)
    101 IF(POCO_REQUIRED)
    102   FIND_PACKAGE(POCO          REQUIRED)
    103   # Always link against POCO too because of threading
    104   SET(OGRE_LIBRARY ${OGRE_LIBRARY} ${POCO_LIBRARY})
    105 ENDIF()
     127
    106128IF(WIN32)
    107129  FIND_PACKAGE(DbgHelp)
     
    109131ENDIF()
    110132
    111 ##### CEGUI #####
    112 # We make use of the CEGUI script module called CEGUILua.
    113 # However there is a small issue with that: We use Tolua, a C++ binding
    114 # generator ourselves. And we also have to use our bindings in the same
    115 # lua state is CEGUILua's. Unfortunately this implies that both lua runtime
    116 # version are equal or else you get segmentation faults.
    117 # In order to match the Lua versions we decided to ship CEGUILua in our
    118 # repository, mainly because there is no way to determine which version of
    119 # Lua CEGUILua was linked against (you'd have to specify yourself) and secondly
    120 # because we can then choose the Lua version. Future plans might involve only
    121 # accepting Lua 5.1.
    122 
    123 # Insert all internally supported CEGUILua versions here
    124 SET(CEGUILUA_INTERNAL_SUPPORT 0.5.0 0.6.0 0.6.1 0.6.2)
    125 OPTION(CEGUILUA_USE_EXTERNAL_LIBRARY "Force the use of external CEGUILua library" OFF)
    126 FIND_PACKAGE(CEGUI 0.5 REQUIRED)
    127 
    128 ##### Lua #####
    129 IF(CEGUILUA_USE_EXTERNAL_LIBRARY)
    130   COMPARE_VERSION_STRINGS(${CEGUI_VERSION} "0.6" _version_comparison)
    131   IF(version_comparison LESS 0)
    132     SET(LUA_VERSION_REQUEST 5.0)
    133   ELSE()
    134     SET(LUA_VERSION_REQUEST 5.1)
    135   ENDIF()
    136 ELSE()
    137   SET(LUA_VERSION_REQUEST 5)
    138 ENDIF()
    139 FIND_PACKAGE(Lua ${LUA_VERSION_REQUEST} EXACT REQUIRED)
    140133
    141134##### OpenAL #####
     
    161154
    162155##### Boost #####
    163 # Expand the next statement if newer boost versions than 1.36.1 are released
    164 SET(Boost_ADDITIONAL_VERSIONS 1.37 1.37.0 1.38 1.38.0 1.39 1.39.0 1.40 1.40.0
    165                               1.41 1.41.0 1.42 1.42.0 1.43 1.43.0 1.44 1.44.0)
    166 IF( NOT TARDIS )
    167   FIND_PACKAGE(Boost 1.35 REQUIRED thread filesystem system date_time)
     156# Expand the next statement if newer boost versions are released
     157SET(Boost_ADDITIONAL_VERSIONS 1.40 1.40.0 1.41 1.41.0 1.42 1.42.0 1.43 1.43.0
     158                              1.44 1.44.0 1.45 1.45.0 1.46 1.46.0 1.46.1)
     159IF(NOT TARDIS)
     160  FIND_PACKAGE(Boost 1.40 REQUIRED thread filesystem system date_time)
    168161ENDIF()
    169162# No auto linking, so this option is useless anyway
    170163MARK_AS_ADVANCED(Boost_LIB_DIAGNOSTIC_DEFINITIONS)
     164
     165##### OGRE #####
     166FIND_PACKAGE(OGRE 1.6 REQUIRED)
     167# For Ogre >= 1.7, we might need a threading library
     168# Variables are either defined by dependency package config or by FindOGRE
     169IF(OGRE_NEEDS_POCO)
     170  FIND_PACKAGE(POCO REQUIRED)
     171  # Always link against POCO too because of threading
     172  SET(OGRE_LIBRARY ${OGRE_LIBRARY} ${POCO_LIBRARY})
     173ELSEIF(OGRE_NEEDS_BOOST)
     174  # Always link against boost too because of threading
     175  SET(OGRE_LIBRARY ${OGRE_LIBRARY} ${Boost_THREAD_LIBRARY})
     176ENDIF()
    171177
    172178
     
    177183# Note: Default option in the libraries vary, but our default option is dynamic
    178184IF(WIN32)
    179   OPTION(LINK_BOOST_DYNAMIC "Link Boost dynamically on Windows" TRUE)
    180   OPTION(LINK_CEGUI_DYNAMIC "Link CEGUI dynamicylly on Windows" TRUE)
    181   #OPTION(LINK_ENET_DYNAMIC  "Link ENet dynamically on Windows" TRUE)
    182   OPTION(LINK_OGRE_DYNAMIC  "Link OGRE dynamically on Windows" TRUE)
    183   OPTION(LINK_TCL_DYNAMIC   "Link TCL dynamically on Windows" TRUE)
    184   OPTION(LINK_ZLIB_DYNAMIC  "Link ZLib dynamically on Windows" TRUE)
    185   COMPARE_VERSION_STRINGS("${LUA_VERSION}" "5.1" _version_comparison)
    186   IF(_version_comparison LESS 0)
    187     OPTION(LINK_LUA_DYNAMIC "Link Lua dynamically on Windows" FALSE)
    188   ELSE(_version_comparison LESS 0)
    189     OPTION(LINK_LUA_DYNAMIC "Link Lua dynamically on Windows" TRUE)
    190   ENDIF(_version_comparison LESS 0)
     185  OPTION(LINK_BOOST_DYNAMIC  "Link Boost dynamically on Windows" TRUE)
     186  OPTION(LINK_CEGUI_DYNAMIC  "Link CEGUI dynamicylly on Windows" TRUE)
     187  #OPTION(LINK_ENET_DYNAMIC   "Link ENet dynamically on Windows" TRUE)
     188  OPTION(LINK_OGRE_DYNAMIC   "Link OGRE dynamically on Windows" TRUE)
     189  OPTION(LINK_TCL_DYNAMIC    "Link TCL dynamically on Windows" TRUE)
     190  OPTION(LINK_ZLIB_DYNAMIC   "Link ZLib dynamically on Windows" TRUE)
     191  OPTION(LINK_LUA5.1_DYNAMIC "Link Lua dynamically on Windows" TRUE)
    191192
    192193  IF(DEPENDENCY_PACKAGE_ENABLE)
     
    194195      LINK_BOOST_DYNAMIC LINK_CEGUI_DYNAMIC #LINK_ENET_DYNAMIC
    195196      LINK_OGRE_DYNAMIC  LINK_TCL_DYNAMIC   LINK_ZLIB_DYNAMIC
    196       LINK_LUA_DYNAMIC
     197      LINK_LUA5.1_DYNAMIC
    197198    )
    198199  ENDIF()
  • code/trunk/cmake/LibraryConfigTardis.cmake

    r6746 r8351  
    2525 #
    2626
    27 IF(UNIX AND NOT APPLE)
    28   IF(EXISTS /etc/hostname)
    29     FILE(STRINGS /etc/hostname HOSTNAME LIMIT_COUNT 1)
    30     IF(${HOSTNAME} MATCHES "^tardis-[a-z][0-9][0-9]$")
    31       SET (TARDIS ON)
    32     ENDIF()
     27IF(LINUX AND EXISTS /etc/hostname)
     28  FILE(STRINGS /etc/hostname HOSTNAME LIMIT_COUNT 1)
     29  IF(${HOSTNAME} MATCHES "^tardis-[a-z][0-9][0-9]$")
     30    SET (TARDIS ON)
    3331  ENDIF()
    3432ENDIF()
     
    7775  #SET(ENV{OGGDIR}      "/usr/pack/oggvorbis-1.0-ds;/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0")
    7876  #SET(ENV{VORBISDIR}   "/usr/pack/oggvorbis-1.0-ds;/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0")
    79   #SET(ENV{LUA_DIR}     "/usr/pack/lua-5.1.4-sd;/usr/pack/lua-5.1.4-sd/i686-debian-linux4.0")
     77  #SET(ENV{LUA5.1_DIR}  "/usr/pack/lua-5.1.4-sd;/usr/pack/lua-5.1.4-sd/i686-debian-linux4.0")
    8078  #SET(ENV{OGRE_HOME}   "/usr/pack/ogre-1.4.9-sd;/usr/pack/ogre-1.4.9-sd/i686-debian-linux4.0")
    8179  #SET(ENV{OPENALDIR}   "/usr/pack/openal-0.0.8-cl;/usr/pack/openal-0.0.8-cl/i686-debian-linux3.1")
  • code/trunk/cmake/PackageConfig.cmake

    r7459 r8351  
    2525 #
    2626
    27 # Check package version info
    28 # MAJOR: Breaking change
    29 # MINOR: No breaking changes by the dependency package
    30 #        For example any code running on 3.0 should still run on 3.1
    31 #        But you can specify that the code only runs on 3.1 and higher
    32 #        or 4.0 and higher (so both 3.1 and 4.0 will work).
    33 SET(ALLOWED_MINIMUM_VERSIONS 3.1 4.0 5.0)
    34 
    35 IF(NOT EXISTS ${DEPENDENCY_PACKAGE_DIR}/version.txt)
    36   SET(DEPENDENCY_VERSION 1.0)
    37 ELSE()
    38   # Get version from file
    39   FILE(READ ${DEPENDENCY_PACKAGE_DIR}/version.txt _file_content)
    40   SET(_match)
    41   STRING(REGEX MATCH "([0-9]+.[0-9]+)" _match ${_file_content})
    42   IF(_match)
    43     SET(DEPENDENCY_VERSION ${_match})
    44   ELSE()
    45     MESSAGE(FATAL_ERROR "The version.txt file in the dependency file has corrupt version information.")
    46   ENDIF()
    47 ENDIF()
    48 
    49 INCLUDE(CompareVersionStrings)
    50 SET(_version_match FALSE)
    51 FOREACH(_version ${ALLOWED_MINIMUM_VERSIONS})
    52   # Get major version
    53   STRING(REGEX REPLACE "^([0-9]+)\\..*$" "\\1" _major_version "${_version}")
    54   COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${_major_version} _result TRUE)
    55   IF(_result EQUAL 0)
    56     COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} ${_version} _result FALSE)
    57     IF(NOT _result LESS 0)
    58       SET(_version_match TRUE)
    59     ENDIF()
    60   ENDIF()
    61 ENDFOREACH(_version)
    62 IF(NOT _version_match)
    63   MESSAGE(FATAL_ERROR "Your dependency package version is ${DEPENDENCY_VERSION}\n"
    64           "Possible required versions: ${ALLOWED_MINIMUM_VERSIONS}\n"
    65           "You can get a new version from www.orxonox.net")
    66 ENDIF()
    67 
    6827IF(NOT _INTERNAL_PACKAGE_MESSAGE)
    6928  MESSAGE(STATUS "Using library package for the dependencies.")
     
    7332# Ogre versions >= 1.7 require the POCO library on Windows with MSVC for threading
    7433COMPARE_VERSION_STRINGS(${DEPENDENCY_VERSION} 5 _result TRUE)
    75 IF(NOT _result EQUAL -1 AND NOT MINGW)
    76     SET(POCO_REQUIRED TRUE)
     34IF(NOT _result EQUAL -1 AND NOT APPLE)
     35  SET(OGRE_NEEDS_POCO TRUE)
    7736ENDIF()
    7837
     
    8443SET(ENV{DXSDK_DIR}             ${DEP_INCLUDE_DIR}/directx)
    8544#SET(ENV{ENETDIR}               ${DEP_INCLUDE_DIR}/enet)
    86 SET(ENV{LUA_DIR}               ${DEP_INCLUDE_DIR}/lua)
     45SET(ENV{LUA5.1_DIR}            ${DEP_INCLUDE_DIR}/lua)
    8746SET(ENV{OGGDIR}                ${DEP_INCLUDE_DIR}/libogg)
    8847SET(ENV{VORBISDIR}             ${DEP_INCLUDE_DIR}/libvorbis)
     
    11675
    11776  ## RELEASE
    118   # Try to filter out all the debug libraries. If the regex doesn't do the
    119   # job anymore, simply adjust it.
    120   INSTALL(
    121     DIRECTORY ${DEP_BINARY_DIR}/
    122     DESTINATION bin
    123     CONFIGURATIONS Release RelWithDebInfo MinSizeRel
    124     REGEX "_[Dd]\\.[a-zA-Z0-9+-]+$|-mt-gd-|^.*\\.pdb$" EXCLUDE
    125   )
     77  IF(EXISTS ${DEP_BINARY_DIR}/install_manifest.txt)
     78    FILE(STRINGS ${DEP_BINARY_DIR}/install_manifest.txt _files)
     79    FOREACH(_file ${_files})
     80      INSTALL(
     81        FILES ${DEP_BINARY_DIR}/${_file}
     82        DESTINATION bin
     83        CONFIGURATIONS Release RelWithDebInfo MinSizeRel
     84      )
     85    ENDFOREACH(_file)
     86  ELSE()
     87    # Try to filter out all the debug libraries. If the regex doesn't do the
     88    # job anymore, simply adjust it.
     89    INSTALL(
     90      DIRECTORY ${DEP_BINARY_DIR}/
     91      DESTINATION bin
     92      CONFIGURATIONS Release RelWithDebInfo MinSizeRel
     93      REGEX "_[Dd]\\.[a-zA-Z0-9+-]+$|-mt-gd-|^.*\\.pdb$" EXCLUDE
     94    )
     95  ENDIF()
    12696ENDIF()
  • code/trunk/cmake/PackageConfigMSVC.cmake

    r7818 r8351  
    2828IF(MSVC)
    2929
     30  INCLUDE(CheckPackageVersion)
     31  CHECK_PACKAGE_VERSION(4.3 6.0)
     32
    3033  # 64 bit system?
    3134  IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
     
    3639
    3740  # Choose right MSVC version
    38   STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?) .*$" "\\1"
     41  STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?).*$" "\\1"
    3942         _msvc_version "${CMAKE_GENERATOR}")
    4043
     
    5457  # Certain find scripts don't behave as ecpected to we have
    5558  # to specify the libraries ourselves.
    56   SET(TCL_LIBRARY  ${DEP_LIBRARY_DIR}/tcl85.lib CACHE FILEPATH "")
    57   SET(ZLIB_LIBRARY ${DEP_LIBRARY_DIR}/zdll.lib  CACHE FILEPATH "")
     59  IF(MSVC10)
     60    SET(TCL_LIBRARY
     61      optimized ${DEP_LIBRARY_DIR}/tcl85t.lib
     62      debug     ${DEP_LIBRARY_DIR}/tcl85tg.lib
     63      CACHE FILEPATH ""
     64    )
     65    SET(ZLIB_LIBRARY
     66      optimized ${DEP_LIBRARY_DIR}/zlib-vc100.lib
     67      debug     ${DEP_LIBRARY_DIR}/zlib-vc100_d.lib
     68      CACHE FILEPATH ""
     69    )
     70  ELSE()
     71    SET(TCL_LIBRARY  ${DEP_LIBRARY_DIR}/tcl85.lib CACHE FILEPATH "")
     72    SET(ZLIB_LIBRARY ${DEP_LIBRARY_DIR}/zdll.lib  CACHE FILEPATH "")
     73  ENDIF()
     74  # Part of Platform SDK and usually gets linked automatically
     75  SET(WMI_LIBRARY  wbemuuid.lib)
    5876
    5977ENDIF(MSVC)
  • code/trunk/cmake/PackageConfigMinGW.cmake

    r5781 r8351  
    2828IF(MINGW)
    2929
     30  INCLUDE(CheckPackageVersion)
     31  CHECK_PACKAGE_VERSION(6.0)
     32
    3033  # 64 bit system?
    3134  IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
     
    4851  # to specify the libraries ourselves.
    4952  SET(TCL_LIBRARY  ${DEP_BINARY_DIR}/tcl85.dll CACHE FILEPATH "")
    50   SET(ZLIB_LIBRARY ${DEP_BINARY_DIR}/zlib1.dll CACHE FILEPATH "")
     53  SET(ZLIB_LIBRARY ${DEP_BINARY_DIR}/libzlib.dll CACHE FILEPATH "")
     54
     55  # Not included in MinGW, so we need to supply it for OIS
     56  SET(WMI_INCLUDE_DIR ${DEP_INCLUDE_DIR}/wmi/include)
     57  SET(WMI_LIBRARY     ${DEP_LIBRARY_DIR}/wbemuuid.lib)
    5158
    5259ENDIF(MINGW)
  • code/trunk/cmake/tools/CheckOGREPlugins.cmake

    r8264 r8351  
    5252      NAMES ${_plugin}
    5353      PATHS $ENV{OGRE_HOME} $ENV{OGRE_PLUGIN_DIR}
    54       PATH_SUFFIXES bin/Release bin/release Release release lib lib/OGRE bin
     54      PATH_SUFFIXES bin/Release bin/release Release release lib lib/OGRE bin Ogre.framework/Resources
    5555    )
    5656    FIND_LIBRARY(OGRE_PLUGIN_${_plugin}_DEBUG
    5757      NAMES ${_plugin}d ${_plugin}_d ${_plugin}
    5858      PATHS $ENV{OGRE_HOME} $ENV{OGRE_PLUGIN_DIR}
    59       PATH_SUFFIXES bin/Debug bin/debug Debug debug lib lib/OGRE bin
     59      PATH_SUFFIXES bin/Debug bin/debug Debug debug lib lib/OGRE bin Ogre.framework/Resources
    6060    )
    6161    # We only need at least one render system. Check at the end.
  • code/trunk/cmake/tools/FindALUT.cmake

    r7163 r8351  
    1 # - Locate FreeAlut
    2 # This module defines
    3 #  ALUT_LIBRARY
    4 #  ALUT_FOUND, if false, do not try to link against Alut
    5 #  ALUT_INCLUDE_DIR, where to find the headers
    6 #
    7 # $ALUTDIR is an environment variable that would
    8 # correspond to the ./configure --prefix=$ALUTDIR
    9 # used in building Alut.
    10 #
    11 # Created by Eric Wing. This was influenced by the FindSDL.cmake module.
    12 # On OSX, this will prefer the Framework version (if found) over others.
    13 # People will have to manually change the cache values of
    14 # ALUT_LIBRARY to override this selection.
    15 # Tiger will include OpenAL as part of the System.
    16 # But for now, we have to look around.
    17 # Other (Unix) systems should be able to utilize the non-framework paths.
    18 #
    19 # Several changes and additions by Fabian 'x3n' Landau
    20 # Some simplifications by Adrian Friedli and Reto Grieder
    21 #                 > www.orxonox.net <
     1 #
     2 #             ORXONOX - the hottest 3D action shooter ever to exist
     3 #                             > www.orxonox.net <
     4 #
     5 #        This program is free software; you can redistribute it and/or
     6 #         modify it under the terms of the GNU General Public License
     7 #        as published by the Free Software Foundation; either version 2
     8 #            of the License, or (at your option) any later version.
     9 #
     10 #       This program is distributed in the hope that it will be useful,
     11 #        but WITHOUT ANY WARRANTY; without even the implied warranty of
     12 #        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13 #                 GNU General Public License for more details.
     14 #
     15 #   You should have received a copy of the GNU General Public License along
     16 #      with this program; if not, write to the Free Software Foundation,
     17 #     Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
     18 #
     19 #
     20 #  Author:
     21 #    Kevin Young
     22 #  Description:
     23 #    Variables defined:
     24 #      ALUT_FOUND
     25 #      ALUT_INCLUDE_DIR
     26 #      ALUT_LIBRARY
     27 #
    2228
    2329INCLUDE(FindPackageHandleStandardArgs)
    2430INCLUDE(HandleLibraryTypes)
    2531
    26 FIND_PATH(ALUT_INCLUDE_DIR AL/alut.h
    27   PATHS
    28   $ENV{ALUTDIR}
    29   ~/Library/Frameworks/OpenAL.framework
    30   /Library/Frameworks/OpenAL.framework
    31   /System/Library/Frameworks/OpenAL.framework # Tiger
    32   PATH_SUFFIXES include include/OpenAL include/AL Headers
     32FIND_PATH(ALUT_INCLUDE_DIR alut.h
     33  PATHS $ENV{ALUTDIR}
     34  PATH_SUFFIXES include include/AL
    3335)
    34 
    35 # I'm not sure if I should do a special casing for Apple. It is
    36 # unlikely that other Unix systems will find the framework path.
    37 # But if they do ([Next|Open|GNU]Step?),
    38 # do they want the -framework option also?
    39 IF(${ALUT_INCLUDE_DIR} MATCHES ".framework")
    40 
    41   STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" ALUT_FRAMEWORK_PATH_TMP ${ALUT_INCLUDE_DIR})
    42   IF("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
    43       OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
    44       )
    45     # String is in default search path, don't need to use -F
    46     SET (ALUT_LIBRARY_OPTIMIZED "-framework OpenAL" CACHE STRING "OpenAL framework for OSX")
    47   ELSE()
    48     # String is not /Library/Frameworks, need to use -F
    49     SET(ALUT_LIBRARY_OPTIMIZED "-F${ALUT_FRAMEWORK_PATH_TMP} -framework OpenAL" CACHE STRING "OpenAL framework for OSX")
    50   ENDIF()
    51   # Clear the temp variable so nobody can see it
    52   SET(ALUT_FRAMEWORK_PATH_TMP "" CACHE INTERNAL "")
    53 
    54 ELSE()
    55   FIND_LIBRARY(ALUT_LIBRARY_OPTIMIZED
    56     NAMES alut
    57     PATHS $ENV{ALUTDIR}
    58     PATH_SUFFIXES lib libs
    59   )
    60   FIND_LIBRARY(ALUT_LIBRARY_DEBUG
    61     NAMES alutd alut_d alutD alut_D
    62     PATHS $ENV{ALUTDIR}
    63     PATH_SUFFIXES lib libs
    64   )
    65 ENDIF()
     36FIND_LIBRARY(ALUT_LIBRARY_OPTIMIZED
     37  NAMES alut ALUT
     38  PATHS $ENV{ALUTDIR}
     39  PATH_SUFFIXES lib bin/Release bin/release Release release ALUT
     40)
     41FIND_LIBRARY(ALUT_LIBRARY_DEBUG
     42  NAMES alutd alut_d alutD alut_D ALUTd ALUT_d ALUTD ALUT_D
     43  PATHS $ENV{ALUTDIR}
     44  PATH_SUFFIXES lib bin/Debug bin/debug Debug debug ALUT
     45)
    6646
    6747# Handle the REQUIRED argument and set ALUT_FOUND
    6848FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALUT DEFAULT_MSG
    69     ALUT_LIBRARY_OPTIMIZED
    70     ALUT_INCLUDE_DIR
     49  ALUT_LIBRARY_OPTIMIZED
     50  ALUT_INCLUDE_DIR
    7151)
    7252
     
    7555
    7656MARK_AS_ADVANCED(
    77     ALUT_INCLUDE_DIR
    78     ALUT_LIBRARY_OPTIMIZED
    79     ALUT_LIBRARY_DEBUG
     57  ALUT_INCLUDE_DIR
     58  ALUT_LIBRARY_OPTIMIZED
     59  ALUT_LIBRARY_DEBUG
    8060)
  • code/trunk/cmake/tools/FindCEGUI.cmake

    r7163 r8351  
    44#  CEGUI_INCLUDE_DIR
    55#  CEGUI_LIBRARY, the library to link against to use CEGUI.
     6#  CEGUILUA_LIBRARY, the library to link against to use the CEGUI script module.
     7#  CEGUI_TOLUA_LIBRARY, the library to link against to use Tolua++.
    68#  CEGUI_FOUND, If false, do not try to use CEGUI
    79#  CEGUI_VERSION, the version as string "x.y.z"
    8 #  CEGUILUA_LIBRARY, Script module library
    9 #  CEGUILUA_USE_INTERNAL_LIBRARY, True if CEGUILUA_LIBRARY was not defined here
    1010#
    1111# Input:
    1212#  ENV{CEGUIDIR}, CEGUI path, optional
    13 #  FIND CEGUILUA_INTERNAL_SUPPORT, List of all CEGUILua version supported
    14 #                                  in the source repository
    15 #  CEGUILUA_USE_EXTERNAL_LIBRARY, Force finding of CEGUILua
    1613#
    1714# Created by Matt Williams to find OGRE libraries
     
    2926#                 > www.orxonox.net <
    3027
     28INCLUDE(CompareVersionStrings)
    3129INCLUDE(DetermineVersion)
    3230INCLUDE(FindPackageHandleAdvancedArgs)
    3331INCLUDE(HandleLibraryTypes)
    3432
     33# Find CEGUI headers
    3534FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h
    3635  PATHS $ENV{CEGUIDIR}
    37   PATH_SUFFIXES include include/CEGUI CEGUI.framework/Headers
     36  PATH_SUFFIXES include include/CEGUI
    3837)
     38
     39# Inspect CEGUIVersion.h for the version number
     40DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h)
     41
     42# Find CEGUI library
    3943FIND_LIBRARY(CEGUI_LIBRARY_OPTIMIZED
    4044  NAMES CEGUIBase CEGUI
     
    5054)
    5155
    52 # Inspect CEGUIVersion.h for the version number
    53 DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h)
     56# Find CEGUILua headers
     57FIND_PATH(CEGUILUA_INCLUDE_DIR CEGUILua.h
     58  PATHS
     59    $ENV{CEGUIDIR}
     60    $ENV{CEGUILUADIR}
     61    ${CEGUI_INCLUDE_DIR}/ScriptingModules/LuaScriptModule
     62  PATH_SUFFIXES include include/CEGUI
     63)
     64# Find CEGUILua libraries
     65FIND_LIBRARY(CEGUILUA_LIBRARY_OPTIMIZED
     66  NAMES CEGUILua CEGUILuaScriptModule
     67  PATHS $ENV{CEGUIDIR} $ENV{CEGUILUADIR}
     68  PATH_SUFFIXES lib bin
     69)
     70FIND_LIBRARY(CEGUILUA_LIBRARY_DEBUG
     71  NAMES CEGUILuad CEGUILua_d CEGUILuaScriptModuled CEGUILuaScriptModule_d
     72  PATHS $ENV{CEGUIDIR} $ENV{CEGUILUADIR}
     73  PATH_SUFFIXES lib bin
     74)
     75
     76# Find CEGUI Tolua++ include file
     77# We only need to add this path since we use tolua++ like a normal
     78# dependency but it is shipped with CEGUILua.
     79FIND_PATH(CEGUI_TOLUA_INCLUDE_DIR tolua++.h
     80  PATHS
     81    ${CEGUILUA_INCLUDE_DIR}
     82    # For newer CEGUI versions >= 0.7
     83    ${CEGUILUA_INCLUDE_DIR}/support/tolua++
     84    # For Mac OS X, tolua++ is a separate framework in the dependency package
     85    ${DEP_FRAMEWORK_DIR}
     86  NO_DEFAULT_PATH # Don't attempt to find tolua++ installed on the system
     87)
     88# Find CEGUI Tolua++ libraries
     89FIND_LIBRARY(CEGUI_TOLUA_LIBRARY_OPTIMIZED
     90  NAMES CEGUItoluapp tolua++ ceguitolua++
     91  PATHS $ENV{CEGUIDIR} ${CEGUITOLUADIR}
     92  PATH_SUFFIXES lib bin
     93)
     94FIND_LIBRARY(CEGUI_TOLUA_LIBRARY_DEBUG
     95  NAMES CEGUItoluappd CEGUItoluapp_d tolua++d tolua++_d
     96  PATHS $ENV{CEGUIDIR} ${CEGUITOLUADIR}
     97  PATH_SUFFIXES lib bin
     98)
     99
     100# Newer versions of CEGUI have the renderer for OGRE shipped with them
     101COMPARE_VERSION_STRINGS("${CEGUI_VERSION}" "0.7" _version_compare TRUE)
     102IF(_version_compare GREATER -1)
     103  # Find CEGUI OGRE Renderer headers
     104  FIND_PATH(CEGUI_OGRE_RENDERER_INCLUDE_DIR CEGUIOgreRenderer.h
     105    PATHS
     106      $ENV{CEGUIDIR}
     107      $ENV{CEGUIOGRERENDERERDIR}
     108      ${CEGUI_INCLUDE_DIR}/RendererModules/Ogre
     109    PATH_SUFFIXES include include/CEGUI
     110  )
     111  # Find CEGUI OGRE Renderer libraries
     112  FIND_LIBRARY(CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED
     113    NAMES CEGUIOgreRenderer
     114    PATHS $ENV{CEGUIDIR} $ENV{CEGUIOGRERENDERERDIR}
     115    PATH_SUFFIXES lib bin
     116  )
     117  FIND_LIBRARY(CEGUI_OGRE_RENDERER_LIBRARY_DEBUG
     118    NAMES CEGUIOgreRendererd CEGUIOgreRenderer_d
     119    PATHS $ENV{CEGUIDIR} $ENV{CEGUIOGRERENDERERDIR}
     120    PATH_SUFFIXES lib bin
     121  )
     122  SET(CEGUI_OGRE_RENDERER_REQUIRED_VARIABLES
     123    CEGUI_OGRE_RENDERER_INCLUDE_DIR
     124    CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED
     125  )
     126ELSE()
     127  SET(CEGUI_OLD_VERSION TRUE)
     128  SET(CEGUI_OGRE_RENDERER_BUILD_REQUIRED TRUE)
     129ENDIF()
    54130
    55131# Handle the REQUIRED argument and set CEGUI_FOUND
    56132# Also checks the version requirements if given
    57133FIND_PACKAGE_HANDLE_ADVANCED_ARGS(CEGUI DEFAULT_MSG "${CEGUI_VERSION}"
     134  CEGUI_INCLUDE_DIR
    58135  CEGUI_LIBRARY_OPTIMIZED
    59   CEGUI_INCLUDE_DIR
     136  CEGUILUA_INCLUDE_DIR
     137  CEGUILUA_LIBRARY_OPTIMIZED
     138  CEGUI_TOLUA_INCLUDE_DIR
     139  CEGUI_TOLUA_LIBRARY_OPTIMIZED
     140  ${CEGUI_OGRE_RENDERER_REQUIRED_VARIABLES}
    60141)
    61142
    62143# Collect optimized and debug libraries
    63144HANDLE_LIBRARY_TYPES(CEGUI)
     145HANDLE_LIBRARY_TYPES(CEGUILUA)
     146HANDLE_LIBRARY_TYPES(CEGUI_TOLUA)
     147IF(NOT CEGUI_OGRE_RENDERER_BUILD_REQUIRED)
     148  HANDLE_LIBRARY_TYPES(CEGUI_OGRE_RENDERER)
     149ENDIF()
    64150
    65151MARK_AS_ADVANCED(
     
    67153  CEGUI_LIBRARY_OPTIMIZED
    68154  CEGUI_LIBRARY_DEBUG
     155  CEGUILUA_INCLUDE_DIR
     156  CEGUILUA_LIBRARY_OPTIMIZED
     157  CEGUILUA_LIBRARY_DEBUG
     158  CEGUI_TOLUA_INCLUDE_DIR
     159  CEGUI_TOLUA_LIBRARY_OPTIMIZED
     160  CEGUI_TOLUA_LIBRARY_DEBUG
     161  CEGUI_OGRE_RENDERER_INCLUDE_DIR
     162  CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED
     163  CEGUI_OGRE_RENDERER_LIBRARY_DEBUG
    69164)
    70 
    71 LIST(FIND CEGUILUA_INTERNAL_SUPPORT "${CEGUI_VERSION}" _find_result)
    72 IF(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1)
    73   # Also try to find the CEGUILua libraries.
    74   # There would already be libraries in src/ for versions 0.5 and 0.6
    75   FIND_LIBRARY(CEGUILUA_LIBRARY_OPTIMIZED
    76     NAMES CEGUILua
    77     PATHS $ENV{CEGUIDIR}
    78     PATH_SUFFIXES lib bin
    79   )
    80   FIND_LIBRARY(CEGUILUA_LIBRARY_DEBUG
    81     NAMES CEGUILuad CEGUILua_d
    82     PATHS $ENV{CEGUIDIR}
    83     PATH_SUFFIXES lib bin
    84   )
    85 
    86   SET(CEGUILua_FIND_REQUIRED ${CEGUI_FIND_REQUIRED})
    87   # Handle the REQUIRED argument and set CEGUILUA_FOUND
    88   FIND_PACKAGE_HANDLE_STANDARD_ARGS(CEGUILua DEFAULT_MSG
    89     CEGUILUA_LIBRARY_OPTIMIZED
    90   )
    91 
    92   # Collect optimized and debug libraries
    93   HANDLE_LIBRARY_TYPES(CEGUILUA)
    94 
    95   MARK_AS_ADVANCED(
    96     CEGUILUA_LIBRARY_OPTIMIZED
    97     CEGUILUA_LIBRARY_DEBUG
    98   )
    99 
    100 ELSE(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1)
    101   SET(CEGUILUA_USE_INTERNAL_LIBRARY TRUE)
    102 ENDIF(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1)
    103 
  • code/trunk/cmake/tools/FindOGRE.cmake

    r7163 r8351  
    2323FIND_PATH(OGRE_INCLUDE_DIR Ogre.h
    2424  PATHS $ENV{OGRE_HOME}
    25   PATH_SUFFIXES include include/OGRE Ogre.framework/Headers
     25  PATH_SUFFIXES include include/OGRE
    2626)
    2727FIND_LIBRARY(OGRE_LIBRARY_OPTIMIZED
     
    3333  NAMES OgreMaind OgreMain_d OgreMainD OgreMain_D Ogred Ogre_d OgreD Ogre_d
    3434  PATHS $ENV{OGRE_HOME}
    35   PATH_SUFFIXES lib bin/Debug bin/debug Debug debug Versions/A
     35  PATH_SUFFIXES lib bin/Debug bin/debug Debug debug
    3636)
    3737
  • code/trunk/cmake/tools/FindOgg.cmake

    r7163 r8351  
    2222)
    2323FIND_LIBRARY(OGG_LIBRARY_OPTIMIZED
    24   NAMES ogg
     24  NAMES ogg ogg-0 libogg
    2525  PATHS $ENV{OGGDIR}
    2626  PATH_SUFFIXES lib
    2727)
    2828FIND_LIBRARY(OGG_LIBRARY_DEBUG
    29   NAMES oggd ogg_d oggD ogg_D
     29  NAMES oggd ogg_d oggD ogg_D libogg_d
    3030  PATHS $ENV{OGGDIR}
    3131  PATH_SUFFIXES lib
  • code/trunk/cmake/tools/FindPOCO.cmake

    r7285 r8351  
    2929FIND_PATH(POCO_INCLUDE_DIR Poco/Poco.h
    3030  PATHS $ENV{POCODIR}
    31   PATH_SUFFIXES include
     31  PATH_SUFFIXES include Foundation/include
    3232)
    3333FIND_LIBRARY(POCO_LIBRARY_OPTIMIZED
  • code/trunk/cmake/tools/FindVorbis.cmake

    r7163 r8351  
    2222)
    2323FIND_LIBRARY(VORBIS_LIBRARY_OPTIMIZED
    24   NAMES vorbis
     24  NAMES vorbis vorbis-0 libvorbis
    2525  PATHS $ENV{VORBISDIR}
    2626  PATH_SUFFIXES lib
    2727)
    2828FIND_LIBRARY(VORBIS_LIBRARY_DEBUG
    29   NAMES vorbisd vorbis_d vorbisD vorbis_D
     29  NAMES vorbisd vorbis_d vorbisD vorbis_D libvorbis_d
    3030  PATHS $ENV{VORBISDIR}
    3131  PATH_SUFFIXES lib
    3232)
    3333FIND_LIBRARY(VORBISFILE_LIBRARY_OPTIMIZED
    34   NAMES vorbisfile
     34  NAMES vorbisfile vorbisfile-3 libvorbisfile
    3535  PATHS $ENV{VORBISDIR}
    3636  PATH_SUFFIXES lib
    3737)
    3838FIND_LIBRARY(VORBISFILE_LIBRARY_DEBUG
    39   NAMES vorbisfiled vorbisfile_d vorbisfileD vorbisfile_D
     39  NAMES vorbisfiled vorbisfile_d vorbisfileD vorbisfile_D libvorbisfile_d
    4040  PATHS $ENV{VORBISDIR}
    4141  PATH_SUFFIXES lib
  • code/trunk/cmake/tools/GenerateToluaBindings.cmake

    r7415 r8351  
    3232 #    RUNTIME_LIBRARY_DIRECTORY - Working directory
    3333 #
     34
     35# Workaround for XCode: The folder where the bind files are written to has
     36# to be present beforehand.
     37# We have to do this here because the header files are all stored in a single
     38# location per configuration.
     39IF(CMAKE_CONFIGURATION_TYPES)
     40  FOREACH(_dir ${CMAKE_CONFIGURATION_TYPES})
     41    FILE(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/src/toluabind/${_dir}")
     42  ENDFOREACH(_dir)
     43ENDIF()
    3444
    3545FUNCTION(GENERATE_TOLUA_BINDINGS _tolua_package _target_source_files)
  • code/trunk/cmake/tools/TargetUtilities.cmake

    r8079 r8351  
    4343 #    Lists:
    4444 #      LINK_LIBRARIES:    Redirects to TARGET_LINK_LIBRARIES
     45 #      LINK_LIBS_LINUX:   Redirects to TARGET_LINK_LIBRARIES only on Linux
     46 #      LINK_LIBS_WIN32:   Redirects to TARGET_LINK_LIBRARIES only on Windows
     47 #      LINK_LIBS_APPLE:   Redirects to TARGET_LINK_LIBRARIES only on Apple
     48 #      LINK_LIBS_UNIX:    Redirects to TARGET_LINK_LIBRARIES only on UNIX
    4549 #      VERSION:           Set version to the binary
    4650 #      SOURCE_FILES:      Source files for the target
     
    5357 #    This function also installs the target!
    5458 #  Prerequisistes:
    55  #    ORXONOX_DEFAULT_LINK, ORXONOX_CONFIG_FILES
     59 #    ORXONOX_DEFAULT_LINK
    5660 #  Parameters:
    5761 #    _target_name, ARGN for the macro arguments
     
    8690  SET(_list_names LINK_LIBRARIES     VERSION           SOURCE_FILES
    8791                  DEFINE_SYMBOL      TOLUA_FILES       PCH_FILE
    88                   PCH_EXCLUDE        OUTPUT_NAME)
     92                  PCH_EXCLUDE        OUTPUT_NAME       LINK_LIBS_LINUX
     93                  LINK_LIBS_WIN32    LINK_LIBS_APPLE   LINK_LIBS_UNIX)
    8994
    9095  PARSE_MACRO_ARGUMENTS("${_switches}" "${_list_names}" ${ARGN})
     
    104109        MESSAGE(FATAL_ERROR "No name provided for source file compilation")
    105110      ENDIF()
    106       IF(NOT _compilation_include_string)
    107         MESSAGE(STATUS "Warning: Empty source file compilation!")
    108       ENDIF()
    109111      IF(NOT DISABLE_COMPILATIONS)
     112        IF(NOT _compilation_include_string)
     113          MESSAGE(STATUS "Warning: Empty source file compilation!")
     114        ENDIF()
    110115        IF(EXISTS ${_compilation_file})
    111116          FILE(READ ${_compilation_file} _include_string_file)
     
    169174    GENERATE_TOLUA_BINDINGS(${_target_name_capitalised} _${_target_name}_files
    170175                            INPUTFILES ${_arg_TOLUA_FILES})
     176    # Workaround for XCode: The folder where the bind files are written to has
     177    # to be present beforehand.
     178    IF(CMAKE_CONFIGURATION_TYPES)
     179      FOREACH(_dir ${CMAKE_CONFIGURATION_TYPES})
     180        FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_dir})
     181      ENDFOREACH(_dir)
     182    ENDIF()
    171183  ENDIF()
    172184
     
    192204
    193205    IF(NOT _arg_ORXONOX_EXTERNAL)
    194       # Move the prereqs.h file to the config section
     206      # Move the ...Prereqs.h and the PCH files to the 'Config' section
    195207      IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_target_name_capitalised}Prereqs.h)
    196208        SOURCE_GROUP("Config" FILES ${_target_name_capitalised}Prereqs.h)
    197209      ENDIF()
    198       # Add config files to the config section
    199       LIST(APPEND _${_target_name}_files ${ORXONOX_CONFIG_FILES})
    200       SOURCE_GROUP("Config" FILES ${ORXONOX_CONFIG_FILES})
     210      IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_arg_PCH_FILE})
     211        SOURCE_GROUP("Config" FILES ${CMAKE_CURRENT_SOURCE_DIR}/${_arg_PCH_FILE})
     212      ENDIF()
    201213    ENDIF()
    202214  ENDIF()
     
    217229  IF(_arg_ORXONOX_EXTERNAL)
    218230    REMOVE_COMPILER_FLAGS("-W3 -W4" MSVC)
    219     ADD_COMPILER_FLAGS("-w")
     231    ADD_COMPILER_FLAGS("-w" NOT MSVC)
     232    ADD_COMPILER_FLAGS("-W0" MSVC)
    220233  ENDIF()
    221234
    222235  # Don't compile header files
    223236  FOREACH(_file ${_${_target_name}_files})
    224     IF(NOT _file MATCHES "\\.(c|cc|cpp|cxx)$")
     237    IF(NOT _file MATCHES "\\.(c|cc|cpp|cxx|mm)$")
    225238      SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES HEADER_FILE_ONLY TRUE)
    226239    ENDIF()
     
    278291    TARGET_LINK_LIBRARIES(${_target_name} ${_arg_LINK_LIBRARIES})
    279292  ENDIF()
     293  IF(_arg_LINK_LIBS_LINUX AND LINUX)
     294    TARGET_LINK_LIBRARIES(${_target_name} ${_arg_LINK_LIBS_LINUX})
     295  ENDIF()
     296  IF(_arg_LINK_LIBS_WIN32 AND WIN32)
     297    TARGET_LINK_LIBRARIES(${_target_name} ${_arg_LINK_LIBS_WIN32})
     298  ENDIF()
     299  IF(_arg_LINK_LIBS_APPLE AND APPLE)
     300    TARGET_LINK_LIBRARIES(${_target_name} ${_arg_LINK_LIBS_APPLE})
     301  ENDIF()
     302  IF(_arg_LINK_LIBS_UNIX AND UNIX)
     303    TARGET_LINK_LIBRARIES(${_target_name} ${_arg_LINK_LIBS_UNIX})
     304  ENDIF()
     305
     306  # RPATH settings for the installation
     307  IF("${_target_type}" STREQUAL "LIBRARY")
     308    IF(_arg_MODULE)
     309      SET(_rpath "${MODULE_RPATH}")
     310    ELSE()
     311      SET(_rpath "${LIBRARY_RPATH}")
     312    ENDIF()
     313  ELSE()
     314    SET(_rpath "${RUNTIME_RPATH}")
     315  ENDIF()
     316  SET_TARGET_PROPERTIES(${_target_name} PROPERTIES INSTALL_RPATH "${_rpath}")
    280317
    281318  # DEFINE_SYMBOL
  • code/trunk/contrib/orxonox.desktop

    • Property svn:eol-style set to native
    r8229 r8351  
    22Name=Orxonox
    33Comment=A spacecraft shooter
    4 Exec=orxonox
     4Exec=/usr/games/orxonox
    55Icon=/usr/share/pixmaps/orxonox.png
    66Type=Application
  • code/trunk/contrib/orxonox.manpage.xml

    • Property svn:eol-style set to native
  • code/trunk/data/CMakeLists.txt

    r7163 r8351  
    5959  DIRECTORY ${EXTERNAL_DATA_DIRECTORY}/
    6060  DESTINATION ${DATA_INSTALL_DIRECTORY}
    61   REGEX "\\.svn$|_svn$|resources\\.oxr|AUTHORS|LICENSE" EXCLUDE
     61  REGEX "\\.svn$|_svn$|AUTHORS|LICENSE" EXCLUDE
    6262)
    63 # Configure the install scripts (variables not available during installation)
    64 CONFIGURE_FILE(DataInstallScript.cmake ${CMAKE_CURRENT_BINARY_DIR}/DataInstallScript.cmake @ONLY)
    65 # Join both resources.oxr files
    66 INSTALL(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/DataInstallScript.cmake)
  • code/trunk/data/gui/scripts/AudioMenu.lua

    r8079 r8351  
    3232    table.insert(themeList, "Default")
    3333    table.insert(themeList, "Drum n' Bass")
     34    table.insert(themeList, "8-Bit Style")
     35    table.insert(themeList, "Corny Jazz")
    3436    for k,v in pairs(themeList) do
    3537        item = CEGUI.createListboxTextItem(v)
     
    3941    if orxonox.getConfig("MoodManager", "mood_") == "dnb" then
    4042        listboxwindow:setItemSelectState(1,true)
     43    elseif orxonox.getConfig("MoodManager", "mood_") == "eightbit" then
     44        listboxwindow:setItemSelectState(2,true)
     45    elseif orxonox.getConfig("MoodManager", "mood_") == "jazzy" then
     46        listboxwindow:setItemSelectState(3,true)
    4147    else
    4248        listboxwindow:setItemSelectState(0,true)
     
    168174    if listboxwindow:isItemSelected(1) then
    169175        orxonox.config("MoodManager", "mood_", "dnb")
     176    elseif listboxwindow:isItemSelected(2) then
     177        orxonox.config("MoodManager", "mood_", "eightbit")
     178    elseif listboxwindow:isItemSelected(3) then
     179        orxonox.config("MoodManager", "mood_", "jazzy")
    170180    else
    171181        orxonox.config("MoodManager", "mood_", "default")
  • code/trunk/data/gui/scripts/GUITools.lua

    r8079 r8351  
    3131
    3232    local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(window:getLookNFeel())
    33     local height = window:getFont():getLineSpacing() + window:getUnclippedPixelRect():getHeight() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getHeight()
    34     local width =  window:getFont():getTextExtent(window:getText()) + window:getUnclippedPixelRect():getWidth() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getWidth()
     33    local height = window:getFont():getLineSpacing() + window:getUnclippedOuterRect():getHeight() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getHeight()
     34    local width =  window:getFont():getTextExtent(window:getText()) + window:getUnclippedOuterRect():getWidth() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getWidth()
    3535
    3636    table.insert(size, height)
     
    4040
    4141function getScrollingStepSize(window)
    42     local height = window:getUnclippedPixelRect():getHeight()
    43     local maxHeight = CEGUI.System:getSingleton():getGUISheet():getUnclippedPixelRect():getHeight()
     42    local height = window:getUnclippedOuterRect():getHeight()
     43    local maxHeight = CEGUI.System:getSingleton():getGUISheet():getUnclippedOuterRect():getHeight()
    4444    local ratio = height/maxHeight
    4545    return 0.008*ratio/0.3204
     
    4747
    4848function getStaticTextWindowHeight(window)
     49    -- Get the area the text is formatted and drawn into.
    4950    local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(window:getLookNFeel())
    5051    local formattedArea = lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window)
    51     local frameHeight = window:getUnclippedPixelRect():getHeight() - formattedArea:getHeight()
    52     local lines = window:getFont():getFormattedLineCount(window:getText(), formattedArea, CEGUI.WordWrapLeftAligned)
    53     local height = lines * window:getFont():getLineSpacing() + frameHeight
     52    -- Calculate the pixel height of the frame by subtracting the height of the area above from the total height of the window.
     53    local frameHeight = window:getUnclippedOuterRect():getHeight() - formattedArea:getHeight()
     54
     55    local height = 0
     56    if ORXONOX_OLD_CEGUI then
     57        local lines = window:getFont():getFormattedLineCount(window:getText(), formattedArea, CEGUI.WordWrapLeftAligned)
     58        height = lines * window:getFont():getLineSpacing() + frameHeight
     59    else
     60        height = math.floor(CEGUI.PropertyHelper:stringToFloat(window:getProperty("VertExtent")) + frameHeight) + 1
     61    end
    5462    return height
    5563end
  • code/trunk/data/gui/scripts/InitialiseGUI.lua

    r7801 r8351  
    77local scheme = orxonox.CommandExecutor:query("getConfig GUIManager guiScheme_")
    88-- Load all required skins
    9 --schemeMgr:loadScheme("TaharezGreenLook.scheme")
    10 schemeMgr:loadScheme(scheme .. "Look.scheme")
    11 --schemeMgr:loadScheme("TaharezLook.scheme")
    12 --schemeMgr:loadScheme("WindowsLook.scheme")
    13 --schemeMgr:loadScheme("VanillaLook.scheme")
    14 --schemeMgr:loadScheme("SleekSpaceLook.scheme")
     9--schemeMgr:create("TaharezGreenLook.scheme")
     10schemeMgr:create(scheme .. "Look.scheme")
     11--schemeMgr:create("TaharezLook.scheme")
     12--schemeMgr:create("WindowsLook.scheme")
     13--schemeMgr:create("VanillaLook.scheme")
     14--schemeMgr:create("SleekSpaceLook.scheme")
    1515
    1616-- Connect skin specific window types with our own window types
    1717-- By loading a different file (if there is) you can change the skin
    1818-- of the menus or the HUD independently
    19 --schemeMgr:loadScheme("TaharezGreenMenuWidgets.scheme")
     19--schemeMgr:create("TaharezGreenMenuWidgets.scheme")
    2020--menuImageSet = "TaharezGreenLook"
    21 --schemeMgr:loadScheme("TaharezGreenHUDWidgets.scheme")
     21--schemeMgr:create("TaharezGreenHUDWidgets.scheme")
    2222--hudImageSet = "TaharezGreenLook"
    23 schemeMgr:loadScheme(scheme .. "MenuWidgets.scheme")
     23schemeMgr:create(scheme .. "MenuWidgets.scheme")
    2424menuImageSet = scheme .. "Look"
    25 schemeMgr:loadScheme(scheme .. "HUDWidgets.scheme")
     25schemeMgr:create(scheme .. "HUDWidgets.scheme")
    2626hudImageSet = scheme .. "Look"
    2727
    2828-- Just a remaining test hack
    29 schemeMgr:loadScheme("OrxonoxGUIScheme.scheme")
     29schemeMgr:create("OrxonoxGUIScheme.scheme")
    3030
    3131local system = CEGUI.System:getSingleton()
  • code/trunk/data/gui/scripts/NotificationLayer.lua

    r8079 r8351  
    484484    local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(queue:getLookNFeel())
    485485    local formattedArea = lookAndFeel:getNamedArea("ItemRenderingArea"):getArea():getPixelRect(queue)
    486     local frameHeight = queue:getUnclippedPixelRect():getHeight() - formattedArea:getHeight()
     486    local frameHeight = queue:getUnclippedOuterRect():getHeight() - formattedArea:getHeight()
    487487    listbox:removeItem(item)
    488488    return frameHeight + singleItemHeight*size
  • code/trunk/data/gui/scripts/SettingsMenu.lua

    r8079 r8351  
    3535end
    3636
     37function P.onShow()
     38    local window = winMgr:getWindow("orxonox/SettingsMenu/AudioButton")
     39    if not orxonox.SoundManager:exists() then
     40        window:setProperty("Disabled", "true")
     41    else
     42        window:setProperty("Disabled", "false")
     43    end
     44end
     45
    3746function P.SettingsGameplayButton_clicked(e)
    3847    showMenuSheet("GameplayMenu", true)
  • code/trunk/data/levels/lastTeamStandingII.oxw

    • Property svn:eol-style set to native
  • code/trunk/data/overlays/lastTeamStandingHUD.oxo

    • Property svn:eol-style set to native
  • code/trunk/doc/api/doxy.config.in

    r7818 r8351  
    626626EXCLUDE                = @CMAKE_SOURCE_DIR@/src/external/bullet/ \
    627627                         @CMAKE_SOURCE_DIR@/src/external/cpptcl/ \
    628                          @CMAKE_SOURCE_DIR@/src/external/ceguilua/ceguilua-0.5.0 \
    629                          @CMAKE_SOURCE_DIR@/src/external/ceguilua/ceguilua-0.6.0 \
    630                          @CMAKE_SOURCE_DIR@/src/external/ceguilua/ceguilua-0.6.1 \
    631628                         @CMAKE_SOURCE_DIR@/src/libraries/core/command/IOConsoleWindows.h \
    632629                         @CMAKE_SOURCE_DIR@/src/libraries/core/command/IOConsoleWindows.cc \
  • code/trunk/doc/api/groups/Notifications.dox

    • Property svn:eol-style set to native
  • code/trunk/doc/api/groups/Pickup.dox

    • Property svn:eol-style set to native
  • code/trunk/doc/api/groups/Questsystem.dox

    • Property svn:eol-style set to native
  • code/trunk/doc/api/groups/Triggers.dox

    • Property svn:eol-style set to native
  • code/trunk/src/CMakeLists.txt

    r8079 r8351  
    3737ADD_COMPILER_FLAGS("-DPOCO_NO_AUTOMATIC_LIBS")
    3838
    39 # If no defines are specified, these libs get linked statically
    40 ADD_COMPILER_FLAGS("-DBOOST_ALL_DYN_LINK" WIN32 LINK_BOOST_DYNAMIC)
    41 #ADD_COMPILER_FLAGS("-DENET_DLL"           WIN32 LINK_ENET_DYNAMIC)
    42 ADD_COMPILER_FLAGS("-DLUA_BUILD_AS_DLL"   WIN32 LINK_LUA_DYNAMIC)
    43 ADD_COMPILER_FLAGS("-DZLIB_DLL"           WIN32 LINK_ZLIB_DYNAMIC)
    44 # If no defines are specified, these libs get linked dynamically
    45 ADD_COMPILER_FLAGS("-DCEGUI_STATIC"       WIN32 NOT LINK_CEGUI_DYNAMIC)
    46 ADD_COMPILER_FLAGS("-DOGRE_STATIC_LIB"    WIN32 NOT LINK_OGRE_DYNAMIC)
    47 ADD_COMPILER_FLAGS("-DSTATIC_BUILD"       WIN32 NOT LINK_TCL_DYNAMIC)
     39IF(WIN32)
     40  # If no defines are specified, these libs get linked statically
     41  ADD_COMPILER_FLAGS("-DBOOST_ALL_DYN_LINK" LINK_BOOST_DYNAMIC)
     42  #ADD_COMPILER_FLAGS("-DENET_DLL"           LINK_ENET_DYNAMIC)
     43  ADD_COMPILER_FLAGS("-DLUA_BUILD_AS_DLL"   LINK_LUA5.1_DYNAMIC)
     44  # If no defines are specified, these libs get linked dynamically
     45  ADD_COMPILER_FLAGS("-DCEGUI_STATIC -DTOLUA_STATIC" NOT LINK_CEGUI_DYNAMIC)
     46  ADD_COMPILER_FLAGS("-DOGRE_STATIC_LIB"    NOT LINK_OGRE_DYNAMIC)
     47  ADD_COMPILER_FLAGS("-DSTATIC_BUILD"       NOT LINK_TCL_DYNAMIC)
     48
     49  # Target Windows XP as minimum Windows version
     50  # And try to catch all the different macro defines for that...
     51  ADD_COMPILER_FLAGS("-D_WIN32_WINNT=0x0501")
     52  ADD_COMPILER_FLAGS("-D_WIN32_WINDOWS=0x0501")
     53  ADD_COMPILER_FLAGS("-DWINVER=0x0501")
     54  ADD_COMPILER_FLAGS("-DNTDDI_VERSION=0x05010000")
     55ENDIF(WIN32)
    4856
    4957######### Library Behaviour (external) ##########
     
    6169ENDIF()
    6270# If no defines are specified, these libs get linked dynamically
    63 ADD_COMPILER_FLAGS("-DCEGUILUA_STATIC"             WIN32 NOT _external_shared_link)
    6471ADD_COMPILER_FLAGS("-DENET_DLL"                    WIN32     _external_shared_link)
    6572ADD_COMPILER_FLAGS("-DOGRE_GUIRENDERER_STATIC_LIB" WIN32 NOT _external_shared_link)
    6673ADD_COMPILER_FLAGS("-DOIS_STATIC_LIB"              WIN32 NOT _external_shared_link)
    67 ADD_COMPILER_FLAGS("-DTOLUA_STATIC_BUILD"          WIN32 NOT _external_shared_link)
    6874
    6975############## Include Directories ##############
     
    7177# Set the search paths for include files
    7278INCLUDE_DIRECTORIES(
     79  # OrxonoxConfig.h
     80  ${CMAKE_CURRENT_BINARY_DIR}
     81
     82  # All includes in "externals" should be prefixed with the path
     83  # relative to "external" to avoid conflicts
     84  ${CMAKE_CURRENT_SOURCE_DIR}/external
     85  # Include directories needed even if only included by Orxonox
     86  ${CMAKE_CURRENT_SOURCE_DIR}/external/bullet
     87  ${CMAKE_CURRENT_SOURCE_DIR}/external/ois
     88
    7389  # External
    7490  ${OGRE_INCLUDE_DIR}
    7591  ${CEGUI_INCLUDE_DIR}
     92  ${CEGUI_TOLUA_INCLUDE_DIR}
    7693  #${ENET_INCLUDE_DIR}
    7794  ${Boost_INCLUDE_DIRS}
     
    8198  ${VORBIS_INCLUDE_DIR}
    8299  ${OGG_INCLUDE_DIR}
    83   ${LUA_INCLUDE_DIR}
     100  ${LUA5.1_INCLUDE_DIR}
    84101  ${TCL_INCLUDE_PATH}
    85102  ${DIRECTX_INCLUDE_DIR}
    86103  ${ZLIB_INCLUDE_DIR}
    87 
    88   # All includes in "externals" should be prefixed with the path
    89   # relative to "external" to avoid conflicts
    90   ${CMAKE_CURRENT_SOURCE_DIR}/external
    91   # Include directories needed even if only included by Orxonox
    92   ${CMAKE_CURRENT_SOURCE_DIR}/external/bullet
    93   ${CMAKE_CURRENT_SOURCE_DIR}/external/ois
    94 
    95   # OrxonoxConfig.h
    96   ${CMAKE_CURRENT_BINARY_DIR}
    97104)
    98105
    99 IF(CEGUILUA_USE_INTERNAL_LIBRARY)
    100   INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/external/ceguilua/ceguilua-${CEGUI_VERSION})
     106IF(CEGUI_OLD_VERSION)
     107  INCLUDE_DIRECTORIES(${CEGUILUA_INCLUDE_DIR})
    101108ENDIF()
    102109
    103110IF (DBGHELP_FOUND)
    104111  INCLUDE_DIRECTORIES(${DBGHELP_INCLUDE_DIR})
     112ENDIF()
     113
     114############## CEGUI OGRE Renderer ##############
     115
     116IF(CEGUI_OGRE_RENDERER_BUILD_REQUIRED)
     117  SET(CEGUI_OGRE_RENDERER_LIBRARY ogreceguirenderer_orxonox)
    105118ENDIF()
    106119
     
    132145IF(ORXONOX_USE_WINMAIN)
    133146  SET(ORXONOX_WIN32 WIN32)
     147ENDIF()
     148
     149SET(ORXONOX_MAIN_FILES Orxonox.cc)
     150
     151# Add special source file for OS X
     152IF(APPLE)
     153  LIST(APPEND ORXONOX_MAIN_FILES OrxonoxMac.mm)
    134154ENDIF()
    135155
     
    140160    orxonox
    141161  SOURCE_FILES
    142     Orxonox.cc
     162    ${ORXONOX_MAIN_FILES}
    143163  OUTPUT_NAME orxonox
    144164)
     
    165185    SET(MSVC_PLATFORM "Win32")
    166186  ENDIF()
    167   STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?) .*$" "\\1"
    168          VISUAL_STUDIO_VERSION_SIMPLE "${CMAKE_GENERATOR}")
    169   CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/orxonox-main.vcproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/orxonox-main.vcproj.user")
     187  IF(MSVC10)
     188    CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/orxonox-main.vcxproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/orxonox-main.vcxproj.user")
     189  ELSE()
     190    STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?).*$" "\\1"
     191           VISUAL_STUDIO_VERSION_SIMPLE "${CMAKE_GENERATOR}")
     192    CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/orxonox-main.vcproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/orxonox-main.vcproj.user")
     193  ENDIF()
    170194ENDIF(MSVC)
     195
     196# Apple Mac OS X specific build settings
     197IF(APPLE)
     198  # On Apple we need to link to AppKit and Foundation frameworks
     199  TARGET_LINK_LIBRARIES(orxonox-main
     200    "-framework AppKit"
     201    "-framework Foundation"
     202  )
     203
     204  # Post-build step for the creation of the Dev-App bundle
     205  INCLUDE(PrepareDevBundle)
     206  ADD_CUSTOM_COMMAND(
     207    TARGET orxonox-main
     208    POST_BUILD
     209    # Copy the executable into the Orxonox.app
     210    COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${ORXONOX_EXECUTABLE_NAME}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.app/Contents/MacOS"
     211    # Copy the dev-build marker file to Orxonox.app
     212    COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/orxonox_dev_build.keep_me" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.app/Contents/MacOS"
     213    # Create a shortcut of the application to the root of the build tree
     214    COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.app" "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app"
     215  )
     216ENDIF(APPLE)
    171217
    172218#################### Doxygen ####################
  • code/trunk/src/Orxonox.cc

    r6417 r8351  
    5353#ifdef ORXONOX_USE_WINMAIN
    5454INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT)
     55#elif defined(ORXONOX_PLATFORM_APPLE)
     56int main_mac(int argc, char** argv)
    5557#else
    5658int main(int argc, char** argv)
     
    6062    {
    6163#ifndef ORXONOX_USE_WINMAIN
     64
     65#ifdef ORXONOX_PLATFORM_APPLE
     66        // On Apples, the kernel supplies a second argument, which we have to circumvent
     67        const int firstArgument = 2;
     68#else
     69        // 0 is the execution path
     70        const int firstArgument = 1;
     71#endif
     72   
    6273        std::string strCmdLine;
    63         for (int i = 1; i < argc; ++i)
     74        for (int i = firstArgument; i < argc; ++i)
    6475            strCmdLine = strCmdLine + argv[i] + ' ';
    6576#endif
  • code/trunk/src/OrxonoxConfig.cmake

    r7818 r8351  
    2828#################### Options ####################
    2929
    30 # Use, i.e. don't skip the full RPATH for the build tree
    31 SET(CMAKE_SKIP_BUILD_RPATH  FALSE)
    32 
    3330# Global switch to disable Precompiled Header Files
    34 IF(PCH_COMPILER_SUPPORT)
     31# Note: PCH temporarily disabled on Mac because of severe problems
     32IF(PCH_COMPILER_SUPPORT AND NOT APPLE)
    3533  OPTION(PCH_ENABLE "Global PCH switch" TRUE)
    3634ENDIF()
     
    5351ENDIF()
    5452
    55 # 32/64 bit system check
    56 IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
    57   SET(ORXONOX_ARCH_64 TRUE)
    58 ELSE()
    59   SET(ORXONOX_ARCH_32 TRUE)
    60 ENDIF()
    61 
    6253# Platforms
    6354SET(ORXONOX_PLATFORM_WINDOWS ${WIN32})
    64 SET(ORXONOX_PLATFORM_APPLE ${APPLE})
    65 SET(ORXONOX_PLATFORM_UNIX ${UNIX})
    66 IF(UNIX AND NOT APPLE)
    67   SET(ORXONOX_PLATFORM_LINUX TRUE)
    68 ENDIF()
     55SET(ORXONOX_PLATFORM_APPLE   ${APPLE})
     56SET(ORXONOX_PLATFORM_UNIX    ${UNIX})
     57SET(ORXONOX_PLATFORM_LINUX   ${LINUX})
    6958
    7059# Check __forceinline
     
    7564ENDIF(MSVC)
    7665
    77 # Check iso646.h include (literal operators)
     66# Check some non standard system includes
    7867INCLUDE(CheckIncludeFileCXX)
    7968CHECK_INCLUDE_FILE_CXX(iso646.h HAVE_ISO646_H)
     69CHECK_INCLUDE_FILE_CXX(stdint.h HAVE_STDINT_H)
     70
     71# Part of a woraround for OS X warnings. See OrxonoxConfig.h.in
     72SET(ORX_HAVE_STDINT_H ${HAVE_STDINT_H})
    8073
    8174IF(MSVC)
     
    10699
    107100SET(ORXONOX_CONFIG_FILES
    108   ${CMAKE_CURRENT_BINARY_DIR}/OrxonoxConfig.h
    109101  ${CMAKE_CURRENT_SOURCE_DIR}/OrxonoxConfig.h.in
    110   ${CMAKE_CURRENT_BINARY_DIR}/SpecialConfig.h
    111102  ${CMAKE_CURRENT_SOURCE_DIR}/SpecialConfig.h.in
    112103)
     104SET(ORXONOX_CONFIG_FILES_GENERATED
     105  ${CMAKE_CURRENT_BINARY_DIR}/OrxonoxConfig.h
     106  ${CMAKE_CURRENT_BINARY_DIR}/SpecialConfig.h
     107)
     108
     109# Make special target including the configured header files for Visual Studio
     110IF(MSVC)
     111  ADD_CUSTOM_TARGET(config
     112    SOURCES
     113      ${ORXONOX_CONFIG_FILES}
     114      ${ORXONOX_CONFIG_FILES_GENERATED}
     115  )
     116ENDIF()
  • code/trunk/src/OrxonoxConfig.h.in

    r7818 r8351  
    8080
    8181// Architecture
    82 #cmakedefine ORXONOX_ARCH_32
    83 #cmakedefine ORXONOX_ARCH_64
     82#if defined(__x86_64__) || defined(_M_X64) || defined(__powerpc64__) || defined(__alpha__) || defined(__ia64__) || defined(__s390__) || defined(__s390x__)
     83#   define ORXONOX_ARCH_64
     84#else
     85#   define ORXONOX_ARCH_32
     86#endif
    8487
    8588// See if we can use __forceinline or if we need to use __inline instead
    8689#cmakedefine HAVE_FORCEINLINE
    87 #ifndef FORCEINLINE
     90#ifndef ORX_FORCEINLINE
    8891#  ifdef HAVE_FORCEINLINE
    89 #    define FORCEINLINE __forceinline
     92#    define ORX_FORCEINLINE __forceinline
    9093#  else
    91 #    define FORCEINLINE __inline
     94#    define ORX_FORCEINLINE __inline
    9295#  endif
    9396#endif
     
    158161#endif
    159162
    160 #cmakedefine HAVE_STDINT_H
    161 #ifdef HAVE_STDINT_H
     163// On OS X some headers already define HAVE_STDINT_H and that spits out
     164// some warnings. Therefore we use this macro.
     165// Note: This requires some extra code in OrxonoxConfig.cmake
     166#cmakedefine ORX_HAVE_STDINT_H
     167#ifdef ORX_HAVE_STDINT_H
    162168#  include <stdint.h>
    163169#elif defined(ORXONOX_COMPILER_MSVC)
     
    222228}
    223229
     230// Define Boost Filesystem version
     231#include <boost/version.hpp>
     232#ifndef BOOST_FILESYSTEM_VERSION
     233#  if (BOOST_VERSION < 104600)
     234#    define BOOST_FILESYSTEM_VERSION 2
     235#  else
     236#    define BOOST_FILESYSTEM_VERSION 3
     237#  endif
     238#endif
     239
    224240#endif /* _OrxonoxConfig_H__ */
  • code/trunk/src/SpecialConfig.h.in

    r7818 r8351  
    4242#include "OrxonoxConfig.h"
    4343
    44 #cmakedefine CEGUILUA_USE_INTERNAL_LIBRARY  ///< Set whether we must suffix "ceguilua/" for the CEGUILua.h include
    45 
    4644#cmakedefine DEPENDENCY_PACKAGE_ENABLE      ///< Defined if a precompiled depdency package was used. We then copy all libraries too when installing.
    4745
     
    6967#ifndef INSTALL_COPYABLE
    7068    // INSTALLATION PATHS
    71     const char dataInstallDirectory[]       = "@DATA_INSTALL_DIRECTORY@";
    72     const char moduleInstallDirectory[]     = "@MODULE_INSTALL_DIRECTORY@";
     69    const char dataInstallDirectory[]       = "@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIRECTORY@";
     70    const char moduleInstallDirectory[]     = "@CMAKE_INSTALL_PREFIX@/@MODULE_INSTALL_DIRECTORY@";
    7371#endif
    7472
     
    9694#ifdef NDEBUG
    9795    const char ogrePlugins[] = "@OGRE_PLUGINS_RELEASE@";
    98 #  ifdef DEPENDENCY_PACKAGE_ENABLE
    99     const char ogrePluginsDirectory[] = ".";
    100 #  else
    10196    const char ogrePluginsDirectory[] = "@OGRE_PLUGINS_FOLDER_RELEASE@";
    102 #  endif
    10397#else
    10498    const char ogrePlugins[] = "@OGRE_PLUGINS_DEBUG@";
    105 #  ifdef DEPENDENCY_PACKAGE_ENABLE
    106     const char ogrePluginsDirectory[] = ".";
    107 #  else
    10899    const char ogrePluginsDirectory[] = "@OGRE_PLUGINS_FOLDER_DEBUG@";
    109 #  endif
    110100#endif
    111101} }
  • code/trunk/src/external/CMakeLists.txt

    r7459 r8351  
    2121
    2222ADD_SUBDIRECTORY(tolua)
    23 
    24 # Include CEGUILua if not requested otherwise
    25 IF(CEGUILUA_USE_INTERNAL_LIBRARY)
    26   IF(NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ceguilua/ceguilua-${CEGUI_VERSION})
    27     MESSAGE(FATAL_ERROR "CEGUILua version not found in src folder. Update list of supported versions in LibraryConfig.cmake!")
    28   ENDIF()
    29 
    30   ADD_SUBDIRECTORY(ceguilua)
    31   SET(CEGUILUA_LIBRARY ${CEGUILUA_LIBRARY} PARENT_SCOPE)
    32 ENDIF()
    33 
    3423ADD_SUBDIRECTORY(bullet)
    3524ADD_SUBDIRECTORY(cpptcl)
    3625ADD_SUBDIRECTORY(enet)
    3726ADD_SUBDIRECTORY(loki)
    38 ADD_SUBDIRECTORY(ogreceguirenderer)
     27IF(CEGUI_OGRE_RENDERER_BUILD_REQUIRED)
     28  ADD_SUBDIRECTORY(ogreceguirenderer)
     29ENDIF()
    3930ADD_SUBDIRECTORY(ois)
    4031ADD_SUBDIRECTORY(tinyxml)
  • code/trunk/src/external/bullet/Bullet-C-Api.h

    r5781 r8351  
    148148        extern  void plSetOrientation(plRigidBodyHandle object, const plQuaternion orientation);
    149149        extern  void plSetEuler(plReal yaw,plReal pitch,plReal roll, plQuaternion orient);
     150        extern  void plSetOpenGLMatrix(plRigidBodyHandle object, plReal* matrix);
    150151
    151152        typedef struct plRayCastResult {
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btAxisSweep3.h

    r5781 r8351  
    151151       
    152152        virtual void    rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0), const btVector3& aabbMax = btVector3(0,0,0));
     153        virtual void    aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback);
     154
    153155       
    154156        void quantize(BP_FP_INT_TYPE* out, const btVector3& point, int isMax) const;
     
    281283                        {
    282284                                rayCallback.process(getHandle(m_pEdges[axis][i].m_handle));
     285                        }
     286                }
     287        }
     288}
     289
     290template <typename BP_FP_INT_TYPE>
     291void    btAxisSweep3Internal<BP_FP_INT_TYPE>::aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback)
     292{
     293        if (m_raycastAccelerator)
     294        {
     295                m_raycastAccelerator->aabbTest(aabbMin,aabbMax,callback);
     296        } else
     297        {
     298                //choose axis?
     299                BP_FP_INT_TYPE axis = 0;
     300                //for each proxy
     301                for (BP_FP_INT_TYPE i=1;i<m_numHandles*2+1;i++)
     302                {
     303                        if (m_pEdges[axis][i].IsMax())
     304                        {
     305                                Handle* handle = getHandle(m_pEdges[axis][i].m_handle);
     306                                if (TestAabbAgainstAabb2(aabbMin,aabbMax,handle->m_aabbMin,handle->m_aabbMax))
     307                                {
     308                                        callback.process(handle);
     309                                }
    283310                        }
    284311                }
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h

    r5781 r8351  
    2727
    2828
    29 struct  btBroadphaseRayCallback
     29struct  btBroadphaseAabbCallback
     30{
     31        virtual ~btBroadphaseAabbCallback() {}
     32        virtual bool    process(const btBroadphaseProxy* proxy) = 0;
     33};
     34
     35
     36struct  btBroadphaseRayCallback : public btBroadphaseAabbCallback
    3037{
    3138        ///added some cached data to accelerate ray-AABB tests
     
    3542
    3643        virtual ~btBroadphaseRayCallback() {}
    37         virtual bool    process(const btBroadphaseProxy* proxy) = 0;
    3844};
    3945
     
    5561        virtual void    rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0), const btVector3& aabbMax = btVector3(0,0,0)) = 0;
    5662
     63        virtual void    aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback) = 0;
     64
    5765        ///calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb
    5866        virtual void    calculateOverlappingPairs(btDispatcher* dispatcher)=0;
     
    6674
    6775        ///reset broadphase internal structures, to ensure determinism/reproducability
    68         virtual void resetPool(btDispatcher* dispatcher) {};
     76        virtual void resetPool(btDispatcher* dispatcher) { (void) dispatcher; };
    6977
    7078        virtual void    printStats() = 0;
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h

    r5781 r8351  
    4747        MINKOWSKI_SUM_SHAPE_PROXYTYPE,
    4848        MINKOWSKI_DIFFERENCE_SHAPE_PROXYTYPE,
     49        BOX_2D_SHAPE_PROXYTYPE,
     50        CONVEX_2D_SHAPE_PROXYTYPE,
    4951        CUSTOM_CONVEX_SHAPE_TYPE,
    5052//concave shapes
     
    140142        }
    141143
     144        static SIMD_FORCE_INLINE bool   isNonMoving(int proxyType)
     145        {
     146                return (isConcave(proxyType) && !(proxyType==GIMPACT_SHAPE_PROXYTYPE));
     147        }
     148
    142149        static SIMD_FORCE_INLINE bool   isConcave(int proxyType)
    143150        {
     
    149156                return (proxyType == COMPOUND_SHAPE_PROXYTYPE);
    150157        }
     158
     159        static SIMD_FORCE_INLINE bool   isSoftBody(int proxyType)
     160        {
     161                return (proxyType == SOFTBODY_SHAPE_PROXYTYPE);
     162        }
     163
    151164        static SIMD_FORCE_INLINE bool isInfinite(int proxyType)
    152165        {
    153166                return (proxyType == STATIC_PLANE_PROXYTYPE);
    154167        }
     168
     169        static SIMD_FORCE_INLINE bool isConvex2d(int proxyType)
     170        {
     171                return (proxyType == BOX_2D_SHAPE_PROXYTYPE) || (proxyType == CONVEX_2D_SHAPE_PROXYTYPE);
     172        }
     173
    155174       
    156175}
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btDbvt.cpp

    r5781 r8351  
    6262        {
    6363                getmaxdepth(node->childs[0],depth+1,maxdepth);
    64                 getmaxdepth(node->childs[0],depth+1,maxdepth);
     64                getmaxdepth(node->childs[1],depth+1,maxdepth);
    6565        } else maxdepth=btMax(maxdepth,depth);
    6666}
     
    239239        for(int i=0,ni=leaves.size();i<ni;++i)
    240240        {
    241                 if(dot(axis,leaves[i]->volume.Center()-org)<0)
     241                if(btDot(axis,leaves[i]->volume.Center()-org)<0)
    242242                        left.push_back(leaves[i]);
    243243                else
     
    320320                                for(int j=0;j<3;++j)
    321321                                {
    322                                         ++splitcount[j][dot(x,axis[j])>0?1:0];
     322                                        ++splitcount[j][btDot(x,axis[j])>0?1:0];
    323323                                }
    324324                        }
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btDbvt.h

    r5781 r8351  
    3333
    3434// Template implementation of ICollide
    35 #ifdef WIN32
     35#ifdef _WIN32
    3636#if (defined (_MSC_VER) && _MSC_VER >= 1400)
    3737#define DBVT_USE_TEMPLATE               1
     
    5858
    5959//SSE gives errors on a MSVC 7.1
    60 #ifdef BT_USE_SSE
     60#if defined (BT_USE_SSE) && defined (_WIN32)
    6161#define DBVT_SELECT_IMPL                DBVT_IMPL_SSE
    6262#define DBVT_MERGE_IMPL                 DBVT_IMPL_SSE
     
    9393
    9494#if DBVT_USE_MEMMOVE
    95 #ifndef __CELLOS_LV2__
     95#if !defined( __CELLOS_LV2__) && !defined(__MWERKS__)
    9696#include <memory.h>
    9797#endif
     
    485485                pi=btVector3(mi.x(),mi.y(),mi.z());break;
    486486        }
    487         if((dot(n,px)+o)<0)             return(-1);
    488         if((dot(n,pi)+o)>=0)    return(+1);
     487        if((btDot(n,px)+o)<0)           return(-1);
     488        if((btDot(n,pi)+o)>=0)  return(+1);
    489489        return(0);
    490490}
     
    497497                b[(signs>>1)&1]->y(),
    498498                b[(signs>>2)&1]->z());
    499         return(dot(p,v));
     499        return(btDot(p,v));
    500500}
    501501
     
    948948                                                                DBVT_IPOLICY) const
    949949{
     950        (void) rayTo;
    950951        DBVT_CHECKTYPE
    951952        if(root)
     
    962963                {
    963964                        const btDbvtNode*       node=stack[--depth];
    964                         bounds[0] = node->volume.Mins()+aabbMin;
    965                         bounds[1] = node->volume.Maxs()+aabbMax;
     965                        bounds[0] = node->volume.Mins()-aabbMax;
     966                        bounds[1] = node->volume.Maxs()-aabbMin;
    966967                        btScalar tmin=1.f,lambda_min=0.f;
    967968                        unsigned int result1=false;
     
    10011002                        rayDir.normalize ();
    10021003
    1003                         ///what about division by zero? --> just set rayDirection[i] to INF/1e30
     1004                        ///what about division by zero? --> just set rayDirection[i] to INF/BT_LARGE_FLOAT
    10041005                        btVector3 rayDirectionInverse;
    1005                         rayDirectionInverse[0] = rayDir[0] == btScalar(0.0) ? btScalar(1e30) : btScalar(1.0) / rayDir[0];
    1006                         rayDirectionInverse[1] = rayDir[1] == btScalar(0.0) ? btScalar(1e30) : btScalar(1.0) / rayDir[1];
    1007                         rayDirectionInverse[2] = rayDir[2] == btScalar(0.0) ? btScalar(1e30) : btScalar(1.0) / rayDir[2];
     1006                        rayDirectionInverse[0] = rayDir[0] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[0];
     1007                        rayDirectionInverse[1] = rayDir[1] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[1];
     1008                        rayDirectionInverse[2] = rayDir[2] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[2];
    10081009                        unsigned int signs[3] = { rayDirectionInverse[0] < 0.0, rayDirectionInverse[1] < 0.0, rayDirectionInverse[2] < 0.0};
    10091010
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp

    r5781 r8351  
    11/*
    22Bullet Continuous Collision Detection and Physics Library
    3 Copyright (c) 2003-2007 Erwin Coumans  http://continuousphysics.com/Bullet/
     3Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
    44
    55This software is provided 'as-is', without any express or implied warranty.
     
    13133. This notice may not be removed or altered from any source distribution.
    1414*/
     15
    1516///btDbvtBroadphase implementation by Nathanael Presson
    1617
     
    124125        m_needcleanup           =       true;
    125126        m_releasepaircache      =       (paircache!=0)?false:true;
    126         m_prediction            =       1/(btScalar)2;
     127        m_prediction            =       0;
    127128        m_stageCurrent          =       0;
    128129        m_fixedleft                     =       0;
     
    250251}
    251252
     253
     254struct  BroadphaseAabbTester : btDbvt::ICollide
     255{
     256        btBroadphaseAabbCallback& m_aabbCallback;
     257        BroadphaseAabbTester(btBroadphaseAabbCallback& orgCallback)
     258                :m_aabbCallback(orgCallback)
     259        {
     260        }
     261        void                                    Process(const btDbvtNode* leaf)
     262        {
     263                btDbvtProxy*    proxy=(btDbvtProxy*)leaf->data;
     264                m_aabbCallback.process(proxy);
     265        }
     266};     
     267
     268void    btDbvtBroadphase::aabbTest(const btVector3& aabbMin,const btVector3& aabbMax,btBroadphaseAabbCallback& aabbCallback)
     269{
     270        BroadphaseAabbTester callback(aabbCallback);
     271
     272        const ATTRIBUTE_ALIGNED16(btDbvtVolume) bounds=btDbvtVolume::FromMM(aabbMin,aabbMax);
     273                //process all children, that overlap with  the given AABB bounds
     274        m_sets[0].collideTV(m_sets[0].m_root,bounds,callback);
     275        m_sets[1].collideTV(m_sets[1].m_root,bounds,callback);
     276
     277}
     278
     279
     280
    252281//
    253282void                                                    btDbvtBroadphase::setAabb(              btBroadphaseProxy* absproxy,
     
    315344                }       
    316345        }
     346}
     347
     348
     349//
     350void                                                    btDbvtBroadphase::setAabbForceUpdate(           btBroadphaseProxy* absproxy,
     351                                                                                                                  const btVector3& aabbMin,
     352                                                                                                                  const btVector3& aabbMax,
     353                                                                                                                  btDispatcher* /*dispatcher*/)
     354{
     355        btDbvtProxy*                                            proxy=(btDbvtProxy*)absproxy;
     356        ATTRIBUTE_ALIGNED16(btDbvtVolume)       aabb=btDbvtVolume::FromMM(aabbMin,aabbMax);
     357        bool    docollide=false;
     358        if(proxy->stage==STAGECOUNT)
     359        {/* fixed -> dynamic set        */
     360                m_sets[1].remove(proxy->leaf);
     361                proxy->leaf=m_sets[0].insert(aabb,proxy);
     362                docollide=true;
     363        }
     364        else
     365        {/* dynamic set                         */
     366                ++m_updates_call;
     367                /* Teleporting                  */
     368                m_sets[0].update(proxy->leaf,aabb);
     369                ++m_updates_done;
     370                docollide=true;
     371        }
     372        listremove(proxy,m_stageRoots[proxy->stage]);
     373        proxy->m_aabbMin = aabbMin;
     374        proxy->m_aabbMax = aabbMax;
     375        proxy->stage    =       m_stageCurrent;
     376        listappend(proxy,m_stageRoots[m_stageCurrent]);
     377        if(docollide)
     378        {
     379                m_needcleanup=true;
     380                if(!m_deferedcollide)
     381                {
     382                        btDbvtTreeCollider      collider(this);
     383                        m_sets[1].collideTTpersistentStack(m_sets[1].m_root,proxy->leaf,collider);
     384                        m_sets[0].collideTTpersistentStack(m_sets[0].m_root,proxy->leaf,collider);
     385                }
     386        }       
    317387}
    318388
     
    572642                m_deferedcollide        =       false;
    573643                m_needcleanup           =       true;
    574                 m_prediction            =       1/(btScalar)2;
    575644                m_stageCurrent          =       0;
    576645                m_fixedleft                     =       0;
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btDbvtBroadphase.h

    r5781 r8351  
    11/*
    22Bullet Continuous Collision Detection and Physics Library
    3 Copyright (c) 2003-2007 Erwin Coumans  http://continuousphysics.com/Bullet/
     3Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
    44
    55This software is provided 'as-is', without any express or implied warranty.
     
    13133. This notice may not be removed or altered from any source distribution.
    1414*/
     15
    1516///btDbvtBroadphase implementation by Nathanael Presson
    1617#ifndef BT_DBVT_BROADPHASE_H
     
    102103        void                                                    collide(btDispatcher* dispatcher);
    103104        void                                                    optimize();
    104         /* btBroadphaseInterface Implementation */
     105       
     106        /* btBroadphaseInterface Implementation */
    105107        btBroadphaseProxy*                              createProxy(const btVector3& aabbMin,const btVector3& aabbMax,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy);
    106         void                                                    destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
    107         void                                                    setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher);
    108         virtual void    rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0), const btVector3& aabbMax = btVector3(0,0,0));
     108        virtual void                                    destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
     109        virtual void                                    setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher);
     110        virtual void                                    rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0), const btVector3& aabbMax = btVector3(0,0,0));
     111        virtual void                                    aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback);
    109112
    110         virtual void    getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;
    111         void                                                    calculateOverlappingPairs(btDispatcher* dispatcher);
    112         btOverlappingPairCache*                 getOverlappingPairCache();
    113         const btOverlappingPairCache*   getOverlappingPairCache() const;
    114         void                                                    getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const;
    115         void                                                    printStats();
    116         static void                                             benchmark(btBroadphaseInterface*);
     113        virtual void                                    getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;
     114        virtual void                                    calculateOverlappingPairs(btDispatcher* dispatcher);
     115        virtual btOverlappingPairCache* getOverlappingPairCache();
     116        virtual const btOverlappingPairCache*   getOverlappingPairCache() const;
     117        virtual void                                    getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const;
     118        virtual void                                    printStats();
    117119
    118 
    119         void    performDeferredRemoval(btDispatcher* dispatcher);
    120120
    121121        ///reset broadphase internal structures, to ensure determinism/reproducability
    122122        virtual void resetPool(btDispatcher* dispatcher);
    123123
     124        void    performDeferredRemoval(btDispatcher* dispatcher);
     125       
     126        void    setVelocityPrediction(btScalar prediction)
     127        {
     128                m_prediction = prediction;
     129        }
     130        btScalar getVelocityPrediction() const
     131        {
     132                return m_prediction;
     133        }
     134
     135        ///this setAabbForceUpdate is similar to setAabb but always forces the aabb update.
     136        ///it is not part of the btBroadphaseInterface but specific to btDbvtBroadphase.
     137        ///it bypasses certain optimizations that prevent aabb updates (when the aabb shrinks), see
     138        ///http://code.google.com/p/bullet/issues/detail?id=223
     139        void                                                    setAabbForceUpdate(             btBroadphaseProxy* absproxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* /*dispatcher*/);
     140
     141        static void                                             benchmark(btBroadphaseInterface*);
     142
     143
    124144};
    125145
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btDispatcher.h

    r5781 r8351  
    4747                m_useEpa(true),
    4848                m_allowedCcdPenetration(btScalar(0.04)),
    49                 m_useConvexConservativeDistanceUtil(true),
     49                m_useConvexConservativeDistanceUtil(false),
    5050                m_convexConservativeDistanceThreshold(0.0f),
     51                m_convexMaxDistanceUseCPT(false),
    5152                m_stackAllocator(0)
    5253        {
     
    6566        bool            m_useConvexConservativeDistanceUtil;
    6667        btScalar        m_convexConservativeDistanceThreshold;
     68        bool            m_convexMaxDistanceUseCPT;
    6769        btStackAlloc*   m_stackAllocator;
    6870};
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h

    r5781 r8351  
    134134        virtual void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const
    135135        {
    136                 aabbMin.setValue(-1e30f,-1e30f,-1e30f);
    137                 aabbMax.setValue(1e30f,1e30f,1e30f);
     136                aabbMin.setValue(-BT_LARGE_FLOAT,-BT_LARGE_FLOAT,-BT_LARGE_FLOAT);
     137                aabbMax.setValue(BT_LARGE_FLOAT,BT_LARGE_FLOAT,BT_LARGE_FLOAT);
    138138        }
    139139
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp

    r5781 r8351  
    241241        int count = m_overlappingPairArray.size();
    242242        int oldCapacity = m_overlappingPairArray.capacity();
    243         void* mem = &m_overlappingPairArray.expand();
     243        void* mem = &m_overlappingPairArray.expandNonInitializing();
    244244
    245245        //this is where we add an actual pair, so also call the 'ghost'
     
    468468                return 0;
    469469       
    470         void* mem = &m_overlappingPairArray.expand();
     470        void* mem = &m_overlappingPairArray.expandNonInitializing();
    471471        btBroadphasePair* pair = new (mem) btBroadphasePair(*proxy0,*proxy1);
    472472       
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h

    r5781 r8351  
    458458        virtual void    sortOverlappingPairs(btDispatcher* dispatcher)
    459459        {
     460        (void) dispatcher;
    460461        }
    461462
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp

    r5781 r8351  
    1818#include "LinearMath/btAabbUtil2.h"
    1919#include "LinearMath/btIDebugDraw.h"
     20#include "LinearMath/btSerializer.h"
    2021
    2122#define RAYAABB2
     
    7980btVector3 color[4]=
    8081{
    81         btVector3(255,0,0),
    82         btVector3(0,255,0),
    83         btVector3(0,0,255),
    84         btVector3(0,255,255)
     82        btVector3(1,0,0),
     83        btVector3(0,1,0),
     84        btVector3(0,0,1),
     85        btVector3(0,1,1)
    8586};
    8687#endif //DEBUG_PATCH_COLORS
     
    475476        ///what about division by zero? --> just set rayDirection[i] to 1.0
    476477        btVector3 rayDirectionInverse;
    477         rayDirectionInverse[0] = rayDir[0] == btScalar(0.0) ? btScalar(1e30) : btScalar(1.0) / rayDir[0];
    478         rayDirectionInverse[1] = rayDir[1] == btScalar(0.0) ? btScalar(1e30) : btScalar(1.0) / rayDir[1];
    479         rayDirectionInverse[2] = rayDir[2] == btScalar(0.0) ? btScalar(1e30) : btScalar(1.0) / rayDir[2];
     478        rayDirectionInverse[0] = rayDir[0] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[0];
     479        rayDirectionInverse[1] = rayDir[1] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[1];
     480        rayDirectionInverse[2] = rayDir[2] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[2];
    480481        unsigned int sign[3] = { rayDirectionInverse[0] < 0.0, rayDirectionInverse[1] < 0.0, rayDirectionInverse[2] < 0.0};
    481482#endif
     
    494495                bounds[1] = rootNode->m_aabbMaxOrg;
    495496                /* Add box cast extents */
    496                 bounds[0] += aabbMin;
    497                 bounds[1] += aabbMax;
     497                bounds[0] -= aabbMax;
     498                bounds[1] -= aabbMin;
    498499
    499500                aabbOverlap = TestAabbAgainstAabb2(rayAabbMin,rayAabbMax,rootNode->m_aabbMinOrg,rootNode->m_aabbMaxOrg);
     
    562563        lambda_max = rayDirection.dot(rayTarget-raySource);
    563564        ///what about division by zero? --> just set rayDirection[i] to 1.0
    564         rayDirection[0] = rayDirection[0] == btScalar(0.0) ? btScalar(1e30) : btScalar(1.0) / rayDirection[0];
    565         rayDirection[1] = rayDirection[1] == btScalar(0.0) ? btScalar(1e30) : btScalar(1.0) / rayDirection[1];
    566         rayDirection[2] = rayDirection[2] == btScalar(0.0) ? btScalar(1e30) : btScalar(1.0) / rayDirection[2];
     565        rayDirection[0] = rayDirection[0] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDirection[0];
     566        rayDirection[1] = rayDirection[1] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDirection[1];
     567        rayDirection[2] = rayDirection[2] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDirection[2];
    567568        unsigned int sign[3] = { rayDirection[0] < 0.0, rayDirection[1] < 0.0, rayDirection[2] < 0.0};
    568569#endif
     
    618619                        bounds[1] = unQuantize(rootNode->m_quantizedAabbMax);
    619620                        /* Add box cast extents */
    620                         bounds[0] += aabbMin;
    621                         bounds[1] += aabbMax;
     621                        bounds[0] -= aabbMax;
     622                        bounds[1] -= aabbMin;
    622623                        btVector3 normal;
    623624#if 0
     
    831832}
    832833
    833 unsigned btQuantizedBvh::calculateSerializeBufferSize()
     834unsigned btQuantizedBvh::calculateSerializeBufferSize() const
    834835{
    835836        unsigned baseSize = sizeof(btQuantizedBvh) + getAlignmentSerializationPadding();
     
    842843}
    843844
    844 bool btQuantizedBvh::serialize(void *o_alignedDataBuffer, unsigned /*i_dataBufferSize */, bool i_swapEndian)
     845bool btQuantizedBvh::serialize(void *o_alignedDataBuffer, unsigned /*i_dataBufferSize */, bool i_swapEndian) const
    845846{
    846847        btAssert(m_subtreeHeaderCount == m_SubtreeHeaders.size());
     
    11441145}
    11451146
    1146 
    1147 
    1148 
     1147void btQuantizedBvh::deSerializeFloat(struct btQuantizedBvhFloatData& quantizedBvhFloatData)
     1148{
     1149        m_bvhAabbMax.deSerializeFloat(quantizedBvhFloatData.m_bvhAabbMax);
     1150        m_bvhAabbMin.deSerializeFloat(quantizedBvhFloatData.m_bvhAabbMin);
     1151        m_bvhQuantization.deSerializeFloat(quantizedBvhFloatData.m_bvhQuantization);
     1152
     1153        m_curNodeIndex = quantizedBvhFloatData.m_curNodeIndex;
     1154        m_useQuantization = quantizedBvhFloatData.m_useQuantization!=0;
     1155       
     1156        {
     1157                int numElem = quantizedBvhFloatData.m_numContiguousLeafNodes;
     1158                m_contiguousNodes.resize(numElem);
     1159
     1160                if (numElem)
     1161                {
     1162                        btOptimizedBvhNodeFloatData* memPtr = quantizedBvhFloatData.m_contiguousNodesPtr;
     1163
     1164                        for (int i=0;i<numElem;i++,memPtr++)
     1165                        {
     1166                                m_contiguousNodes[i].m_aabbMaxOrg.deSerializeFloat(memPtr->m_aabbMaxOrg);
     1167                                m_contiguousNodes[i].m_aabbMinOrg.deSerializeFloat(memPtr->m_aabbMinOrg);
     1168                                m_contiguousNodes[i].m_escapeIndex = memPtr->m_escapeIndex;
     1169                                m_contiguousNodes[i].m_subPart = memPtr->m_subPart;
     1170                                m_contiguousNodes[i].m_triangleIndex = memPtr->m_triangleIndex;
     1171                        }
     1172                }
     1173        }
     1174
     1175        {
     1176                int numElem = quantizedBvhFloatData.m_numQuantizedContiguousNodes;
     1177                m_quantizedContiguousNodes.resize(numElem);
     1178               
     1179                if (numElem)
     1180                {
     1181                        btQuantizedBvhNodeData* memPtr = quantizedBvhFloatData.m_quantizedContiguousNodesPtr;
     1182                        for (int i=0;i<numElem;i++,memPtr++)
     1183                        {
     1184                                m_quantizedContiguousNodes[i].m_escapeIndexOrTriangleIndex = memPtr->m_escapeIndexOrTriangleIndex;
     1185                                m_quantizedContiguousNodes[i].m_quantizedAabbMax[0] = memPtr->m_quantizedAabbMax[0];
     1186                                m_quantizedContiguousNodes[i].m_quantizedAabbMax[1] = memPtr->m_quantizedAabbMax[1];
     1187                                m_quantizedContiguousNodes[i].m_quantizedAabbMax[2] = memPtr->m_quantizedAabbMax[2];
     1188                                m_quantizedContiguousNodes[i].m_quantizedAabbMin[0] = memPtr->m_quantizedAabbMin[0];
     1189                                m_quantizedContiguousNodes[i].m_quantizedAabbMin[1] = memPtr->m_quantizedAabbMin[1];
     1190                                m_quantizedContiguousNodes[i].m_quantizedAabbMin[2] = memPtr->m_quantizedAabbMin[2];
     1191                        }
     1192                }
     1193        }
     1194
     1195        m_traversalMode = btTraversalMode(quantizedBvhFloatData.m_traversalMode);
     1196       
     1197        {
     1198                int numElem = quantizedBvhFloatData.m_numSubtreeHeaders;
     1199                m_SubtreeHeaders.resize(numElem);
     1200                if (numElem)
     1201                {
     1202                        btBvhSubtreeInfoData* memPtr = quantizedBvhFloatData.m_subTreeInfoPtr;
     1203                        for (int i=0;i<numElem;i++,memPtr++)
     1204                        {
     1205                                m_SubtreeHeaders[i].m_quantizedAabbMax[0] = memPtr->m_quantizedAabbMax[0] ;
     1206                                m_SubtreeHeaders[i].m_quantizedAabbMax[1] = memPtr->m_quantizedAabbMax[1];
     1207                                m_SubtreeHeaders[i].m_quantizedAabbMax[2] = memPtr->m_quantizedAabbMax[2];
     1208                                m_SubtreeHeaders[i].m_quantizedAabbMin[0] = memPtr->m_quantizedAabbMin[0];
     1209                                m_SubtreeHeaders[i].m_quantizedAabbMin[1] = memPtr->m_quantizedAabbMin[1];
     1210                                m_SubtreeHeaders[i].m_quantizedAabbMin[2] = memPtr->m_quantizedAabbMin[2];
     1211                                m_SubtreeHeaders[i].m_rootNodeIndex = memPtr->m_rootNodeIndex;
     1212                                m_SubtreeHeaders[i].m_subtreeSize = memPtr->m_subtreeSize;
     1213                        }
     1214                }
     1215        }
     1216}
     1217
     1218void btQuantizedBvh::deSerializeDouble(struct btQuantizedBvhDoubleData& quantizedBvhDoubleData)
     1219{
     1220        m_bvhAabbMax.deSerializeDouble(quantizedBvhDoubleData.m_bvhAabbMax);
     1221        m_bvhAabbMin.deSerializeDouble(quantizedBvhDoubleData.m_bvhAabbMin);
     1222        m_bvhQuantization.deSerializeDouble(quantizedBvhDoubleData.m_bvhQuantization);
     1223
     1224        m_curNodeIndex = quantizedBvhDoubleData.m_curNodeIndex;
     1225        m_useQuantization = quantizedBvhDoubleData.m_useQuantization!=0;
     1226       
     1227        {
     1228                int numElem = quantizedBvhDoubleData.m_numContiguousLeafNodes;
     1229                m_contiguousNodes.resize(numElem);
     1230
     1231                if (numElem)
     1232                {
     1233                        btOptimizedBvhNodeDoubleData* memPtr = quantizedBvhDoubleData.m_contiguousNodesPtr;
     1234
     1235                        for (int i=0;i<numElem;i++,memPtr++)
     1236                        {
     1237                                m_contiguousNodes[i].m_aabbMaxOrg.deSerializeDouble(memPtr->m_aabbMaxOrg);
     1238                                m_contiguousNodes[i].m_aabbMinOrg.deSerializeDouble(memPtr->m_aabbMinOrg);
     1239                                m_contiguousNodes[i].m_escapeIndex = memPtr->m_escapeIndex;
     1240                                m_contiguousNodes[i].m_subPart = memPtr->m_subPart;
     1241                                m_contiguousNodes[i].m_triangleIndex = memPtr->m_triangleIndex;
     1242                        }
     1243                }
     1244        }
     1245
     1246        {
     1247                int numElem = quantizedBvhDoubleData.m_numQuantizedContiguousNodes;
     1248                m_quantizedContiguousNodes.resize(numElem);
     1249               
     1250                if (numElem)
     1251                {
     1252                        btQuantizedBvhNodeData* memPtr = quantizedBvhDoubleData.m_quantizedContiguousNodesPtr;
     1253                        for (int i=0;i<numElem;i++,memPtr++)
     1254                        {
     1255                                m_quantizedContiguousNodes[i].m_escapeIndexOrTriangleIndex = memPtr->m_escapeIndexOrTriangleIndex;
     1256                                m_quantizedContiguousNodes[i].m_quantizedAabbMax[0] = memPtr->m_quantizedAabbMax[0];
     1257                                m_quantizedContiguousNodes[i].m_quantizedAabbMax[1] = memPtr->m_quantizedAabbMax[1];
     1258                                m_quantizedContiguousNodes[i].m_quantizedAabbMax[2] = memPtr->m_quantizedAabbMax[2];
     1259                                m_quantizedContiguousNodes[i].m_quantizedAabbMin[0] = memPtr->m_quantizedAabbMin[0];
     1260                                m_quantizedContiguousNodes[i].m_quantizedAabbMin[1] = memPtr->m_quantizedAabbMin[1];
     1261                                m_quantizedContiguousNodes[i].m_quantizedAabbMin[2] = memPtr->m_quantizedAabbMin[2];
     1262                        }
     1263                }
     1264        }
     1265
     1266        m_traversalMode = btTraversalMode(quantizedBvhDoubleData.m_traversalMode);
     1267       
     1268        {
     1269                int numElem = quantizedBvhDoubleData.m_numSubtreeHeaders;
     1270                m_SubtreeHeaders.resize(numElem);
     1271                if (numElem)
     1272                {
     1273                        btBvhSubtreeInfoData* memPtr = quantizedBvhDoubleData.m_subTreeInfoPtr;
     1274                        for (int i=0;i<numElem;i++,memPtr++)
     1275                        {
     1276                                m_SubtreeHeaders[i].m_quantizedAabbMax[0] = memPtr->m_quantizedAabbMax[0] ;
     1277                                m_SubtreeHeaders[i].m_quantizedAabbMax[1] = memPtr->m_quantizedAabbMax[1];
     1278                                m_SubtreeHeaders[i].m_quantizedAabbMax[2] = memPtr->m_quantizedAabbMax[2];
     1279                                m_SubtreeHeaders[i].m_quantizedAabbMin[0] = memPtr->m_quantizedAabbMin[0];
     1280                                m_SubtreeHeaders[i].m_quantizedAabbMin[1] = memPtr->m_quantizedAabbMin[1];
     1281                                m_SubtreeHeaders[i].m_quantizedAabbMin[2] = memPtr->m_quantizedAabbMin[2];
     1282                                m_SubtreeHeaders[i].m_rootNodeIndex = memPtr->m_rootNodeIndex;
     1283                                m_SubtreeHeaders[i].m_subtreeSize = memPtr->m_subtreeSize;
     1284                        }
     1285                }
     1286        }
     1287
     1288}
     1289
     1290
     1291
     1292///fills the dataBuffer and returns the struct name (and 0 on failure)
     1293const char*     btQuantizedBvh::serialize(void* dataBuffer, btSerializer* serializer) const
     1294{
     1295        btQuantizedBvhData* quantizedData = (btQuantizedBvhData*)dataBuffer;
     1296       
     1297        m_bvhAabbMax.serialize(quantizedData->m_bvhAabbMax);
     1298        m_bvhAabbMin.serialize(quantizedData->m_bvhAabbMin);
     1299        m_bvhQuantization.serialize(quantizedData->m_bvhQuantization);
     1300
     1301        quantizedData->m_curNodeIndex = m_curNodeIndex;
     1302        quantizedData->m_useQuantization = m_useQuantization;
     1303       
     1304        quantizedData->m_numContiguousLeafNodes = m_contiguousNodes.size();
     1305        quantizedData->m_contiguousNodesPtr = (btOptimizedBvhNodeData*) (m_contiguousNodes.size() ? serializer->getUniquePointer((void*)&m_contiguousNodes[0]) : 0);
     1306        if (quantizedData->m_contiguousNodesPtr)
     1307        {
     1308                int sz = sizeof(btOptimizedBvhNodeData);
     1309                int numElem = m_contiguousNodes.size();
     1310                btChunk* chunk = serializer->allocate(sz,numElem);
     1311                btOptimizedBvhNodeData* memPtr = (btOptimizedBvhNodeData*)chunk->m_oldPtr;
     1312                for (int i=0;i<numElem;i++,memPtr++)
     1313                {
     1314                        m_contiguousNodes[i].m_aabbMaxOrg.serialize(memPtr->m_aabbMaxOrg);
     1315                        m_contiguousNodes[i].m_aabbMinOrg.serialize(memPtr->m_aabbMinOrg);
     1316                        memPtr->m_escapeIndex = m_contiguousNodes[i].m_escapeIndex;
     1317                        memPtr->m_subPart = m_contiguousNodes[i].m_subPart;
     1318                        memPtr->m_triangleIndex = m_contiguousNodes[i].m_triangleIndex;
     1319                }
     1320                serializer->finalizeChunk(chunk,"btOptimizedBvhNodeData",BT_ARRAY_CODE,(void*)&m_contiguousNodes[0]);
     1321        }
     1322
     1323        quantizedData->m_numQuantizedContiguousNodes = m_quantizedContiguousNodes.size();
     1324//      printf("quantizedData->m_numQuantizedContiguousNodes=%d\n",quantizedData->m_numQuantizedContiguousNodes);
     1325        quantizedData->m_quantizedContiguousNodesPtr =(btQuantizedBvhNodeData*) (m_quantizedContiguousNodes.size() ? serializer->getUniquePointer((void*)&m_quantizedContiguousNodes[0]) : 0);
     1326        if (quantizedData->m_quantizedContiguousNodesPtr)
     1327        {
     1328                int sz = sizeof(btQuantizedBvhNodeData);
     1329                int numElem = m_quantizedContiguousNodes.size();
     1330                btChunk* chunk = serializer->allocate(sz,numElem);
     1331                btQuantizedBvhNodeData* memPtr = (btQuantizedBvhNodeData*)chunk->m_oldPtr;
     1332                for (int i=0;i<numElem;i++,memPtr++)
     1333                {
     1334                        memPtr->m_escapeIndexOrTriangleIndex = m_quantizedContiguousNodes[i].m_escapeIndexOrTriangleIndex;
     1335                        memPtr->m_quantizedAabbMax[0] = m_quantizedContiguousNodes[i].m_quantizedAabbMax[0];
     1336                        memPtr->m_quantizedAabbMax[1] = m_quantizedContiguousNodes[i].m_quantizedAabbMax[1];
     1337                        memPtr->m_quantizedAabbMax[2] = m_quantizedContiguousNodes[i].m_quantizedAabbMax[2];
     1338                        memPtr->m_quantizedAabbMin[0] = m_quantizedContiguousNodes[i].m_quantizedAabbMin[0];
     1339                        memPtr->m_quantizedAabbMin[1] = m_quantizedContiguousNodes[i].m_quantizedAabbMin[1];
     1340                        memPtr->m_quantizedAabbMin[2] = m_quantizedContiguousNodes[i].m_quantizedAabbMin[2];
     1341                }
     1342                serializer->finalizeChunk(chunk,"btQuantizedBvhNodeData",BT_ARRAY_CODE,(void*)&m_quantizedContiguousNodes[0]);
     1343        }
     1344
     1345        quantizedData->m_traversalMode = int(m_traversalMode);
     1346        quantizedData->m_numSubtreeHeaders = m_SubtreeHeaders.size();
     1347
     1348        quantizedData->m_subTreeInfoPtr = (btBvhSubtreeInfoData*) (m_SubtreeHeaders.size() ? serializer->getUniquePointer((void*)&m_SubtreeHeaders[0]) : 0);
     1349        if (quantizedData->m_subTreeInfoPtr)
     1350        {
     1351                int sz = sizeof(btBvhSubtreeInfoData);
     1352                int numElem = m_SubtreeHeaders.size();
     1353                btChunk* chunk = serializer->allocate(sz,numElem);
     1354                btBvhSubtreeInfoData* memPtr = (btBvhSubtreeInfoData*)chunk->m_oldPtr;
     1355                for (int i=0;i<numElem;i++,memPtr++)
     1356                {
     1357                        memPtr->m_quantizedAabbMax[0] = m_SubtreeHeaders[i].m_quantizedAabbMax[0];
     1358                        memPtr->m_quantizedAabbMax[1] = m_SubtreeHeaders[i].m_quantizedAabbMax[1];
     1359                        memPtr->m_quantizedAabbMax[2] = m_SubtreeHeaders[i].m_quantizedAabbMax[2];
     1360                        memPtr->m_quantizedAabbMin[0] = m_SubtreeHeaders[i].m_quantizedAabbMin[0];
     1361                        memPtr->m_quantizedAabbMin[1] = m_SubtreeHeaders[i].m_quantizedAabbMin[1];
     1362                        memPtr->m_quantizedAabbMin[2] = m_SubtreeHeaders[i].m_quantizedAabbMin[2];
     1363
     1364                        memPtr->m_rootNodeIndex = m_SubtreeHeaders[i].m_rootNodeIndex;
     1365                        memPtr->m_subtreeSize = m_SubtreeHeaders[i].m_subtreeSize;
     1366                }
     1367                serializer->finalizeChunk(chunk,"btBvhSubtreeInfoData",BT_ARRAY_CODE,(void*)&m_SubtreeHeaders[0]);
     1368        }
     1369        return btQuantizedBvhDataName;
     1370}
     1371
     1372
     1373
     1374
     1375
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btQuantizedBvh.h

    r5781 r8351  
    1717#define QUANTIZED_BVH_H
    1818
     19class btSerializer;
     20
    1921//#define DEBUG_CHECK_DEQUANTIZATION 1
    2022#ifdef DEBUG_CHECK_DEQUANTIZATION
     
    2931#include "LinearMath/btVector3.h"
    3032#include "LinearMath/btAlignedAllocator.h"
     33
     34#ifdef BT_USE_DOUBLE_PRECISION
     35#define btQuantizedBvhData btQuantizedBvhDoubleData
     36#define btOptimizedBvhNodeData btOptimizedBvhNodeDoubleData
     37#define btQuantizedBvhDataName "btQuantizedBvhDoubleData"
     38#else
     39#define btQuantizedBvhData btQuantizedBvhFloatData
     40#define btOptimizedBvhNodeData btOptimizedBvhNodeFloatData
     41#define btQuantizedBvhDataName "btQuantizedBvhFloatData"
     42#endif
     43
    3144
    3245
     
    191204
    192205        //This is only used for serialization so we don't have to add serialization directly to btAlignedObjectArray
    193         int m_subtreeHeaderCount;
     206        mutable int m_subtreeHeaderCount;
    194207
    195208       
     
    444457        }
    445458
     459////////////////////////////////////////////////////////////////////
    446460
    447461        /////Calculate space needed to store BVH for serialization
    448         unsigned calculateSerializeBufferSize();
     462        unsigned calculateSerializeBufferSize() const;
    449463
    450464        /// Data buffer MUST be 16 byte aligned
    451         virtual bool serialize(void *o_alignedDataBuffer, unsigned i_dataBufferSize, bool i_swapEndian);
     465        virtual bool serialize(void *o_alignedDataBuffer, unsigned i_dataBufferSize, bool i_swapEndian) const;
    452466
    453467        ///deSerializeInPlace loads and initializes a BVH from a buffer in memory 'in place'
     
    455469
    456470        static unsigned int getAlignmentSerializationPadding();
     471//////////////////////////////////////////////////////////////////////
     472
     473       
     474        virtual int     calculateSerializeBufferSizeNew() const;
     475
     476        ///fills the dataBuffer and returns the struct name (and 0 on failure)
     477        virtual const char*     serialize(void* dataBuffer, btSerializer* serializer) const;
     478
     479        virtual void deSerializeFloat(struct btQuantizedBvhFloatData& quantizedBvhFloatData);
     480
     481        virtual void deSerializeDouble(struct btQuantizedBvhDoubleData& quantizedBvhDoubleData);
     482
     483
     484////////////////////////////////////////////////////////////////////
    457485
    458486        SIMD_FORCE_INLINE bool isQuantized()
     
    471499
    472500
     501struct  btBvhSubtreeInfoData
     502{
     503        int                     m_rootNodeIndex;
     504        int                     m_subtreeSize;
     505        unsigned short m_quantizedAabbMin[3];
     506        unsigned short m_quantizedAabbMax[3];
     507};
     508
     509struct btOptimizedBvhNodeFloatData
     510{
     511        btVector3FloatData      m_aabbMinOrg;
     512        btVector3FloatData      m_aabbMaxOrg;
     513        int     m_escapeIndex;
     514        int     m_subPart;
     515        int     m_triangleIndex;
     516        char m_pad[4];
     517};
     518
     519struct btOptimizedBvhNodeDoubleData
     520{
     521        btVector3DoubleData     m_aabbMinOrg;
     522        btVector3DoubleData     m_aabbMaxOrg;
     523        int     m_escapeIndex;
     524        int     m_subPart;
     525        int     m_triangleIndex;
     526        char    m_pad[4];
     527};
     528
     529
     530struct btQuantizedBvhNodeData
     531{
     532        unsigned short m_quantizedAabbMin[3];
     533        unsigned short m_quantizedAabbMax[3];
     534        int     m_escapeIndexOrTriangleIndex;
     535};
     536
     537struct  btQuantizedBvhFloatData
     538{
     539        btVector3FloatData                      m_bvhAabbMin;
     540        btVector3FloatData                      m_bvhAabbMax;
     541        btVector3FloatData                      m_bvhQuantization;
     542        int                                     m_curNodeIndex;
     543        int                                     m_useQuantization;
     544        int                                     m_numContiguousLeafNodes;
     545        int                                     m_numQuantizedContiguousNodes;
     546        btOptimizedBvhNodeFloatData     *m_contiguousNodesPtr;
     547        btQuantizedBvhNodeData          *m_quantizedContiguousNodesPtr;
     548        btBvhSubtreeInfoData    *m_subTreeInfoPtr;
     549        int                                     m_traversalMode;
     550        int                                     m_numSubtreeHeaders;
     551       
     552};
     553
     554struct  btQuantizedBvhDoubleData
     555{
     556        btVector3DoubleData                     m_bvhAabbMin;
     557        btVector3DoubleData                     m_bvhAabbMax;
     558        btVector3DoubleData                     m_bvhQuantization;
     559        int                                                     m_curNodeIndex;
     560        int                                                     m_useQuantization;
     561        int                                                     m_numContiguousLeafNodes;
     562        int                                                     m_numQuantizedContiguousNodes;
     563        btOptimizedBvhNodeDoubleData    *m_contiguousNodesPtr;
     564        btQuantizedBvhNodeData                  *m_quantizedContiguousNodesPtr;
     565
     566        int                                                     m_traversalMode;
     567        int                                                     m_numSubtreeHeaders;
     568        btBvhSubtreeInfoData            *m_subTreeInfoPtr;
     569};
     570
     571
     572SIMD_FORCE_INLINE       int     btQuantizedBvh::calculateSerializeBufferSizeNew() const
     573{
     574        return sizeof(btQuantizedBvhData);
     575}
     576
     577
     578
    473579#endif //QUANTIZED_BVH_H
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp

    r5781 r8351  
    2121#include "LinearMath/btTransform.h"
    2222#include "LinearMath/btMatrix3x3.h"
     23#include "LinearMath/btAabbUtil2.h"
     24
    2325#include <new>
    2426
     
    163165                }
    164166                rayCallback.process(proxy);
     167        }
     168}
     169
     170
     171void    btSimpleBroadphase::aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback)
     172{
     173        for (int i=0; i <= m_LastHandleIndex; i++)
     174        {
     175                btSimpleBroadphaseProxy* proxy = &m_pHandles[i];
     176                if(!proxy->m_clientObject)
     177                {
     178                        continue;
     179                }
     180                if (TestAabbAgainstAabb2(aabbMin,aabbMax,proxy->m_aabbMin,proxy->m_aabbMax))
     181                {
     182                        callback.process(proxy);
     183                }
    165184        }
    166185}
  • code/trunk/src/external/bullet/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h

    r5781 r8351  
    137137
    138138        virtual void    rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0),const btVector3& aabbMax=btVector3(0,0,0));
     139        virtual void    aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback);
    139140               
    140141        btOverlappingPairCache* getOverlappingPairCache()
     
    154155        virtual void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const
    155156        {
    156                 aabbMin.setValue(-1e30f,-1e30f,-1e30f);
    157                 aabbMax.setValue(1e30f,1e30f,1e30f);
     157                aabbMin.setValue(-BT_LARGE_FLOAT,-BT_LARGE_FLOAT,-BT_LARGE_FLOAT);
     158                aabbMax.setValue(BT_LARGE_FLOAT,BT_LARGE_FLOAT,BT_LARGE_FLOAT);
    158159        }
    159160
  • code/trunk/src/external/bullet/BulletCollision/CMakeLists.txt

    r5929 r8351  
    66        BroadphaseCollision/btBroadphaseProxy.cpp
    77        BroadphaseCollision/btCollisionAlgorithm.cpp
     8        BroadphaseCollision/btDbvt.cpp
     9        BroadphaseCollision/btDbvtBroadphase.cpp
    810        BroadphaseCollision/btDispatcher.cpp
    9         BroadphaseCollision/btDbvtBroadphase.cpp
    10         BroadphaseCollision/btDbvt.cpp
    1111        BroadphaseCollision/btMultiSapBroadphase.cpp
    1212        BroadphaseCollision/btOverlappingPairCache.cpp
     
    1515
    1616        CollisionDispatch/btActivatingCollisionAlgorithm.cpp
     17        CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp
     18        CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp
     19        CollisionDispatch/btBoxBoxDetector.cpp
    1720        CollisionDispatch/btCollisionDispatcher.cpp
    1821        CollisionDispatch/btCollisionObject.cpp
     
    2023        CollisionDispatch/btCompoundCollisionAlgorithm.cpp
    2124        CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp
     25        CollisionDispatch/btConvexConvexAlgorithm.cpp
     26        CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp
     27        CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp
    2228        CollisionDispatch/btDefaultCollisionConfiguration.cpp
    23         CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp
    24         CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp
    25         CollisionDispatch/btBoxBoxDetector.cpp
     29        CollisionDispatch/btEmptyCollisionAlgorithm.cpp
    2630        CollisionDispatch/btGhostObject.cpp
    27         CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp
    28         CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp
    29         CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp
    30         CollisionDispatch/btConvexConvexAlgorithm.cpp
    31         CollisionDispatch/btEmptyCollisionAlgorithm.cpp
     31        CollisionDispatch/btInternalEdgeUtility.cpp
     32        CollisionDispatch/btInternalEdgeUtility.h
    3233        CollisionDispatch/btManifoldResult.cpp
    3334        CollisionDispatch/btSimulationIslandManager.cpp
     35        CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp
     36        CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp
     37        CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp
    3438        CollisionDispatch/btUnionFind.cpp
    3539        CollisionDispatch/SphereTriangleDetector.cpp
    3640
    3741        CollisionShapes/btBoxShape.cpp
     42        CollisionShapes/btBox2dShape.cpp
    3843        CollisionShapes/btBvhTriangleMeshShape.cpp
    3944        CollisionShapes/btCapsuleShape.cpp
     
    4348        CollisionShapes/btConeShape.cpp
    4449        CollisionShapes/btConvexHullShape.cpp
     50        CollisionShapes/btConvexInternalShape.cpp
    4551        CollisionShapes/btConvexPointCloudShape.cpp
    4652        CollisionShapes/btConvexShape.cpp
    47         CollisionShapes/btConvexInternalShape.cpp
     53        CollisionShapes/btConvex2dShape.cpp
    4854        CollisionShapes/btConvexTriangleMeshShape.cpp
    4955        CollisionShapes/btCylinderShape.cpp
     
    5662        CollisionShapes/btPolyhedralConvexShape.cpp
    5763        CollisionShapes/btScaledBvhTriangleMeshShape.cpp
    58         CollisionShapes/btTetrahedronShape.cpp
     64        CollisionShapes/btShapeHull.cpp
    5965        CollisionShapes/btSphereShape.cpp
    60         CollisionShapes/btShapeHull.cpp
    6166        CollisionShapes/btStaticPlaneShape.cpp
    6267        CollisionShapes/btStridingMeshInterface.cpp
     68        CollisionShapes/btTetrahedronShape.cpp
     69        CollisionShapes/btTriangleBuffer.cpp
    6370        CollisionShapes/btTriangleCallback.cpp
    64         CollisionShapes/btTriangleBuffer.cpp
    6571        CollisionShapes/btTriangleIndexVertexArray.cpp
    6672        CollisionShapes/btTriangleIndexVertexMaterialArray.cpp
     
    6975        CollisionShapes/btUniformScalingShape.cpp
    7076
    71         Gimpact/btContactProcessing.cpp
    72         Gimpact/btGImpactShape.cpp
    73         Gimpact/btGImpactBvh.cpp
    74         Gimpact/btGenericPoolAllocator.cpp
    75         Gimpact/btGImpactCollisionAlgorithm.cpp
    76         Gimpact/btTriangleShapeEx.cpp
    77         Gimpact/btGImpactQuantizedBvh.cpp
    78 
    7977        NarrowPhaseCollision/btContinuousConvexCollision.cpp
     78        NarrowPhaseCollision/btConvexCast.cpp
     79        NarrowPhaseCollision/btGjkConvexCast.cpp
    8080        NarrowPhaseCollision/btGjkEpa2.cpp
    8181        NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp
    82         NarrowPhaseCollision/btConvexCast.cpp
    83         NarrowPhaseCollision/btGjkConvexCast.cpp
    8482        NarrowPhaseCollision/btGjkPairDetector.cpp
    8583        NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp
     
    9189COMPILATION_END
    9290
    93 COMPILATION_BEGIN BulletGImpactCompilation.cpp
    94         Gimpact/gim_contact.cpp
    95         Gimpact/gim_memory.cpp
    96         Gimpact/gim_tri_collision.cpp
    97         Gimpact/gim_box_set.cpp
    98 COMPILATION_END
    99 
    10091        # Headers
    10192        BroadphaseCollision/btAxisSweep3.h
     
    10394        BroadphaseCollision/btBroadphaseProxy.h
    10495        BroadphaseCollision/btCollisionAlgorithm.h
     96        BroadphaseCollision/btDbvt.h
     97        BroadphaseCollision/btDbvtBroadphase.h
    10598        BroadphaseCollision/btDispatcher.h
    106         BroadphaseCollision/btDbvtBroadphase.h
    107         BroadphaseCollision/btDbvt.h
    10899        BroadphaseCollision/btMultiSapBroadphase.h
    109100        BroadphaseCollision/btOverlappingPairCache.h
     
    113104
    114105        CollisionDispatch/btActivatingCollisionAlgorithm.h
     106        CollisionDispatch/btBoxBoxCollisionAlgorithm.h
     107        CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h
     108        CollisionDispatch/btBoxBoxDetector.h
    115109        CollisionDispatch/btCollisionConfiguration.h
    116110        CollisionDispatch/btCollisionCreateFunc.h
     
    120114        CollisionDispatch/btCompoundCollisionAlgorithm.h
    121115        CollisionDispatch/btConvexConcaveCollisionAlgorithm.h
     116        CollisionDispatch/btConvexConvexAlgorithm.h
     117        CollisionDispatch/btConvex2dConvex2dAlgorithm.h
     118        CollisionDispatch/btConvexPlaneCollisionAlgorithm.h
    122119        CollisionDispatch/btDefaultCollisionConfiguration.h
    123         CollisionDispatch/btSphereSphereCollisionAlgorithm.h
    124         CollisionDispatch/btBoxBoxCollisionAlgorithm.h
    125         CollisionDispatch/btBoxBoxDetector.h
     120        CollisionDispatch/btEmptyCollisionAlgorithm.h
    126121        CollisionDispatch/btGhostObject.h
    127         CollisionDispatch/btSphereBoxCollisionAlgorithm.h
    128         CollisionDispatch/btConvexPlaneCollisionAlgorithm.h
    129         CollisionDispatch/btSphereTriangleCollisionAlgorithm.h
    130         CollisionDispatch/btConvexConvexAlgorithm.h
    131         CollisionDispatch/btEmptyCollisionAlgorithm.h
    132122        CollisionDispatch/btManifoldResult.h
    133123        CollisionDispatch/btSimulationIslandManager.h
     124        CollisionDispatch/btSphereBoxCollisionAlgorithm.h
     125        CollisionDispatch/btSphereSphereCollisionAlgorithm.h
     126        CollisionDispatch/btSphereTriangleCollisionAlgorithm.h
    134127        CollisionDispatch/btUnionFind.h
    135128        CollisionDispatch/SphereTriangleDetector.h
    136129
    137130        CollisionShapes/btBoxShape.h
     131        CollisionShapes/btBox2dShape.h
    138132        CollisionShapes/btBvhTriangleMeshShape.h
    139133        CollisionShapes/btCapsuleShape.h
    140         CollisionShapes/btCollisionMargin
     134        CollisionShapes/btCollisionMargin.h
    141135        CollisionShapes/btCollisionShape.h
    142136        CollisionShapes/btCompoundShape.h
     
    144138        CollisionShapes/btConeShape.h
    145139        CollisionShapes/btConvexHullShape.h
     140        CollisionShapes/btConvexInternalShape.h
    146141        CollisionShapes/btConvexPointCloudShape.h
    147142        CollisionShapes/btConvexShape.h
    148         CollisionShapes/btConvexInternalShape.h
     143        CollisionShapes/btConvex2dShape.h
    149144        CollisionShapes/btConvexTriangleMeshShape.h
    150145        CollisionShapes/btCylinderShape.h
    151146        CollisionShapes/btEmptyShape.h
    152147        CollisionShapes/btHeightfieldTerrainShape.h
     148        CollisionShapes/btMaterial.h
    153149        CollisionShapes/btMinkowskiSumShape.h
    154         CollisionShapes/btMaterial.h
    155150        CollisionShapes/btMultimaterialTriangleMeshShape.h
    156151        CollisionShapes/btMultiSphereShape.h
     
    158153        CollisionShapes/btPolyhedralConvexShape.h
    159154        CollisionShapes/btScaledBvhTriangleMeshShape.h
    160         CollisionShapes/btTetrahedronShape.h
     155        CollisionShapes/btShapeHull.h
    161156        CollisionShapes/btSphereShape.h
    162         CollisionShapes/btShapeHull.h
    163157        CollisionShapes/btStaticPlaneShape.h
    164158        CollisionShapes/btStridingMeshInterface.h
     159        CollisionShapes/btTetrahedronShape.h
     160        CollisionShapes/btTriangleBuffer.h
    165161        CollisionShapes/btTriangleCallback.h
    166         CollisionShapes/btTriangleBuffer.h
    167162        CollisionShapes/btTriangleIndexVertexArray.h
    168163        CollisionShapes/btTriangleIndexVertexMaterialArray.h
     164        CollisionShapes/btTriangleInfoMap.h
    169165        CollisionShapes/btTriangleMesh.h
    170166        CollisionShapes/btTriangleMeshShape.h
     167        CollisionShapes/btTriangleShape.h
    171168        CollisionShapes/btUniformScalingShape.h
    172 
    173         Gimpact/btGImpactShape.h
    174         Gimpact/gim_contact.h
    175         Gimpact/btGImpactBvh.h
    176         Gimpact/btGenericPoolAllocator.h
    177         Gimpact/gim_memory.h
    178         Gimpact/btGImpactCollisionAlgorithm.h
    179         Gimpact/btTriangleShapeEx.h
    180         Gimpact/gim_tri_collision.h
    181         Gimpact/btGImpactQuantizedBvh.h
    182         Gimpact/gim_box_set.h
    183169
    184170        NarrowPhaseCollision/btContinuousConvexCollision.h
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp

    r5781 r8351  
    3838        btScalar timeOfImpact = btScalar(1.);
    3939        btScalar depth = btScalar(0.);
    40 //      output.m_distance = btScalar(1e30);
     40//      output.m_distance = btScalar(BT_LARGE_FLOAT);
    4141        //move sphere into triangle space
    4242        btTransform     sphereInTr = transformB.inverseTimes(transformA);
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/SphereTriangleDetector.h

    r5781 r8351  
    3535        virtual ~SphereTriangleDetector() {};
    3636
     37        bool collide(const btVector3& sphereCenter,btVector3 &point, btVector3& resultNormal, btScalar& depth, btScalar &timeOfImpact, btScalar contactBreakingThreshold);
     38
    3739private:
    3840
    39         bool collide(const btVector3& sphereCenter,btVector3 &point, btVector3& resultNormal, btScalar& depth, btScalar &timeOfImpact, btScalar contactBreakingThreshold);
     41       
    4042        bool pointInTriangle(const btVector3 vertices[], const btVector3 &normal, btVector3 *p );
    4143        bool facecontains(const btVector3 &p,const btVector3* vertices,btVector3& normal);
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp

    r5781 r8351  
    6262
    6363        btDiscreteCollisionDetectorInterface::ClosestPointInput input;
    64         input.m_maximumDistanceSquared = 1e30f;
     64        input.m_maximumDistanceSquared = BT_LARGE_FLOAT;
    6565        input.m_transformA = body0->getWorldTransform();
    6666        input.m_transformB = body1->getWorldTransform();
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp

    r5781 r8351  
    1 
    21/*
    32 * Box-Box collision detection re-distributed under the ZLib license with permission from Russell L. Smith
     
    213212        } else
    214213        {
    215                 a=1e30f;
     214                a=BT_LARGE_FLOAT;
    216215        }
    217216    cx = a*(cx + q*(p[n*2-2]+p[0]));
     
    268267{
    269268  const btScalar fudge_factor = btScalar(1.05);
    270   btVector3 p,pp,normalC;
     269  btVector3 p,pp,normalC(0.f,0.f,0.f);
    271270  const btScalar *normalR = 0;
    272271  btScalar A[3],B[3],R11,R12,R13,R21,R22,R23,R31,R32,R33,
     
    334333#define TST(expr1,expr2,n1,n2,n3,cc) \
    335334  s2 = btFabs(expr1) - (expr2); \
    336   if (s2 > 0) return 0; \
     335  if (s2 > SIMD_EPSILON) return 0; \
    337336  l = btSqrt((n1)*(n1) + (n2)*(n2) + (n3)*(n3)); \
    338   if (l > 0) { \
     337  if (l > SIMD_EPSILON) { \
    339338    s2 /= l; \
    340339    if (s2*fudge_factor > s) { \
     
    346345    } \
    347346  }
     347
     348  btScalar fudge2 (1.0e-5f);
     349
     350  Q11 += fudge2;
     351  Q12 += fudge2;
     352  Q13 += fudge2;
     353
     354  Q21 += fudge2;
     355  Q22 += fudge2;
     356  Q23 += fudge2;
     357
     358  Q31 += fudge2;
     359  Q32 += fudge2;
     360  Q33 += fudge2;
    348361
    349362  // separating axis = u1 x (v1,v2,v3)
     
    425438#else
    426439                output.addContactPoint(-normal,pb,-*depth);
     440
    427441#endif //
    428442                *return_code = code;
     
    594608
    595609  if (cnum <= maxc) {
     610
     611          if (code<4)
     612          {
    596613    // we have less contacts than we need, so we use them all
    597     for (j=0; j < cnum; j++) {
    598 
    599                 //AddContactPoint...
    600 
    601                 //dContactGeom *con = CONTACT(contact,skip*j);
    602       //for (i=0; i<3; i++) con->pos[i] = point[j*3+i] + pa[i];
    603       //con->depth = dep[j];
    604 
     614    for (j=0; j < cnum; j++)
     615        {
    605616                btVector3 pointInWorld;
    606617                for (i=0; i<3; i++)
     
    609620
    610621    }
     622          } else
     623          {
     624                  // we have less contacts than we need, so we use them all
     625                for (j=0; j < cnum; j++)
     626                {
     627                        btVector3 pointInWorld;
     628                        for (i=0; i<3; i++)
     629                                pointInWorld[i] = point[j*3+i] + pa[i]-normal[i]*dep[j];
     630                                //pointInWorld[i] = point[j*3+i] + pa[i];
     631                        output.addContactPoint(-normal,pointInWorld,-dep[j]);
     632                }
     633          }
    611634  }
    612635  else {
     
    633656                for (i=0; i<3; i++)
    634657                        posInWorld[i] = point[iret[j]*3+i] + pa[i];
    635                 output.addContactPoint(-normal,posInWorld,-dep[iret[j]]);
     658                if (code<4)
     659           {
     660                        output.addContactPoint(-normal,posInWorld,-dep[iret[j]]);
     661                } else
     662                {
     663                        output.addContactPoint(-normal,posInWorld-normal*dep[iret[j]],-dep[iret[j]]);
     664                }
    636665    }
    637666    cnum = maxc;
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp

    r5781 r8351  
    3535
    3636btCollisionDispatcher::btCollisionDispatcher (btCollisionConfiguration* collisionConfiguration):
    37         m_count(0),
    38         m_useIslands(true),
    39         m_staticWarningReported(false),
     37m_dispatcherFlags(btCollisionDispatcher::CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD),
    4038        m_collisionConfiguration(collisionConfiguration)
    4139{
     
    8078        btCollisionObject* body1 = (btCollisionObject*)b1;
    8179
    82         //test for Bullet 2.74: use a relative contact breaking threshold without clamping against 'gContactBreakingThreshold'
    83         //btScalar contactBreakingThreshold = btMin(gContactBreakingThreshold,btMin(body0->getCollisionShape()->getContactBreakingThreshold(),body1->getCollisionShape()->getContactBreakingThreshold()));
    84         btScalar contactBreakingThreshold = btMin(body0->getCollisionShape()->getContactBreakingThreshold(),body1->getCollisionShape()->getContactBreakingThreshold());
     80        //optional relative contact breaking threshold, turned on by default (use setDispatcherFlags to switch off feature for improved performance)
     81       
     82        btScalar contactBreakingThreshold =  (m_dispatcherFlags & btCollisionDispatcher::CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD) ?
     83                btMin(body0->getCollisionShape()->getContactBreakingThreshold(gContactBreakingThreshold) , body1->getCollisionShape()->getContactBreakingThreshold(gContactBreakingThreshold))
     84                : gContactBreakingThreshold ;
    8585
    8686        btScalar contactProcessingThreshold = btMin(body0->getContactProcessingThreshold(),body1->getContactProcessingThreshold());
     
    170170
    171171#ifdef BT_DEBUG
    172         if (!m_staticWarningReported)
     172        if (!(m_dispatcherFlags & btCollisionDispatcher::CD_STATIC_STATIC_REPORTED))
    173173        {
    174174                //broadphase filtering already deals with this
     
    176176                        (body1->isStaticObject() || body1->isKinematicObject()))
    177177                {
    178                         m_staticWarningReported = true;
     178                        m_dispatcherFlags |= btCollisionDispatcher::CD_STATIC_STATIC_REPORTED;
    179179                        printf("warning btCollisionDispatcher::needsCollision: static-static collision!\n");
    180180                }
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionDispatcher.h

    r5781 r8351  
    4343class btCollisionDispatcher : public btDispatcher
    4444{
    45         int m_count;
     45        int             m_dispatcherFlags;
    4646       
    4747        btAlignedObjectArray<btPersistentManifold*>     m_manifoldsPtr;
    4848
    49         bool m_useIslands;
    50 
    51         bool    m_staticWarningReported;
    52        
    5349        btManifoldResult        m_defaultManifoldResult;
    5450
     
    6056
    6157        btCollisionAlgorithmCreateFunc* m_doubleDispatch[MAX_BROADPHASE_COLLISION_TYPES][MAX_BROADPHASE_COLLISION_TYPES];
    62        
    6358
    6459        btCollisionConfiguration*       m_collisionConfiguration;
     
    6661
    6762public:
     63
     64        enum DispatcherFlags
     65        {
     66                CD_STATIC_STATIC_REPORTED = 1,
     67                CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD = 2
     68        };
     69
     70        int     getDispatcherFlags() const
     71        {
     72                return m_dispatcherFlags;
     73        }
     74
     75        void    setDispatcherFlags(int flags)
     76        {
     77        (void) flags;
     78                m_dispatcherFlags = 0;
     79        }
    6880
    6981        ///registerCollisionCreateFunc allows registration of custom/alternative collision create functions
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionObject.cpp

    r5781 r8351  
    1616
    1717#include "btCollisionObject.h"
     18#include "LinearMath/btSerializer.h"
    1819
    1920btCollisionObject::btCollisionObject()
    2021        :       m_anisotropicFriction(1.f,1.f,1.f),
    2122        m_hasAnisotropicFriction(false),
    22         m_contactProcessingThreshold(1e30f),
     23        m_contactProcessingThreshold(BT_LARGE_FLOAT),
    2324                m_broadphaseHandle(0),
    2425                m_collisionShape(0),
     26                m_extensionPointer(0),
    2527                m_rootCollisionShape(0),
    2628                m_collisionFlags(btCollisionObject::CF_STATIC_OBJECT),
     
    3133                m_friction(btScalar(0.5)),
    3234                m_restitution(btScalar(0.)),
     35                m_internalType(CO_COLLISION_OBJECT),
    3336                m_userObjectPointer(0),
    34                 m_internalType(CO_COLLISION_OBJECT),
    3537                m_hitFraction(btScalar(1.)),
    3638                m_ccdSweptSphereRadius(btScalar(0.)),
     
    3840                m_checkCollideWith(false)
    3941{
    40        
     42        m_worldTransform.setIdentity();
    4143}
    4244
     
    6567}
    6668
     69const char* btCollisionObject::serialize(void* dataBuffer, btSerializer* serializer) const
     70{
     71
     72        btCollisionObjectData* dataOut = (btCollisionObjectData*)dataBuffer;
     73
     74        m_worldTransform.serialize(dataOut->m_worldTransform);
     75        m_interpolationWorldTransform.serialize(dataOut->m_interpolationWorldTransform);
     76        m_interpolationLinearVelocity.serialize(dataOut->m_interpolationLinearVelocity);
     77        m_interpolationAngularVelocity.serialize(dataOut->m_interpolationAngularVelocity);
     78        m_anisotropicFriction.serialize(dataOut->m_anisotropicFriction);
     79        dataOut->m_hasAnisotropicFriction = m_hasAnisotropicFriction;
     80        dataOut->m_contactProcessingThreshold = m_contactProcessingThreshold;
     81        dataOut->m_broadphaseHandle = 0;
     82        dataOut->m_collisionShape = serializer->getUniquePointer(m_collisionShape);
     83        dataOut->m_rootCollisionShape = 0;//@todo
     84        dataOut->m_collisionFlags = m_collisionFlags;
     85        dataOut->m_islandTag1 = m_islandTag1;
     86        dataOut->m_companionId = m_companionId;
     87        dataOut->m_activationState1 = m_activationState1;
     88        dataOut->m_activationState1 = m_activationState1;
     89        dataOut->m_deactivationTime = m_deactivationTime;
     90        dataOut->m_friction = m_friction;
     91        dataOut->m_restitution = m_restitution;
     92        dataOut->m_internalType = m_internalType;
     93       
     94        char* name = (char*) serializer->findNameForPointer(this);
     95        dataOut->m_name = (char*)serializer->getUniquePointer(name);
     96        if (dataOut->m_name)
     97        {
     98                serializer->serializeName(name);
     99        }
     100        dataOut->m_hitFraction = m_hitFraction;
     101        dataOut->m_ccdSweptSphereRadius = m_ccdSweptSphereRadius;
     102        dataOut->m_ccdMotionThreshold = m_ccdMotionThreshold;
     103        dataOut->m_ccdMotionThreshold = m_ccdMotionThreshold;
     104        dataOut->m_checkCollideWith = m_checkCollideWith;
     105
     106        return btCollisionObjectDataName;
     107}
    67108
    68109
     110void btCollisionObject::serializeSingleObject(class btSerializer* serializer) const
     111{
     112        int len = calculateSerializeBufferSize();
     113        btChunk* chunk = serializer->allocate(len,1);
     114        const char* structType = serialize(chunk->m_oldPtr, serializer);
     115        serializer->finalizeChunk(chunk,structType,BT_COLLISIONOBJECT_CODE,(void*)this);
     116}
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionObject.h

    r5781 r8351  
    2828struct  btBroadphaseProxy;
    2929class   btCollisionShape;
     30struct btCollisionShapeData;
    3031#include "LinearMath/btMotionState.h"
    3132#include "LinearMath/btAlignedAllocator.h"
    3233#include "LinearMath/btAlignedObjectArray.h"
    3334
    34 
    3535typedef btAlignedObjectArray<class btCollisionObject*> btCollisionObjectArray;
     36
     37#ifdef BT_USE_DOUBLE_PRECISION
     38#define btCollisionObjectData btCollisionObjectDoubleData
     39#define btCollisionObjectDataName "btCollisionObjectDoubleData"
     40#else
     41#define btCollisionObjectData btCollisionObjectFloatData
     42#define btCollisionObjectDataName "btCollisionObjectFloatData"
     43#endif
    3644
    3745
     
    5462        btVector3       m_interpolationAngularVelocity;
    5563       
    56         btVector3               m_anisotropicFriction;
    57         bool                            m_hasAnisotropicFriction;
    58         btScalar                m_contactProcessingThreshold;   
     64        btVector3       m_anisotropicFriction;
     65        int                     m_hasAnisotropicFriction;
     66        btScalar        m_contactProcessingThreshold;   
    5967
    6068        btBroadphaseProxy*              m_broadphaseHandle;
    6169        btCollisionShape*               m_collisionShape;
     70        ///m_extensionPointer is used by some internal low-level Bullet extensions.
     71        void*                                   m_extensionPointer;
    6272       
    6373        ///m_rootCollisionShape is temporarily used to store the original collision shape
     
    7787        btScalar                m_restitution;
    7888
    79         ///users can point to their objects, m_userPointer is not used by Bullet, see setUserPointer/getUserPointer
    80         void*                   m_userObjectPointer;
    81 
    8289        ///m_internalType is reserved to distinguish Bullet's btCollisionObject, btRigidBody, btSoftBody, btGhostObject etc.
    8390        ///do not assign your own m_internalType unless you write a new dynamics object class.
    8491        int                             m_internalType;
    8592
     93        ///users can point to their objects, m_userPointer is not used by Bullet, see setUserPointer/getUserPointer
     94        void*                   m_userObjectPointer;
     95
    8696        ///time of impact calculation
    8797        btScalar                m_hitFraction;
     
    94104       
    95105        /// If some object should have elaborate collision filtering by sub-classes
    96         bool                    m_checkCollideWith;
    97 
    98         char    m_pad[7];
     106        int                     m_checkCollideWith;
    99107
    100108        virtual bool    checkCollideWithOverride(btCollisionObject* /* co */)
     
    113121                CF_NO_CONTACT_RESPONSE = 4,
    114122                CF_CUSTOM_MATERIAL_CALLBACK = 8,//this allows per-triangle material (friction/restitution)
    115                 CF_CHARACTER_OBJECT = 16
     123                CF_CHARACTER_OBJECT = 16,
     124                CF_DISABLE_VISUALIZE_OBJECT = 32, //disable debug drawing
     125                CF_DISABLE_SPU_COLLISION_PROCESSING = 64//disable parallel/SPU processing
    116126        };
    117127
     
    119129        {
    120130                CO_COLLISION_OBJECT =1,
    121                 CO_RIGID_BODY,
     131                CO_RIGID_BODY=2,
    122132                ///CO_GHOST_OBJECT keeps track of all objects overlapping its AABB and that pass its collision filter
    123133                ///It is useful for collision sensors, explosion objects, character controller etc.
    124                 CO_GHOST_OBJECT,
    125                 CO_SOFT_BODY,
    126                 CO_HF_FLUID
     134                CO_GHOST_OBJECT=4,
     135                CO_SOFT_BODY=8,
     136                CO_HF_FLUID=16,
     137                CO_USER_TYPE=32
    127138        };
    128139
     
    144155        bool    hasAnisotropicFriction() const
    145156        {
    146                 return m_hasAnisotropicFriction;
     157                return m_hasAnisotropicFriction!=0;
    147158        }
    148159
     
    214225        }
    215226
     227        ///Avoid using this internal API call, the extension pointer is used by some Bullet extensions.
     228        ///If you need to store your own user pointer, use 'setUserPointer/getUserPointer' instead.
     229        void*           internalGetExtensionPointer() const
     230        {
     231                return m_extensionPointer;
     232        }
     233        ///Avoid using this internal API call, the extension pointer is used by some Bullet extensions
     234        ///If you need to store your own user pointer, use 'setUserPointer/getUserPointer' instead.
     235        void    internalSetExtensionPointer(void* pointer)
     236        {
     237                m_extensionPointer = pointer;
     238        }
     239
    216240        SIMD_FORCE_INLINE       int     getActivationState() const { return m_activationState1;}
    217241       
     
    394418        void    setCcdMotionThreshold(btScalar ccdMotionThreshold)
    395419        {
    396                 m_ccdMotionThreshold = ccdMotionThreshold*ccdMotionThreshold;
     420                m_ccdMotionThreshold = ccdMotionThreshold;
    397421        }
    398422
     
    417441                return true;
    418442        }
     443
     444        virtual int     calculateSerializeBufferSize()  const;
     445
     446        ///fills the dataBuffer and returns the struct name (and 0 on failure)
     447        virtual const char*     serialize(void* dataBuffer, class btSerializer* serializer) const;
     448
     449        virtual void serializeSingleObject(class btSerializer* serializer) const;
     450
    419451};
    420452
     453///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
     454struct  btCollisionObjectDoubleData
     455{
     456        void                                    *m_broadphaseHandle;
     457        void                                    *m_collisionShape;
     458        btCollisionShapeData    *m_rootCollisionShape;
     459        char                                    *m_name;
     460
     461        btTransformDoubleData   m_worldTransform;
     462        btTransformDoubleData   m_interpolationWorldTransform;
     463        btVector3DoubleData             m_interpolationLinearVelocity;
     464        btVector3DoubleData             m_interpolationAngularVelocity;
     465        btVector3DoubleData             m_anisotropicFriction;
     466        double                                  m_contactProcessingThreshold;   
     467        double                                  m_deactivationTime;
     468        double                                  m_friction;
     469        double                                  m_restitution;
     470        double                                  m_hitFraction;
     471        double                                  m_ccdSweptSphereRadius;
     472        double                                  m_ccdMotionThreshold;
     473
     474        int                                             m_hasAnisotropicFriction;
     475        int                                             m_collisionFlags;
     476        int                                             m_islandTag1;
     477        int                                             m_companionId;
     478        int                                             m_activationState1;
     479        int                                             m_internalType;
     480        int                                             m_checkCollideWith;
     481
     482        char    m_padding[4];
     483};
     484
     485///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
     486struct  btCollisionObjectFloatData
     487{
     488        void                                    *m_broadphaseHandle;
     489        void                                    *m_collisionShape;
     490        btCollisionShapeData    *m_rootCollisionShape;
     491        char                                    *m_name;
     492
     493        btTransformFloatData    m_worldTransform;
     494        btTransformFloatData    m_interpolationWorldTransform;
     495        btVector3FloatData              m_interpolationLinearVelocity;
     496        btVector3FloatData              m_interpolationAngularVelocity;
     497        btVector3FloatData              m_anisotropicFriction;
     498        float                                   m_contactProcessingThreshold;   
     499        float                                   m_deactivationTime;
     500        float                                   m_friction;
     501        float                                   m_restitution;
     502        float                                   m_hitFraction;
     503        float                                   m_ccdSweptSphereRadius;
     504        float                                   m_ccdMotionThreshold;
     505
     506        int                                             m_hasAnisotropicFriction;
     507        int                                             m_collisionFlags;
     508        int                                             m_islandTag1;
     509        int                                             m_companionId;
     510        int                                             m_activationState1;
     511        int                                             m_internalType;
     512        int                                             m_checkCollideWith;
     513};
     514
     515
     516
     517SIMD_FORCE_INLINE       int     btCollisionObject::calculateSerializeBufferSize() const
     518{
     519        return sizeof(btCollisionObjectData);
     520}
     521
     522
     523
    421524#endif //COLLISION_OBJECT_H
  • code/trunk/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.cpp

    r5781 r8351  
    2727#include "BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h"
    2828#include "BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h"
    29 
     29#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
    3030#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
    3131#include "LinearMath/btAabbUtil2.h"
    3232#include "LinearMath/btQuickprof.h"
    3333#include "LinearMath/btStackAlloc.h"
     34#include "LinearMath/btSerializer.h"
    3435
    3536//#define USE_BRUTEFORCE_RAYBROADPHASE 1
     
    4344
    4445
     46///for debug drawing
     47
     48//for debug rendering
     49#include "BulletCollision/CollisionShapes/btBoxShape.h"
     50#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
     51#include "BulletCollision/CollisionShapes/btCompoundShape.h"
     52#include "BulletCollision/CollisionShapes/btConeShape.h"
     53#include "BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h"
     54#include "BulletCollision/CollisionShapes/btCylinderShape.h"
     55#include "BulletCollision/CollisionShapes/btMultiSphereShape.h"
     56#include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h"
     57#include "BulletCollision/CollisionShapes/btSphereShape.h"
     58#include "BulletCollision/CollisionShapes/btTriangleCallback.h"
     59#include "BulletCollision/CollisionShapes/btTriangleMeshShape.h"
     60#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"
     61
     62
     63
    4564btCollisionWorld::btCollisionWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache, btCollisionConfiguration* collisionConfiguration)
    4665:m_dispatcher1(dispatcher),
    4766m_broadphasePairCache(pairCache),
    48 m_debugDrawer(0)
     67m_debugDrawer(0),
     68m_forceUpdateAllAabbs(true)
    4969{
    5070        m_stackAlloc = collisionConfiguration->getStackAllocator();
     
    89109{
    90110
     111        btAssert(collisionObject);
     112
    91113        //check that the object isn't already added
    92                 btAssert( m_collisionObjects.findLinearSearch(collisionObject)  == m_collisionObjects.size());
    93 
    94                 m_collisionObjects.push_back(collisionObject);
    95 
    96                 //calculate new AABB
    97                 btTransform trans = collisionObject->getWorldTransform();
    98 
    99                 btVector3       minAabb;
    100                 btVector3       maxAabb;
    101                 collisionObject->getCollisionShape()->getAabb(trans,minAabb,maxAabb);
    102 
    103                 int type = collisionObject->getCollisionShape()->getShapeType();
    104                 collisionObject->setBroadphaseHandle( getBroadphase()->createProxy(
    105                         minAabb,
    106                         maxAabb,
    107                         type,
    108                         collisionObject,
    109                         collisionFilterGroup,
    110                         collisionFilterMask,
    111                         m_dispatcher1,0
    112                         ))      ;
     114        btAssert( m_collisionObjects.findLinearSearch(collisionObject)  == m_collisionObjects.size());
     115
     116        m_collisionObjects.push_back(collisionObject);
     117
     118        //calculate new AABB
     119        btTransform trans = collisionObject->getWorldTransform();
     120
     121        btVector3       minAabb;
     122        btVector3       maxAabb;
     123        collisionObject->getCollisionShape()->getAabb(trans,minAabb,maxAabb);
     124
     125        int type = collisionObject->getCollisionShape()->getShapeType();
     126        collisionObject->setBroadphaseHandle( getBroadphase()->createProxy(
     127                minAabb,
     128                maxAabb,
     129                type,
     130                collisionObject,
     131                collisionFilterGroup,
     132                collisionFilterMask,
     133                m_dispatcher1,0
     134                ))      ;
    113135
    114136
     
    163185
    164186                //only update aabb of active objects
    165                 if (colObj->isActive())
     187                if (m_forceUpdateAllAabbs || colObj->isActive())
    166188                {
    167189                        updateSingleAabb(colObj);
     
    226248
    227249void    btCollisionWorld::rayTestSingle(const btTransform& rayFromTrans,const btTransform& rayToTrans,
    228                                           btCollisionObject* collisionObject,
    229                                           const btCollisionShape* collisionShape,
    230                                           const btTransform& colObjWorldTransform,
    231                                           RayResultCallback& resultCallback)
     250                                                                                btCollisionObject* collisionObject,
     251                                                                                const btCollisionShape* collisionShape,
     252                                                                                const btTransform& colObjWorldTransform,
     253                                                                                RayResultCallback& resultCallback)
    232254{
    233255        btSphereShape pointShape(btScalar(0.0));
     
    237259        if (collisionShape->isConvex())
    238260        {
    239 //              BT_PROFILE("rayTestConvex");
     261                //              BT_PROFILE("rayTestConvex");
    240262                btConvexCast::CastResult castResult;
    241263                castResult.m_fraction = resultCallback.m_closestHitFraction;
     
    266288                                        btCollisionWorld::LocalRayResult localRayResult
    267289                                                (
    268                                                         collisionObject,
    269                                                         0,
    270                                                         castResult.m_normal,
    271                                                         castResult.m_fraction
     290                                                collisionObject,
     291                                                0,
     292                                                castResult.m_normal,
     293                                                castResult.m_fraction
    272294                                                );
    273295
     
    281303                if (collisionShape->isConcave())
    282304                {
    283 //                      BT_PROFILE("rayTestConcave");
     305                        //                      BT_PROFILE("rayTestConcave");
    284306                        if (collisionShape->getShapeType()==TRIANGLE_MESH_SHAPE_PROXYTYPE)
    285307                        {
     
    297319                                        btTriangleMeshShape*    m_triangleMesh;
    298320
     321                                        btTransform m_colObjWorldTransform;
     322
    299323                                        BridgeTriangleRaycastCallback( const btVector3& from,const btVector3& to,
    300                                                 btCollisionWorld::RayResultCallback* resultCallback, btCollisionObject* collisionObject,btTriangleMeshShape*    triangleMesh):
    301                   //@BP Mod
    302                                                 btTriangleRaycastCallback(from,to, resultCallback->m_flags),
    303                                                         m_resultCallback(resultCallback),
    304                                                         m_collisionObject(collisionObject),
    305                                                         m_triangleMesh(triangleMesh)
    306                                                 {
    307                                                 }
     324                                                btCollisionWorld::RayResultCallback* resultCallback, btCollisionObject* collisionObject,btTriangleMeshShape*    triangleMesh,const btTransform& colObjWorldTransform):
     325                                        //@BP Mod
     326                                        btTriangleRaycastCallback(from,to, resultCallback->m_flags),
     327                                                m_resultCallback(resultCallback),
     328                                                m_collisionObject(collisionObject),
     329                                                m_triangleMesh(triangleMesh),
     330                                                m_colObjWorldTransform(colObjWorldTransform)
     331                                        {
     332                                        }
    308333
    309334
     
    314339                                                shapeInfo.m_triangleIndex = triangleIndex;
    315340
     341                                                btVector3 hitNormalWorld = m_colObjWorldTransform.getBasis() * hitNormalLocal;
     342
    316343                                                btCollisionWorld::LocalRayResult rayResult
    317                                                 (m_collisionObject,
     344                                                        (m_collisionObject,
    318345                                                        &shapeInfo,
    319                                                         hitNormalLocal,
     346                                                        hitNormalWorld,
    320347                                                        hitFraction);
    321348
    322                                                 bool    normalInWorldSpace = false;
     349                                                bool    normalInWorldSpace = true;
    323350                                                return m_resultCallback->addSingleResult(rayResult,normalInWorldSpace);
    324351                                        }
     
    326353                                };
    327354
    328                                 BridgeTriangleRaycastCallback rcb(rayFromLocal,rayToLocal,&resultCallback,collisionObject,triangleMesh);
     355                                BridgeTriangleRaycastCallback rcb(rayFromLocal,rayToLocal,&resultCallback,collisionObject,triangleMesh,colObjWorldTransform);
    329356                                rcb.m_hitFraction = resultCallback.m_closestHitFraction;
    330357                                triangleMesh->performRaycast(&rcb,rayFromLocal,rayToLocal);
     
    347374                                        btConcaveShape* m_triangleMesh;
    348375
     376                                        btTransform m_colObjWorldTransform;
     377
    349378                                        BridgeTriangleRaycastCallback( const btVector3& from,const btVector3& to,
    350                                                 btCollisionWorld::RayResultCallback* resultCallback, btCollisionObject* collisionObject,btConcaveShape* triangleMesh):
    351                   //@BP Mod
    352                   btTriangleRaycastCallback(from,to, resultCallback->m_flags),
    353                                                         m_resultCallback(resultCallback),
    354                                                         m_collisionObject(collisionObject),
    355                                                         m_triangleMesh(triangleMesh)
    356                                                 {
    357                                                 }
     379                                                btCollisionWorld::RayResultCallback* resultCallback, btCollisionObject* collisionObject,btConcaveShape* triangleMesh, const btTransform& colObjWorldTransform):
     380                                        //@BP Mod
     381                                        btTriangleRaycastCallback(from,to, resultCallback->m_flags),
     382                                                m_resultCallback(resultCallback),
     383                                                m_collisionObject(collisionObject),
     384                                                m_triangleMesh(triangleMesh),
     385                                                m_colObjWorldTransform(colObjWorldTransform)
     386                                        {
     387                                        }
    358388
    359389
     
    364394                                                shapeInfo.m_triangleIndex = triangleIndex;
    365395
     396                                                btVector3 hitNormalWorld = m_colObjWorldTransform.getBasis() * hitNormalLocal;
     397
    366398                                                btCollisionWorld::LocalRayResult rayResult
    367                                                 (m_collisionObject,
     399                                                        (m_collisionObject,
    368400                                                        &shapeInfo,
    369                                                         hitNormalLocal,
     401                                                        hitNormalWorld,
    370402                                                        hitFraction);
    371403
    372                                                 bool    normalInWorldSpace = false;
     404                                                bool    normalInWorldSpace = true;
    373405                                                return m_resultCallback->addSingleResult(rayResult,normalInWorldSpace);
    374 
    375 
    376406                                        }
    377407
     
    379409
    380410
    381                                 BridgeTriangleRaycastCallback   rcb(rayFromLocal,rayToLocal,&resultCallback,collisionObject,concaveShape);
     411                                BridgeTriangleRaycastCallback   rcb(rayFromLocal,rayToLocal,&resultCallback,collisionObject,concaveShape, colObjWorldTransform);
    382412                                rcb.m_hitFraction = resultCallback.m_closestHitFraction;
    383413
     
    390420                        }
    391421                } else {
    392 //                      BT_PROFILE("rayTestCompound");
     422                        //                      BT_PROFILE("rayTestCompound");
    393423                        ///@todo: use AABB tree or other BVH acceleration structure, see btDbvt
    394424                        if (collisionShape->isCompound())
     
    404434                                        btCollisionShape* saveCollisionShape = collisionObject->getCollisionShape();
    405435                                        collisionObject->internalSetTemporaryCollisionShape((btCollisionShape*)childCollisionShape);
     436                    struct LocalInfoAdder2 : public RayResultCallback {
     437                                                RayResultCallback* m_userCallback;
     438                                                int m_i;
     439                        LocalInfoAdder2 (int i, RayResultCallback *user)
     440                                                        : m_userCallback(user),
     441                                                        m_i(i)
     442                                                {
     443                                                        m_closestHitFraction = m_userCallback->m_closestHitFraction;
     444                                                }
     445                                                virtual btScalar addSingleResult (btCollisionWorld::LocalRayResult &r, bool b)
     446                            {
     447                                    btCollisionWorld::LocalShapeInfo    shapeInfo;
     448                                    shapeInfo.m_shapePart = -1;
     449                                    shapeInfo.m_triangleIndex = m_i;
     450                                    if (r.m_localShapeInfo == NULL)
     451                                        r.m_localShapeInfo = &shapeInfo;
     452
     453                                                                        const btScalar result = m_userCallback->addSingleResult(r, b);
     454                                                                        m_closestHitFraction = m_userCallback->m_closestHitFraction;
     455                                                                        return result;
     456                            }
     457                    };
     458
     459                    LocalInfoAdder2 my_cb(i, &resultCallback);
     460
    406461                                        rayTestSingle(rayFromTrans,rayToTrans,
    407462                                                collisionObject,
    408463                                                childCollisionShape,
    409464                                                childWorldTrans,
    410                                                 resultCallback);
     465                                                my_cb);
    411466                                        // restore
    412467                                        collisionObject->internalSetTemporaryCollisionShape(saveCollisionShape);
     
    418473
    419474void    btCollisionWorld::objectQuerySingle(const btConvexShape* castShape,const btTransform& convexFromTrans,const btTransform& convexToTrans,
    420                                           btCollisionObject* collisionObject,
    421                                           const btCollisionShape* collisionShape,
    422                                           const btTransform& colObjWorldTransform,
    423                                           ConvexResultCallback& resultCallback, btScalar allowedPenetration)
     475                                                                                        btCollisionObject* collisionObject,
     476                                                                                        const btCollisionShape* collisionShape,
     477                                                                                        const btTransform& colObjWorldTransform,
     478                                                                                        ConvexResultCallback& resultCallback, btScalar allowedPenetration)
    424479{
    425480        if (collisionShape->isConvex())
     
    433488                btVoronoiSimplexSolver  simplexSolver;
    434489                btGjkEpaPenetrationDepthSolver  gjkEpaPenetrationSolver;
    435                
     490
    436491                btContinuousConvexCollision convexCaster1(castShape,convexShape,&simplexSolver,&gjkEpaPenetrationSolver);
    437492                //btGjkConvexCast convexCaster2(castShape,convexShape,&simplexSolver);
     
    439494
    440495                btConvexCast* castPtr = &convexCaster1;
    441        
    442        
    443                
     496
     497
     498
    444499                if (castPtr->calcTimeOfImpact(convexFromTrans,convexToTrans,colObjWorldTransform,colObjWorldTransform,castResult))
    445500                {
     
    451506                                        castResult.m_normal.normalize();
    452507                                        btCollisionWorld::LocalConvexResult localConvexResult
    453                                                                 (
    454                                                                         collisionObject,
    455                                                                         0,
    456                                                                         castResult.m_normal,
    457                                                                         castResult.m_hitPoint,
    458                                                                         castResult.m_fraction
    459                                                                 );
     508                                                (
     509                                                collisionObject,
     510                                                0,
     511                                                castResult.m_normal,
     512                                                castResult.m_hitPoint,
     513                                                castResult.m_fraction
     514                                                );
    460515
    461516                                        bool normalInWorldSpace = true;
     
    487542                                        BridgeTriangleConvexcastCallback(const btConvexShape* castShape, const btTransform& from,const btTransform& to,
    488543                                                btCollisionWorld::ConvexResultCallback* resultCallback, btCollisionObject* collisionObject,btTriangleMeshShape* triangleMesh, const btTransform& triangleToWorld):
    489                                                 btTriangleConvexcastCallback(castShape, from,to, triangleToWorld, triangleMesh->getMargin()),
    490                                                         m_resultCallback(resultCallback),
    491                                                         m_collisionObject(collisionObject),
    492                                                         m_triangleMesh(triangleMesh)
    493                                                 {
    494                                                 }
     544                                        btTriangleConvexcastCallback(castShape, from,to, triangleToWorld, triangleMesh->getMargin()),
     545                                                m_resultCallback(resultCallback),
     546                                                m_collisionObject(collisionObject),
     547                                                m_triangleMesh(triangleMesh)
     548                                        {
     549                                        }
    495550
    496551
     
    504559
    505560                                                        btCollisionWorld::LocalConvexResult convexResult
    506                                                         (m_collisionObject,
     561                                                                (m_collisionObject,
    507562                                                                &shapeInfo,
    508563                                                                hitNormalLocal,
     
    544599                                        BridgeTriangleConvexcastCallback(const btConvexShape* castShape, const btTransform& from,const btTransform& to,
    545600                                                btCollisionWorld::ConvexResultCallback* resultCallback, btCollisionObject* collisionObject,btConcaveShape*      triangleMesh, const btTransform& triangleToWorld):
    546                                                 btTriangleConvexcastCallback(castShape, from,to, triangleToWorld, triangleMesh->getMargin()),
    547                                                         m_resultCallback(resultCallback),
    548                                                         m_collisionObject(collisionObject),
    549                                                         m_triangleMesh(triangleMesh)
    550                                                 {
    551                                                 }
     601                                        btTriangleConvexcastCallback(castShape, from,to, triangleToWorld, triangleMesh->getMargin()),
     602                                                m_resultCallback(resultCallback),
     603                                                m_collisionObject(collisionObject),
     604                                                m_triangleMesh(triangleMesh)
     605                                        {
     606                                        }
    552607
    553608
     
    561616
    562617                                                        btCollisionWorld::LocalConvexResult convexResult
    563                                                         (m_collisionObject,
     618                                                                (m_collisionObject,
    564619                                                                &shapeInfo,
    565620                                                                hitNormalLocal,
     
    604659                                        btCollisionShape* saveCollisionShape = collisionObject->getCollisionShape();
    605660                                        collisionObject->internalSetTemporaryCollisionShape((btCollisionShape*)childCollisionShape);
     661                    struct      LocalInfoAdder : public ConvexResultCallback {
     662                            ConvexResultCallback* m_userCallback;
     663                                                        int m_i;
     664
     665                            LocalInfoAdder (int i, ConvexResultCallback *user)
     666                                                                : m_userCallback(user), m_i(i)
     667                                                        {
     668                                                                m_closestHitFraction = m_userCallback->m_closestHitFraction;
     669                                                        }
     670                            virtual btScalar addSingleResult (btCollisionWorld::LocalConvexResult&      r,      bool b)
     671                            {
     672                                    btCollisionWorld::LocalShapeInfo    shapeInfo;
     673                                    shapeInfo.m_shapePart = -1;
     674                                    shapeInfo.m_triangleIndex = m_i;
     675                                    if (r.m_localShapeInfo == NULL)
     676                                        r.m_localShapeInfo = &shapeInfo;
     677                                                                        const btScalar result = m_userCallback->addSingleResult(r, b);
     678                                                                        m_closestHitFraction = m_userCallback->m_closestHitFraction;
     679                                                                        return result;
     680                                   
     681                            }
     682                    };
     683
     684                    LocalInfoAdder my_cb(i, &resultCallback);
     685                                       
     686
    606687                                        objectQuerySingle(castShape, convexFromTrans,convexToTrans,
    607688                                                collisionObject,
    608689                                                childCollisionShape,
    609690                                                childWorldTrans,
    610                                                 resultCallback, allowedPenetration);
     691                                                my_cb, allowedPenetration);
    611692                                        // restore
    612693                                        collisionObject->internalSetTemporaryCollisionShape(saveCollisionShape);
     
    631712
    632713        btSingleRayCallback(const btVector3& rayFromWorld,const btVector3& rayToWorld,const btCollisionWorld* world,btCollisionWorld::RayResultCallback& resultCallback)
    633         :m_rayFromWorld(rayFromWorld),
    634         m_rayToWorld(rayToWorld),
    635         m_world(world),
    636         m_resultCallback(resultCallback)
     714                :m_rayFromWorld(rayFromWorld),
     715                m_rayToWorld(rayToWorld),
     716