Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4178 in orxonox.OLD for orxonox/branches


Ignore:
Timestamp:
May 13, 2005, 11:16:33 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/physics: merged the Trunk into the physics Branche again:
merged with command:
svn merge ../trunk physics -r 3953:HEAD
no important conflicts

Location:
orxonox/branches/physics
Files:
22 deleted
78 edited
48 copied

Legend:

Unmodified
Added
Removed
  • orxonox/branches/physics

    • Property svn:externals
      •  

        old new  
        1 data http://svn.orxonox.ethz.ch/data
         1
  • orxonox/branches/physics/ChangeLog

    r3790 r4178  
     12005-05-10      Benjamin Grauer <bensch@orxonox.ethz.ch>
     2        Merged the gui into the executable
     3        Windows compiles again.
     4
     52005-04-27      orxonox
     6        Tagged Version 0.2.3-pre-alpha
     7
     82005-04-23      Patrick Boenzli <patrick@orxonox.ethz.ch>
     9        Finished most work on Animation-classes
     10
     112005-04-21      Benjamin Grauer <bensch@orxonox.ethz.ch>
     12        Material Class update: possibility for transparency.
     13
     142005-04-15      Patrick Boenzli <partick@orxonox.ethz.ch>
     15        Added AnimationPlayer and two animation classes.
     16
     172005-04-07      Patrick Boenzli <patrick@orxonox.ethz.ch>
     18        Reimplemeted the Weapon and shoot-functions
     19
    1202005-03-31      Benjamin Grauer <bensch@orxonox.ethz.ch>
    221        Added Text Engine
  • orxonox/branches/physics/Makefile.in

    r3789 r4178  
    105105EXEEXT = @EXEEXT@
    106106GPROF = @GPROF@
    107 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
    108 GTHREAD_LIBS = @GTHREAD_LIBS@
    109107GTK2_CFLAGS = @GTK2_CFLAGS@
    110108GTK2_LIBS = @GTK2_LIBS@
    111109HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
    112110HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
    113 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
    114 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    115111HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    116112HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
     
    133129PACKAGE_VERSION = @PACKAGE_VERSION@
    134130PATH_SEPARATOR = @PATH_SEPARATOR@
     131PKG_CONFIG = @PKG_CONFIG@
     132RANLIB = @RANLIB@
    135133SET_MAKE = @SET_MAKE@
    136134SHELL = @SHELL@
     
    141139ac_ct_CC = @ac_ct_CC@
    142140ac_ct_CXX = @ac_ct_CXX@
     141ac_ct_RANLIB = @ac_ct_RANLIB@
    143142ac_ct_STRIP = @ac_ct_STRIP@
    144143am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
  • orxonox/branches/physics/config.h.in

    r3866 r4178  
    1818/* Define to 1 if you have the <GL/gl.h> header file. */
    1919#undef HAVE_GL_GL_H
    20 
    21 /* if we have gThread */
    22 #undef HAVE_GTHREAD
    2320
    2421/* if we have GTK2 */
     
    4340/* Define to 1 if you have the <OpenGL/gl.h> header file. */
    4441#undef HAVE_OPENGL_GL_H
    45 
    46 /* Define to 1 if you have the <pthread.h> header file. */
    47 #undef HAVE_PTHREAD_H
    4842
    4943/* Define to 1 if you have the <SDL.h> header file. */
  • orxonox/branches/physics/configure

    r3953 r4178  
    11#! /bin/sh
    22# Guess values for system-dependent variables and create Makefiles.
    3 # Generated by GNU Autoconf 2.59 for orxonox 0.2.2-pre-alpha.
     3# Generated by GNU Autoconf 2.59 for orxonox 0.2.3-pre-alpha.
    44#
    55# Report bugs to <orxonox-dev at mail.datacore.ch>.
     
    270270PACKAGE_NAME='orxonox'
    271271PACKAGE_TARNAME='orxonox'
    272 PACKAGE_VERSION='0.2.2-pre-alpha'
    273 PACKAGE_STRING='orxonox 0.2.2-pre-alpha'
     272PACKAGE_VERSION='0.2.3-pre-alpha'
     273PACKAGE_STRING='orxonox 0.2.3-pre-alpha'
    274274PACKAGE_BUGREPORT='orxonox-dev at mail.datacore.ch'
    275275
     
    312312#endif"
    313313
    314 ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP DEBUG SUB_PROJECTS_TRUE SUB_PROJECTS_FALSE DOCUMENTATION_TRUE DOCUMENTATION_FALSE DOXYGEN DOXYGEN_TRUE DOXYGEN_FALSE GPROF MSBITFIELDS GTK2_LIBS GTK2_CFLAGS HAVE_GTK2_TRUE HAVE_GTK2_FALSE GTHREAD_LIBS GTHREAD_CFLAGS HAVE_GTHREAD_TRUE HAVE_GTHREAD_FALSE CURL_LIBS CURL_CFLAGS HAVE_CURL_TRUE HAVE_CURL_FALSE LIBOBJS LTLIBOBJS'
     314ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE RANLIB ac_ct_RANLIB CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP DEBUG SUB_PROJECTS_TRUE SUB_PROJECTS_FALSE DOCUMENTATION_TRUE DOCUMENTATION_FALSE DOXYGEN DOXYGEN_TRUE DOXYGEN_FALSE GPROF PKG_CONFIG MSBITFIELDS GTK2_LIBS GTK2_CFLAGS HAVE_GTK2_TRUE HAVE_GTK2_FALSE CURL_LIBS CURL_CFLAGS HAVE_CURL_TRUE HAVE_CURL_FALSE LIBOBJS LTLIBOBJS'
    315315ac_subst_files=''
    316316
     
    789789  # This message is too long to be a string in the A/UX 3.1 sh.
    790790  cat <<_ACEOF
    791 \`configure' configures orxonox 0.2.2-pre-alpha to adapt to many kinds of systems.
     791\`configure' configures orxonox 0.2.3-pre-alpha to adapt to many kinds of systems.
    792792
    793793Usage: $0 [OPTION]... [VAR=VALUE]...
     
    856856if test -n "$ac_init_help"; then
    857857  case $ac_init_help in
    858      short | recursive ) echo "Configuration of orxonox 0.2.2-pre-alpha:";;
     858     short | recursive ) echo "Configuration of orxonox 0.2.3-pre-alpha:";;
    859859   esac
    860860  cat <<\_ACEOF
     
    879879  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
    880880  --without-gtk           Prevents GTK from being loaded
    881   --without-gthread       Prevents gThread from being loaded
    882   --without-pthread       Prevents pthread from being loaded
    883881  --without-curl          Prevents libcURL from being loaded
    884882
     
    993991if $ac_init_version; then
    994992  cat <<\_ACEOF
    995 orxonox configure 0.2.2-pre-alpha
     993orxonox configure 0.2.3-pre-alpha
    996994generated by GNU Autoconf 2.59
    997995
     
    10071005running configure, to aid debugging if configure makes a mistake.
    10081006
    1009 It was created by orxonox $as_me 0.2.2-pre-alpha, which was
     1007It was created by orxonox $as_me 0.2.3-pre-alpha, which was
    10101008generated by GNU Autoconf 2.59.  Invocation command line was
    10111009
     
    17271725# Define the identity of the package.
    17281726 PACKAGE='orxonox'
    1729  VERSION='0.2.2-pre-alpha'
     1727 VERSION='0.2.3-pre-alpha'
    17301728
    17311729
     
    25912589
    25922590
     2591if test -n "$ac_tool_prefix"; then
     2592  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
     2593set dummy ${ac_tool_prefix}ranlib; ac_word=$2
     2594echo "$as_me:$LINENO: checking for $ac_word" >&5
     2595echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
     2596if test "${ac_cv_prog_RANLIB+set}" = set; then
     2597  echo $ECHO_N "(cached) $ECHO_C" >&6
     2598else
     2599  if test -n "$RANLIB"; then
     2600  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
     2601else
     2602as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     2603for as_dir in $PATH
     2604do
     2605  IFS=$as_save_IFS
     2606  test -z "$as_dir" && as_dir=.
     2607  for ac_exec_ext in '' $ac_executable_extensions; do
     2608  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     2609    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
     2610    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     2611    break 2
     2612  fi
     2613done
     2614done
     2615
     2616fi
     2617fi
     2618RANLIB=$ac_cv_prog_RANLIB
     2619if test -n "$RANLIB"; then
     2620  echo "$as_me:$LINENO: result: $RANLIB" >&5
     2621echo "${ECHO_T}$RANLIB" >&6
     2622else
     2623  echo "$as_me:$LINENO: result: no" >&5
     2624echo "${ECHO_T}no" >&6
     2625fi
     2626
     2627fi
     2628if test -z "$ac_cv_prog_RANLIB"; then
     2629  ac_ct_RANLIB=$RANLIB
     2630  # Extract the first word of "ranlib", so it can be a program name with args.
     2631set dummy ranlib; ac_word=$2
     2632echo "$as_me:$LINENO: checking for $ac_word" >&5
     2633echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
     2634if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
     2635  echo $ECHO_N "(cached) $ECHO_C" >&6
     2636else
     2637  if test -n "$ac_ct_RANLIB"; then
     2638  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
     2639else
     2640as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     2641for as_dir in $PATH
     2642do
     2643  IFS=$as_save_IFS
     2644  test -z "$as_dir" && as_dir=.
     2645  for ac_exec_ext in '' $ac_executable_extensions; do
     2646  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     2647    ac_cv_prog_ac_ct_RANLIB="ranlib"
     2648    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     2649    break 2
     2650  fi
     2651done
     2652done
     2653
     2654  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
     2655fi
     2656fi
     2657ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
     2658if test -n "$ac_ct_RANLIB"; then
     2659  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
     2660echo "${ECHO_T}$ac_ct_RANLIB" >&6
     2661else
     2662  echo "$as_me:$LINENO: result: no" >&5
     2663echo "${ECHO_T}no" >&6
     2664fi
     2665
     2666  RANLIB=$ac_ct_RANLIB
     2667else
     2668  RANLIB="$ac_cv_prog_RANLIB"
     2669fi
     2670
    25932671ac_ext=c
    25942672ac_cpp='$CPP $CPPFLAGS'
     
    39264004
    39274005#------------------#
    3928 # gThread-disabled #
    3929 #------------------#
    3930 echo "$as_me:$LINENO: checking if gThread should be enabled" >&5
    3931 echo $ECHO_N "checking if gThread should be enabled... $ECHO_C" >&6
    3932 
    3933 # Check whether --with-gthread or --without-gthread was given.
    3934 if test "${with_gthread+set}" = set; then
    3935   withval="$with_gthread"
    3936   def_gthread=no
    3937 else
    3938   def_gthread=yes
    3939 fi;
    3940 if test x$def_gthread = xyes; then
    3941   echo "yes"
    3942 fi
    3943 if test x$def_gthread = xno; then
    3944   echo "no"
    3945 fi
    3946 
    3947 #------------------#
    3948 # pthread-disabled #
    3949 #------------------#
    3950 echo "$as_me:$LINENO: checking if pthread should be enabled" >&5
    3951 echo $ECHO_N "checking if pthread should be enabled... $ECHO_C" >&6
    3952 
    3953 # Check whether --with-pthread or --without-pthread was given.
    3954 if test "${with_pthread+set}" = set; then
    3955   withval="$with_pthread"
    3956   def_pthread=no
    3957 else
    3958   def_pthread=yes
    3959 fi;
    3960 if test x$def_pthread = xyes; then
    3961   echo "yes"
    3962 fi
    3963 if test x$def_pthread = xno; then
    3964   echo "no"
    3965 fi
    3966 
    3967 #------------------#
    39684006# libCurl-disabled #
    39694007#------------------#
     
    41754213  echo "$as_me:$LINENO: result: no" >&5
    41764214echo "${ECHO_T}no" >&6
     4215fi
     4216
     4217
     4218#-------------------------#
     4219# checking for pkg-config #
     4220#-------------------------#
     4221if test x$def_gtk = xyes; then
     4222 # Extract the first word of "pkg-config", so it can be a program name with args.
     4223set dummy pkg-config; ac_word=$2
     4224echo "$as_me:$LINENO: checking for $ac_word" >&5
     4225echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
     4226if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
     4227  echo $ECHO_N "(cached) $ECHO_C" >&6
     4228else
     4229  case $PKG_CONFIG in
     4230  [\\/]* | ?:[\\/]*)
     4231  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
     4232  ;;
     4233  *)
     4234  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     4235for as_dir in $PATH
     4236do
     4237  IFS=$as_save_IFS
     4238  test -z "$as_dir" && as_dir=.
     4239  for ac_exec_ext in '' $ac_executable_extensions; do
     4240  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     4241    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     4242    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     4243    break 2
     4244  fi
     4245done
     4246done
     4247
     4248  ;;
     4249esac
     4250fi
     4251PKG_CONFIG=$ac_cv_path_PKG_CONFIG
     4252
     4253if test -n "$PKG_CONFIG"; then
     4254  echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
     4255echo "${ECHO_T}$PKG_CONFIG" >&6
     4256else
     4257  echo "$as_me:$LINENO: result: no" >&5
     4258echo "${ECHO_T}no" >&6
     4259fi
     4260
    41774261fi
    41784262
     
    66366720#-----#
    66376721if test x$def_gtk = xyes; then
    6638 
    66396722        #PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no)
    66406723        echo "$as_me:$LINENO: checking for gtk2.0" >&5
    66416724echo $ECHO_N "checking for gtk2.0... $ECHO_C" >&6
    6642         if `pkg-config --exists gtk+-2.0`; then
     6725        if `$PKG_CONFIG --exists gtk+-2.0`; then
    66436726                echo "yes"
    66446727                have_gtk2=yes
    6645                 GTK2_LIBS=`pkg-config --libs gtk+-2.0`
    6646                 GTK2_CFLAGS=`pkg-config --cflags gtk+-2.0`
     6728                GTK2_LIBS=`$PKG_CONFIG --libs gtk+-2.0`
     6729                GTK2_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0`
    66476730
    66486731cat >>confdefs.h <<_ACEOF
     
    66506733_ACEOF
    66516734
     6735                if test $DEBUG -ge 3; then
     6736                 echo "cflags: $GTK2_CFLAGS"
     6737                 echo "libs: $GTK2_LIBS"
     6738                fi
    66526739        else
    66536740                echo "no"
     
    66656752  HAVE_GTK2_TRUE='#'
    66666753  HAVE_GTK2_FALSE=
    6667 fi
    6668 
    6669 
    6670 #---------#
    6671 # gThread #
    6672 #---------#
    6673 if test x$def_gthread = xyes; then
    6674 
    6675         echo "$as_me:$LINENO: checking for gthread" >&5
    6676 echo $ECHO_N "checking for gthread... $ECHO_C" >&6
    6677         if `pkg-config --exists gthread-2.0`; then
    6678                 echo "yes"
    6679                 have_gthread=yes
    6680                 GTHREAD_LIBS=`pkg-config --libs gthread-2.0`
    6681                 GTHREAD_CFLAGS=`pkg-config --cflags gthread-2.0`
    6682 
    6683 cat >>confdefs.h <<_ACEOF
    6684 #define HAVE_GTHREAD 1
    6685 _ACEOF
    6686 
    6687         else
    6688                 echo "no"
    6689         fi
    6690 
    6691 fi
    6692 
    6693 
    6694 
    6695 
    6696 if test x$have_gthread = xyes; then
    6697   HAVE_GTHREAD_TRUE=
    6698   HAVE_GTHREAD_FALSE='#'
    6699 else
    6700   HAVE_GTHREAD_TRUE='#'
    6701   HAVE_GTHREAD_FALSE=
    67026754fi
    67036755
     
    69497001
    69507002
    6951 #---------#
    6952 # pthread #
    6953 #---------#
    6954 if test x$def_pthread = xyes ; then
    6955  if test x$have_gthread = xyes ; then
    6956 
    6957 for ac_header in pthread.h
     7003#--------#
     7004# efence #
     7005#--------#
     7006if test x$def_efence = xyes ; then
     7007  echo "$as_me:$LINENO: checking for main in -lefence" >&5
     7008echo $ECHO_N "checking for main in -lefence... $ECHO_C" >&6
     7009if test "${ac_cv_lib_efence_main+set}" = set; then
     7010  echo $ECHO_N "(cached) $ECHO_C" >&6
     7011else
     7012  ac_check_lib_save_LIBS=$LIBS
     7013LIBS="-lefence  $LIBS"
     7014cat >conftest.$ac_ext <<_ACEOF
     7015/* confdefs.h.  */
     7016_ACEOF
     7017cat confdefs.h >>conftest.$ac_ext
     7018cat >>conftest.$ac_ext <<_ACEOF
     7019/* end confdefs.h.  */
     7020
     7021
     7022int
     7023main ()
     7024{
     7025main ();
     7026  ;
     7027  return 0;
     7028}
     7029_ACEOF
     7030rm -f conftest.$ac_objext conftest$ac_exeext
     7031if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     7032  (eval $ac_link) 2>conftest.er1
     7033  ac_status=$?
     7034  grep -v '^ *+' conftest.er1 >conftest.err
     7035  rm -f conftest.er1
     7036  cat conftest.err >&5
     7037  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7038  (exit $ac_status); } &&
     7039         { ac_try='test -z "$ac_c_werror_flag"
     7040                         || test ! -s conftest.err'
     7041  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7042  (eval $ac_try) 2>&5
     7043  ac_status=$?
     7044  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7045  (exit $ac_status); }; } &&
     7046         { ac_try='test -s conftest$ac_exeext'
     7047  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7048  (eval $ac_try) 2>&5
     7049  ac_status=$?
     7050  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7051  (exit $ac_status); }; }; then
     7052  ac_cv_lib_efence_main=yes
     7053else
     7054  echo "$as_me: failed program was:" >&5
     7055sed 's/^/| /' conftest.$ac_ext >&5
     7056
     7057ac_cv_lib_efence_main=no
     7058fi
     7059rm -f conftest.err conftest.$ac_objext \
     7060      conftest$ac_exeext conftest.$ac_ext
     7061LIBS=$ac_check_lib_save_LIBS
     7062fi
     7063echo "$as_me:$LINENO: result: $ac_cv_lib_efence_main" >&5
     7064echo "${ECHO_T}$ac_cv_lib_efence_main" >&6
     7065if test $ac_cv_lib_efence_main = yes; then
     7066  FOUND_efence=yes
     7067fi
     7068
     7069   if test x$FOUND_efence = xyes ; then
     7070      LIBS="$LIBS -lefence"
     7071   fi
     7072
     7073fi
     7074
     7075# FIXME: Replace `main' with a function in `-lm':
     7076
     7077echo "$as_me:$LINENO: checking for main in -lm" >&5
     7078echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
     7079if test "${ac_cv_lib_m_main+set}" = set; then
     7080  echo $ECHO_N "(cached) $ECHO_C" >&6
     7081else
     7082  ac_check_lib_save_LIBS=$LIBS
     7083LIBS="-lm  $LIBS"
     7084cat >conftest.$ac_ext <<_ACEOF
     7085/* confdefs.h.  */
     7086_ACEOF
     7087cat confdefs.h >>conftest.$ac_ext
     7088cat >>conftest.$ac_ext <<_ACEOF
     7089/* end confdefs.h.  */
     7090
     7091
     7092int
     7093main ()
     7094{
     7095main ();
     7096  ;
     7097  return 0;
     7098}
     7099_ACEOF
     7100rm -f conftest.$ac_objext conftest$ac_exeext
     7101if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     7102  (eval $ac_link) 2>conftest.er1
     7103  ac_status=$?
     7104  grep -v '^ *+' conftest.er1 >conftest.err
     7105  rm -f conftest.er1
     7106  cat conftest.err >&5
     7107  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7108  (exit $ac_status); } &&
     7109         { ac_try='test -z "$ac_c_werror_flag"
     7110                         || test ! -s conftest.err'
     7111  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7112  (eval $ac_try) 2>&5
     7113  ac_status=$?
     7114  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7115  (exit $ac_status); }; } &&
     7116         { ac_try='test -s conftest$ac_exeext'
     7117  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7118  (eval $ac_try) 2>&5
     7119  ac_status=$?
     7120  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7121  (exit $ac_status); }; }; then
     7122  ac_cv_lib_m_main=yes
     7123else
     7124  echo "$as_me: failed program was:" >&5
     7125sed 's/^/| /' conftest.$ac_ext >&5
     7126
     7127ac_cv_lib_m_main=no
     7128fi
     7129rm -f conftest.err conftest.$ac_objext \
     7130      conftest$ac_exeext conftest.$ac_ext
     7131LIBS=$ac_check_lib_save_LIBS
     7132fi
     7133echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5
     7134echo "${ECHO_T}$ac_cv_lib_m_main" >&6
     7135if test $ac_cv_lib_m_main = yes; then
     7136  cat >>confdefs.h <<_ACEOF
     7137#define HAVE_LIBM 1
     7138_ACEOF
     7139
     7140  LIBS="-lm $LIBS"
     7141
     7142fi
     7143
     7144
     7145
     7146# Checks for header files.
     7147echo "$as_me:$LINENO: checking for ANSI C header files" >&5
     7148echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
     7149if test "${ac_cv_header_stdc+set}" = set; then
     7150  echo $ECHO_N "(cached) $ECHO_C" >&6
     7151else
     7152  cat >conftest.$ac_ext <<_ACEOF
     7153/* confdefs.h.  */
     7154_ACEOF
     7155cat confdefs.h >>conftest.$ac_ext
     7156cat >>conftest.$ac_ext <<_ACEOF
     7157/* end confdefs.h.  */
     7158#include <stdlib.h>
     7159#include <stdarg.h>
     7160#include <string.h>
     7161#include <float.h>
     7162
     7163int
     7164main ()
     7165{
     7166
     7167  ;
     7168  return 0;
     7169}
     7170_ACEOF
     7171rm -f conftest.$ac_objext
     7172if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     7173  (eval $ac_compile) 2>conftest.er1
     7174  ac_status=$?
     7175  grep -v '^ *+' conftest.er1 >conftest.err
     7176  rm -f conftest.er1
     7177  cat conftest.err >&5
     7178  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7179  (exit $ac_status); } &&
     7180         { ac_try='test -z "$ac_c_werror_flag"
     7181                         || test ! -s conftest.err'
     7182  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7183  (eval $ac_try) 2>&5
     7184  ac_status=$?
     7185  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7186  (exit $ac_status); }; } &&
     7187         { ac_try='test -s conftest.$ac_objext'
     7188  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7189  (eval $ac_try) 2>&5
     7190  ac_status=$?
     7191  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7192  (exit $ac_status); }; }; then
     7193  ac_cv_header_stdc=yes
     7194else
     7195  echo "$as_me: failed program was:" >&5
     7196sed 's/^/| /' conftest.$ac_ext >&5
     7197
     7198ac_cv_header_stdc=no
     7199fi
     7200rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     7201
     7202if test $ac_cv_header_stdc = yes; then
     7203  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
     7204  cat >conftest.$ac_ext <<_ACEOF
     7205/* confdefs.h.  */
     7206_ACEOF
     7207cat confdefs.h >>conftest.$ac_ext
     7208cat >>conftest.$ac_ext <<_ACEOF
     7209/* end confdefs.h.  */
     7210#include <string.h>
     7211
     7212_ACEOF
     7213if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
     7214  $EGREP "memchr" >/dev/null 2>&1; then
     7215  :
     7216else
     7217  ac_cv_header_stdc=no
     7218fi
     7219rm -f conftest*
     7220
     7221fi
     7222
     7223if test $ac_cv_header_stdc = yes; then
     7224  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
     7225  cat >conftest.$ac_ext <<_ACEOF
     7226/* confdefs.h.  */
     7227_ACEOF
     7228cat confdefs.h >>conftest.$ac_ext
     7229cat >>conftest.$ac_ext <<_ACEOF
     7230/* end confdefs.h.  */
     7231#include <stdlib.h>
     7232
     7233_ACEOF
     7234if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
     7235  $EGREP "free" >/dev/null 2>&1; then
     7236  :
     7237else
     7238  ac_cv_header_stdc=no
     7239fi
     7240rm -f conftest*
     7241
     7242fi
     7243
     7244if test $ac_cv_header_stdc = yes; then
     7245  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
     7246  if test "$cross_compiling" = yes; then
     7247  :
     7248else
     7249  cat >conftest.$ac_ext <<_ACEOF
     7250/* confdefs.h.  */
     7251_ACEOF
     7252cat confdefs.h >>conftest.$ac_ext
     7253cat >>conftest.$ac_ext <<_ACEOF
     7254/* end confdefs.h.  */
     7255#include <ctype.h>
     7256#if ((' ' & 0x0FF) == 0x020)
     7257# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
     7258# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
     7259#else
     7260# define ISLOWER(c) \
     7261                   (('a' <= (c) && (c) <= 'i') \
     7262                     || ('j' <= (c) && (c) <= 'r') \
     7263                     || ('s' <= (c) && (c) <= 'z'))
     7264# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
     7265#endif
     7266
     7267#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
     7268int
     7269main ()
     7270{
     7271  int i;
     7272  for (i = 0; i < 256; i++)
     7273    if (XOR (islower (i), ISLOWER (i))
     7274        || toupper (i) != TOUPPER (i))
     7275      exit(2);
     7276  exit (0);
     7277}
     7278_ACEOF
     7279rm -f conftest$ac_exeext
     7280if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     7281  (eval $ac_link) 2>&5
     7282  ac_status=$?
     7283  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7284  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
     7285  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7286  (eval $ac_try) 2>&5
     7287  ac_status=$?
     7288  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7289  (exit $ac_status); }; }; then
     7290  :
     7291else
     7292  echo "$as_me: program exited with status $ac_status" >&5
     7293echo "$as_me: failed program was:" >&5
     7294sed 's/^/| /' conftest.$ac_ext >&5
     7295
     7296( exit $ac_status )
     7297ac_cv_header_stdc=no
     7298fi
     7299rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
     7300fi
     7301fi
     7302fi
     7303echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
     7304echo "${ECHO_T}$ac_cv_header_stdc" >&6
     7305if test $ac_cv_header_stdc = yes; then
     7306
     7307cat >>confdefs.h <<\_ACEOF
     7308#define STDC_HEADERS 1
     7309_ACEOF
     7310
     7311fi
     7312
     7313
     7314
     7315for ac_header in stdlib.h string.h
    69587316do
    69597317as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
     
    70997457#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
    71007458_ACEOF
    7101  pthreadHeader="yes"
    7102 else
    7103   pthreadHeader="no"
     7459
    71047460fi
    71057461
    71067462done
    71077463
    7108   echo "$as_me:$LINENO: checking for main in -lpthread" >&5
    7109 echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6
    7110 if test "${ac_cv_lib_pthread_main+set}" = set; then
     7464
     7465# Checks for typedefs, structures, and compiler characteristics.
     7466echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5
     7467echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6
     7468if test "${ac_cv_header_stdbool_h+set}" = set; then
    71117469  echo $ECHO_N "(cached) $ECHO_C" >&6
    71127470else
    7113   ac_check_lib_save_LIBS=$LIBS
    7114 LIBS="-lpthread  $LIBS"
    7115 cat >conftest.$ac_ext <<_ACEOF
     7471  cat >conftest.$ac_ext <<_ACEOF
    71167472/* confdefs.h.  */
    71177473_ACEOF
     
    71207476/* end confdefs.h.  */
    71217477
     7478#include <stdbool.h>
     7479#ifndef bool
     7480# error bool is not defined
     7481#endif
     7482#ifndef false
     7483# error false is not defined
     7484#endif
     7485#if false
     7486# error false is not 0
     7487#endif
     7488#ifndef true
     7489# error true is not defined
     7490#endif
     7491#if true != 1
     7492# error true is not 1
     7493#endif
     7494#ifndef __bool_true_false_are_defined
     7495# error __bool_true_false_are_defined is not defined
     7496#endif
     7497
     7498        struct s { _Bool s: 1; _Bool t; } s;
     7499
     7500        char a[true == 1 ? 1 : -1];
     7501        char b[false == 0 ? 1 : -1];
     7502        char c[__bool_true_false_are_defined == 1 ? 1 : -1];
     7503        char d[(bool) -0.5 == true ? 1 : -1];
     7504        bool e = &s;
     7505        char f[(_Bool) -0.0 == false ? 1 : -1];
     7506        char g[true];
     7507        char h[sizeof (_Bool)];
     7508        char i[sizeof s.t];
    71227509
    71237510int
    71247511main ()
    71257512{
    7126 main ();
     7513 return !a + !b + !c + !d + !e + !f + !g + !h + !i;
    71277514  ;
    71287515  return 0;
    71297516}
    71307517_ACEOF
    7131 rm -f conftest.$ac_objext conftest$ac_exeext
    7132 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
    7133   (eval $ac_link) 2>conftest.er1
     7518rm -f conftest.$ac_objext
     7519if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     7520  (eval $ac_compile) 2>conftest.er1
    71347521  ac_status=$?
    71357522  grep -v '^ *+' conftest.er1 >conftest.err
     
    71457532  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    71467533  (exit $ac_status); }; } &&
    7147          { ac_try='test -s conftest$ac_exeext'
     7534         { ac_try='test -s conftest.$ac_objext'
    71487535  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    71497536  (eval $ac_try) 2>&5
     
    71517538  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    71527539  (exit $ac_status); }; }; then
    7153   ac_cv_lib_pthread_main=yes
     7540  ac_cv_header_stdbool_h=yes
    71547541else
    71557542  echo "$as_me: failed program was:" >&5
    71567543sed 's/^/| /' conftest.$ac_ext >&5
    71577544
    7158 ac_cv_lib_pthread_main=no
    7159 fi
    7160 rm -f conftest.err conftest.$ac_objext \
    7161       conftest$ac_exeext conftest.$ac_ext
    7162 LIBS=$ac_check_lib_save_LIBS
    7163 fi
    7164 echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5
    7165 echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6
    7166 if test $ac_cv_lib_pthread_main = yes; then
    7167   FOUND_pthread=yes
    7168 fi
    7169 
    7170    if test x$FOUND_pthread = xyes ; then
    7171       LIBS="$LIBS -lpthread"
    7172    fi
    7173  fi
    7174 fi
    7175 
    7176 
    7177 #--------#
    7178 # efence #
    7179 #--------#
    7180 if test x$def_efence = xyes ; then
    7181   echo "$as_me:$LINENO: checking for main in -lefence" >&5
    7182 echo $ECHO_N "checking for main in -lefence... $ECHO_C" >&6
    7183 if test "${ac_cv_lib_efence_main+set}" = set; then
     7545ac_cv_header_stdbool_h=no
     7546fi
     7547rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     7548fi
     7549echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
     7550echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6
     7551echo "$as_me:$LINENO: checking for _Bool" >&5
     7552echo $ECHO_N "checking for _Bool... $ECHO_C" >&6
     7553if test "${ac_cv_type__Bool+set}" = set; then
    71847554  echo $ECHO_N "(cached) $ECHO_C" >&6
    71857555else
    7186   ac_check_lib_save_LIBS=$LIBS
    7187 LIBS="-lefence  $LIBS"
    7188 cat >conftest.$ac_ext <<_ACEOF
     7556  cat >conftest.$ac_ext <<_ACEOF
    71897557/* confdefs.h.  */
    71907558_ACEOF
     
    71927560cat >>conftest.$ac_ext <<_ACEOF
    71937561/* end confdefs.h.  */
    7194 
    7195 
     7562$ac_includes_default
    71967563int
    71977564main ()
    71987565{
    7199 main ();
     7566if ((_Bool *) 0)
     7567  return 0;
     7568if (sizeof (_Bool))
     7569  return 0;
    72007570  ;
    72017571  return 0;
    72027572}
    72037573_ACEOF
    7204 rm -f conftest.$ac_objext conftest$ac_exeext
    7205 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
    7206   (eval $ac_link) 2>conftest.er1
     7574rm -f conftest.$ac_objext
     7575if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     7576  (eval $ac_compile) 2>conftest.er1
    72077577  ac_status=$?
    72087578  grep -v '^ *+' conftest.er1 >conftest.err
     
    72187588  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    72197589  (exit $ac_status); }; } &&
    7220          { ac_try='test -s conftest$ac_exeext'
    7221   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    7222   (eval $ac_try) 2>&5
    7223   ac_status=$?
    7224   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7225   (exit $ac_status); }; }; then
    7226   ac_cv_lib_efence_main=yes
    7227 else
    7228   echo "$as_me: failed program was:" >&5
    7229 sed 's/^/| /' conftest.$ac_ext >&5
    7230 
    7231 ac_cv_lib_efence_main=no
    7232 fi
    7233 rm -f conftest.err conftest.$ac_objext \
    7234       conftest$ac_exeext conftest.$ac_ext
    7235 LIBS=$ac_check_lib_save_LIBS
    7236 fi
    7237 echo "$as_me:$LINENO: result: $ac_cv_lib_efence_main" >&5
    7238 echo "${ECHO_T}$ac_cv_lib_efence_main" >&6
    7239 if test $ac_cv_lib_efence_main = yes; then
    7240   FOUND_efence=yes
    7241 fi
    7242 
    7243    if test x$FOUND_efence = xyes ; then
    7244       LIBS="$LIBS -lefence"
    7245    fi
    7246 
    7247 fi
    7248 
    7249 # FIXME: Replace `main' with a function in `-lm':
    7250 
    7251 echo "$as_me:$LINENO: checking for main in -lm" >&5
    7252 echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
    7253 if test "${ac_cv_lib_m_main+set}" = set; then
    7254   echo $ECHO_N "(cached) $ECHO_C" >&6
    7255 else
    7256   ac_check_lib_save_LIBS=$LIBS
    7257 LIBS="-lm  $LIBS"
    7258 cat >conftest.$ac_ext <<_ACEOF
    7259 /* confdefs.h.  */
    7260 _ACEOF
    7261 cat confdefs.h >>conftest.$ac_ext
    7262 cat >>conftest.$ac_ext <<_ACEOF
    7263 /* end confdefs.h.  */
    7264 
    7265 
    7266 int
    7267 main ()
    7268 {
    7269 main ();
    7270   ;
    7271   return 0;
    7272 }
    7273 _ACEOF
    7274 rm -f conftest.$ac_objext conftest$ac_exeext
    7275 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
    7276   (eval $ac_link) 2>conftest.er1
    7277   ac_status=$?
    7278   grep -v '^ *+' conftest.er1 >conftest.err
    7279   rm -f conftest.er1
    7280   cat conftest.err >&5
    7281   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7282   (exit $ac_status); } &&
    7283          { ac_try='test -z "$ac_c_werror_flag"
    7284                          || test ! -s conftest.err'
    7285   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    7286   (eval $ac_try) 2>&5
    7287   ac_status=$?
    7288   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7289   (exit $ac_status); }; } &&
    7290          { ac_try='test -s conftest$ac_exeext'
    7291   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    7292   (eval $ac_try) 2>&5
    7293   ac_status=$?
    7294   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7295   (exit $ac_status); }; }; then
    7296   ac_cv_lib_m_main=yes
    7297 else
    7298   echo "$as_me: failed program was:" >&5
    7299 sed 's/^/| /' conftest.$ac_ext >&5
    7300 
    7301 ac_cv_lib_m_main=no
    7302 fi
    7303 rm -f conftest.err conftest.$ac_objext \
    7304       conftest$ac_exeext conftest.$ac_ext
    7305 LIBS=$ac_check_lib_save_LIBS
    7306 fi
    7307 echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5
    7308 echo "${ECHO_T}$ac_cv_lib_m_main" >&6
    7309 if test $ac_cv_lib_m_main = yes; then
    7310   cat >>confdefs.h <<_ACEOF
    7311 #define HAVE_LIBM 1
    7312 _ACEOF
    7313 
    7314   LIBS="-lm $LIBS"
    7315 
    7316 fi
    7317 
    7318 
    7319 
    7320 # Checks for header files.
    7321 echo "$as_me:$LINENO: checking for ANSI C header files" >&5
    7322 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
    7323 if test "${ac_cv_header_stdc+set}" = set; then
    7324   echo $ECHO_N "(cached) $ECHO_C" >&6
    7325 else
    7326   cat >conftest.$ac_ext <<_ACEOF
    7327 /* confdefs.h.  */
    7328 _ACEOF
    7329 cat confdefs.h >>conftest.$ac_ext
    7330 cat >>conftest.$ac_ext <<_ACEOF
    7331 /* end confdefs.h.  */
    7332 #include <stdlib.h>
    7333 #include <stdarg.h>
    7334 #include <string.h>
    7335 #include <float.h>
    7336 
    7337 int
    7338 main ()
    7339 {
    7340 
    7341   ;
    7342   return 0;
    7343 }
    7344 _ACEOF
    7345 rm -f conftest.$ac_objext
    7346 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    7347   (eval $ac_compile) 2>conftest.er1
    7348   ac_status=$?
    7349   grep -v '^ *+' conftest.er1 >conftest.err
    7350   rm -f conftest.er1
    7351   cat conftest.err >&5
    7352   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7353   (exit $ac_status); } &&
    7354          { ac_try='test -z "$ac_c_werror_flag"
    7355                          || test ! -s conftest.err'
    7356   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    7357   (eval $ac_try) 2>&5
    7358   ac_status=$?
    7359   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7360   (exit $ac_status); }; } &&
    73617590         { ac_try='test -s conftest.$ac_objext'
    73627591  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     
    73657594  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    73667595  (exit $ac_status); }; }; then
    7367   ac_cv_header_stdc=yes
     7596  ac_cv_type__Bool=yes
    73687597else
    73697598  echo "$as_me: failed program was:" >&5
    73707599sed 's/^/| /' conftest.$ac_ext >&5
    73717600
    7372 ac_cv_header_stdc=no
     7601ac_cv_type__Bool=no
    73737602fi
    73747603rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    7375 
    7376 if test $ac_cv_header_stdc = yes; then
    7377   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
    7378   cat >conftest.$ac_ext <<_ACEOF
    7379 /* confdefs.h.  */
    7380 _ACEOF
    7381 cat confdefs.h >>conftest.$ac_ext
    7382 cat >>conftest.$ac_ext <<_ACEOF
    7383 /* end confdefs.h.  */
    7384 #include <string.h>
    7385 
    7386 _ACEOF
    7387 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
    7388   $EGREP "memchr" >/dev/null 2>&1; then
    7389   :
    7390 else
    7391   ac_cv_header_stdc=no
    7392 fi
    7393 rm -f conftest*
    7394 
    7395 fi
    7396 
    7397 if test $ac_cv_header_stdc = yes; then
    7398   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
    7399   cat >conftest.$ac_ext <<_ACEOF
    7400 /* confdefs.h.  */
    7401 _ACEOF
    7402 cat confdefs.h >>conftest.$ac_ext
    7403 cat >>conftest.$ac_ext <<_ACEOF
    7404 /* end confdefs.h.  */
    7405 #include <stdlib.h>
    7406 
    7407 _ACEOF
    7408 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
    7409   $EGREP "free" >/dev/null 2>&1; then
    7410   :
    7411 else
    7412   ac_cv_header_stdc=no
    7413 fi
    7414 rm -f conftest*
    7415 
    7416 fi
    7417 
    7418 if test $ac_cv_header_stdc = yes; then
    7419   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
    7420   if test "$cross_compiling" = yes; then
    7421   :
    7422 else
    7423   cat >conftest.$ac_ext <<_ACEOF
    7424 /* confdefs.h.  */
    7425 _ACEOF
    7426 cat confdefs.h >>conftest.$ac_ext
    7427 cat >>conftest.$ac_ext <<_ACEOF
    7428 /* end confdefs.h.  */
    7429 #include <ctype.h>
    7430 #if ((' ' & 0x0FF) == 0x020)
    7431 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
    7432 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
    7433 #else
    7434 # define ISLOWER(c) \
    7435                    (('a' <= (c) && (c) <= 'i') \
    7436                      || ('j' <= (c) && (c) <= 'r') \
    7437                      || ('s' <= (c) && (c) <= 'z'))
    7438 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
    7439 #endif
    7440 
    7441 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
    7442 int
    7443 main ()
    7444 {
    7445   int i;
    7446   for (i = 0; i < 256; i++)
    7447     if (XOR (islower (i), ISLOWER (i))
    7448         || toupper (i) != TOUPPER (i))
    7449       exit(2);
    7450   exit (0);
    7451 }
    7452 _ACEOF
    7453 rm -f conftest$ac_exeext
    7454 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
    7455   (eval $ac_link) 2>&5
    7456   ac_status=$?
    7457   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7458   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
    7459   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    7460   (eval $ac_try) 2>&5
    7461   ac_status=$?
    7462   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7463   (exit $ac_status); }; }; then
    7464   :
    7465 else
    7466   echo "$as_me: program exited with status $ac_status" >&5
    7467 echo "$as_me: failed program was:" >&5
    7468 sed 's/^/| /' conftest.$ac_ext >&5
    7469 
    7470 ( exit $ac_status )
    7471 ac_cv_header_stdc=no
    7472 fi
    7473 rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
    7474 fi
    7475 fi
    7476 fi
    7477 echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
    7478 echo "${ECHO_T}$ac_cv_header_stdc" >&6
    7479 if test $ac_cv_header_stdc = yes; then
     7604fi
     7605echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
     7606echo "${ECHO_T}$ac_cv_type__Bool" >&6
     7607if test $ac_cv_type__Bool = yes; then
     7608
     7609cat >>confdefs.h <<_ACEOF
     7610#define HAVE__BOOL 1
     7611_ACEOF
     7612
     7613
     7614fi
     7615
     7616if test $ac_cv_header_stdbool_h = yes; then
    74807617
    74817618cat >>confdefs.h <<\_ACEOF
    7482 #define STDC_HEADERS 1
    7483 _ACEOF
    7484 
    7485 fi
    7486 
    7487 
    7488 
    7489 for ac_header in stdlib.h string.h
     7619#define HAVE_STDBOOL_H 1
     7620_ACEOF
     7621
     7622fi
     7623
     7624
     7625# Checks for library functions.
     7626
     7627for ac_header in stdlib.h
    74907628do
    74917629as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
     
    76367774done
    76377775
    7638 
    7639 # Checks for typedefs, structures, and compiler characteristics.
    7640 echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5
    7641 echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6
    7642 if test "${ac_cv_header_stdbool_h+set}" = set; then
    7643   echo $ECHO_N "(cached) $ECHO_C" >&6
    7644 else
    7645   cat >conftest.$ac_ext <<_ACEOF
    7646 /* confdefs.h.  */
    7647 _ACEOF
    7648 cat confdefs.h >>conftest.$ac_ext
    7649 cat >>conftest.$ac_ext <<_ACEOF
    7650 /* end confdefs.h.  */
    7651 
    7652 #include <stdbool.h>
    7653 #ifndef bool
    7654 # error bool is not defined
    7655 #endif
    7656 #ifndef false
    7657 # error false is not defined
    7658 #endif
    7659 #if false
    7660 # error false is not 0
    7661 #endif
    7662 #ifndef true
    7663 # error true is not defined
    7664 #endif
    7665 #if true != 1
    7666 # error true is not 1
    7667 #endif
    7668 #ifndef __bool_true_false_are_defined
    7669 # error __bool_true_false_are_defined is not defined
    7670 #endif
    7671 
    7672         struct s { _Bool s: 1; _Bool t; } s;
    7673 
    7674         char a[true == 1 ? 1 : -1];
    7675         char b[false == 0 ? 1 : -1];
    7676         char c[__bool_true_false_are_defined == 1 ? 1 : -1];
    7677         char d[(bool) -0.5 == true ? 1 : -1];
    7678         bool e = &s;
    7679         char f[(_Bool) -0.0 == false ? 1 : -1];
    7680         char g[true];
    7681         char h[sizeof (_Bool)];
    7682         char i[sizeof s.t];
    7683 
    7684 int
    7685 main ()
    7686 {
    7687  return !a + !b + !c + !d + !e + !f + !g + !h + !i;
    7688   ;
    7689   return 0;
    7690 }
    7691 _ACEOF
    7692 rm -f conftest.$ac_objext
    7693 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    7694   (eval $ac_compile) 2>conftest.er1
    7695   ac_status=$?
    7696   grep -v '^ *+' conftest.er1 >conftest.err
    7697   rm -f conftest.er1
    7698   cat conftest.err >&5
    7699   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7700   (exit $ac_status); } &&
    7701          { ac_try='test -z "$ac_c_werror_flag"
    7702                          || test ! -s conftest.err'
    7703   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    7704   (eval $ac_try) 2>&5
    7705   ac_status=$?
    7706   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7707   (exit $ac_status); }; } &&
    7708          { ac_try='test -s conftest.$ac_objext'
    7709   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    7710   (eval $ac_try) 2>&5
    7711   ac_status=$?
    7712   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7713   (exit $ac_status); }; }; then
    7714   ac_cv_header_stdbool_h=yes
    7715 else
    7716   echo "$as_me: failed program was:" >&5
    7717 sed 's/^/| /' conftest.$ac_ext >&5
    7718 
    7719 ac_cv_header_stdbool_h=no
    7720 fi
    7721 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    7722 fi
    7723 echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
    7724 echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6
    7725 echo "$as_me:$LINENO: checking for _Bool" >&5
    7726 echo $ECHO_N "checking for _Bool... $ECHO_C" >&6
    7727 if test "${ac_cv_type__Bool+set}" = set; then
    7728   echo $ECHO_N "(cached) $ECHO_C" >&6
    7729 else
    7730   cat >conftest.$ac_ext <<_ACEOF
    7731 /* confdefs.h.  */
    7732 _ACEOF
    7733 cat confdefs.h >>conftest.$ac_ext
    7734 cat >>conftest.$ac_ext <<_ACEOF
    7735 /* end confdefs.h.  */
    7736 $ac_includes_default
    7737 int
    7738 main ()
    7739 {
    7740 if ((_Bool *) 0)
    7741   return 0;
    7742 if (sizeof (_Bool))
    7743   return 0;
    7744   ;
    7745   return 0;
    7746 }
    7747 _ACEOF
    7748 rm -f conftest.$ac_objext
    7749 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    7750   (eval $ac_compile) 2>conftest.er1
    7751   ac_status=$?
    7752   grep -v '^ *+' conftest.er1 >conftest.err
    7753   rm -f conftest.er1
    7754   cat conftest.err >&5
    7755   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7756   (exit $ac_status); } &&
    7757          { ac_try='test -z "$ac_c_werror_flag"
    7758                          || test ! -s conftest.err'
    7759   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    7760   (eval $ac_try) 2>&5
    7761   ac_status=$?
    7762   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7763   (exit $ac_status); }; } &&
    7764          { ac_try='test -s conftest.$ac_objext'
    7765   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    7766   (eval $ac_try) 2>&5
    7767   ac_status=$?
    7768   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7769   (exit $ac_status); }; }; then
    7770   ac_cv_type__Bool=yes
    7771 else
    7772   echo "$as_me: failed program was:" >&5
    7773 sed 's/^/| /' conftest.$ac_ext >&5
    7774 
    7775 ac_cv_type__Bool=no
    7776 fi
    7777 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    7778 fi
    7779 echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
    7780 echo "${ECHO_T}$ac_cv_type__Bool" >&6
    7781 if test $ac_cv_type__Bool = yes; then
    7782 
    7783 cat >>confdefs.h <<_ACEOF
    7784 #define HAVE__BOOL 1
    7785 _ACEOF
    7786 
    7787 
    7788 fi
    7789 
    7790 if test $ac_cv_header_stdbool_h = yes; then
    7791 
    7792 cat >>confdefs.h <<\_ACEOF
    7793 #define HAVE_STDBOOL_H 1
    7794 _ACEOF
    7795 
    7796 fi
    7797 
    7798 
    7799 # Checks for library functions.
    7800 
    7801 for ac_header in stdlib.h
    7802 do
    7803 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
    7804 if eval "test \"\${$as_ac_Header+set}\" = set"; then
    7805   echo "$as_me:$LINENO: checking for $ac_header" >&5
    7806 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
    7807 if eval "test \"\${$as_ac_Header+set}\" = set"; then
    7808   echo $ECHO_N "(cached) $ECHO_C" >&6
    7809 fi
    7810 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
    7811 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
    7812 else
    7813   # Is the header compilable?
    7814 echo "$as_me:$LINENO: checking $ac_header usability" >&5
    7815 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
    7816 cat >conftest.$ac_ext <<_ACEOF
    7817 /* confdefs.h.  */
    7818 _ACEOF
    7819 cat confdefs.h >>conftest.$ac_ext
    7820 cat >>conftest.$ac_ext <<_ACEOF
    7821 /* end confdefs.h.  */
    7822 $ac_includes_default
    7823 #include <$ac_header>
    7824 _ACEOF
    7825 rm -f conftest.$ac_objext
    7826 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    7827   (eval $ac_compile) 2>conftest.er1
    7828   ac_status=$?
    7829   grep -v '^ *+' conftest.er1 >conftest.err
    7830   rm -f conftest.er1
    7831   cat conftest.err >&5
    7832   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7833   (exit $ac_status); } &&
    7834          { ac_try='test -z "$ac_c_werror_flag"
    7835                          || test ! -s conftest.err'
    7836   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    7837   (eval $ac_try) 2>&5
    7838   ac_status=$?
    7839   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7840   (exit $ac_status); }; } &&
    7841          { ac_try='test -s conftest.$ac_objext'
    7842   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    7843   (eval $ac_try) 2>&5
    7844   ac_status=$?
    7845   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7846   (exit $ac_status); }; }; then
    7847   ac_header_compiler=yes
    7848 else
    7849   echo "$as_me: failed program was:" >&5
    7850 sed 's/^/| /' conftest.$ac_ext >&5
    7851 
    7852 ac_header_compiler=no
    7853 fi
    7854 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    7855 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
    7856 echo "${ECHO_T}$ac_header_compiler" >&6
    7857 
    7858 # Is the header present?
    7859 echo "$as_me:$LINENO: checking $ac_header presence" >&5
    7860 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
    7861 cat >conftest.$ac_ext <<_ACEOF
    7862 /* confdefs.h.  */
    7863 _ACEOF
    7864 cat confdefs.h >>conftest.$ac_ext
    7865 cat >>conftest.$ac_ext <<_ACEOF
    7866 /* end confdefs.h.  */
    7867 #include <$ac_header>
    7868 _ACEOF
    7869 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
    7870   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
    7871   ac_status=$?
    7872   grep -v '^ *+' conftest.er1 >conftest.err
    7873   rm -f conftest.er1
    7874   cat conftest.err >&5
    7875   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    7876   (exit $ac_status); } >/dev/null; then
    7877   if test -s conftest.err; then
    7878     ac_cpp_err=$ac_c_preproc_warn_flag
    7879     ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
    7880   else
    7881     ac_cpp_err=
    7882   fi
    7883 else
    7884   ac_cpp_err=yes
    7885 fi
    7886 if test -z "$ac_cpp_err"; then
    7887   ac_header_preproc=yes
    7888 else
    7889   echo "$as_me: failed program was:" >&5
    7890 sed 's/^/| /' conftest.$ac_ext >&5
    7891 
    7892   ac_header_preproc=no
    7893 fi
    7894 rm -f conftest.err conftest.$ac_ext
    7895 echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
    7896 echo "${ECHO_T}$ac_header_preproc" >&6
    7897 
    7898 # So?  What about this header?
    7899 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
    7900   yes:no: )
    7901     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
    7902 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
    7903     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
    7904 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
    7905     ac_header_preproc=yes
    7906     ;;
    7907   no:yes:* )
    7908     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
    7909 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
    7910     { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
    7911 echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
    7912     { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
    7913 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
    7914     { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
    7915 echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
    7916     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
    7917 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
    7918     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
    7919 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
    7920     (
    7921       cat <<\_ASBOX
    7922 ## ---------------------------------------------- ##
    7923 ## Report this to orxonox-dev at mail.datacore.ch ##
    7924 ## ---------------------------------------------- ##
    7925 _ASBOX
    7926     ) |
    7927       sed "s/^/$as_me: WARNING:     /" >&2
    7928     ;;
    7929 esac
    7930 echo "$as_me:$LINENO: checking for $ac_header" >&5
    7931 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
    7932 if eval "test \"\${$as_ac_Header+set}\" = set"; then
    7933   echo $ECHO_N "(cached) $ECHO_C" >&6
    7934 else
    7935   eval "$as_ac_Header=\$ac_header_preproc"
    7936 fi
    7937 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
    7938 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
    7939 
    7940 fi
    7941 if test `eval echo '${'$as_ac_Header'}'` = yes; then
    7942   cat >>confdefs.h <<_ACEOF
    7943 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
    7944 _ACEOF
    7945 
    7946 fi
    7947 
    7948 done
    7949 
    79507776echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5
    79517777echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6
     
    82768102Usually this means the macro was only invoked conditionally." >&5
    82778103echo "$as_me: error: conditional \"HAVE_GTK2\" was never defined.
    8278 Usually this means the macro was only invoked conditionally." >&2;}
    8279    { (exit 1); exit 1; }; }
    8280 fi
    8281 if test -z "${HAVE_GTHREAD_TRUE}" && test -z "${HAVE_GTHREAD_FALSE}"; then
    8282   { { echo "$as_me:$LINENO: error: conditional \"HAVE_GTHREAD\" was never defined.
    8283 Usually this means the macro was only invoked conditionally." >&5
    8284 echo "$as_me: error: conditional \"HAVE_GTHREAD\" was never defined.
    82858104Usually this means the macro was only invoked conditionally." >&2;}
    82868105   { (exit 1); exit 1; }; }
     
    85648383cat >&5 <<_CSEOF
    85658384
    8566 This file was extended by orxonox $as_me 0.2.2-pre-alpha, which was
     8385This file was extended by orxonox $as_me 0.2.3-pre-alpha, which was
    85678386generated by GNU Autoconf 2.59.  Invocation command line was
    85688387
     
    86278446cat >>$CONFIG_STATUS <<_ACEOF
    86288447ac_cs_version="\\
    8629 orxonox config.status 0.2.2-pre-alpha
     8448orxonox config.status 0.2.3-pre-alpha
    86308449configured by $0, generated by GNU Autoconf 2.59,
    86318450  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
     
    88828701s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t
    88838702s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t
     8703s,@RANLIB@,$RANLIB,;t t
     8704s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
    88848705s,@CC@,$CC,;t t
    88858706s,@CFLAGS@,$CFLAGS,;t t
     
    88998720s,@DOXYGEN_FALSE@,$DOXYGEN_FALSE,;t t
    89008721s,@GPROF@,$GPROF,;t t
     8722s,@PKG_CONFIG@,$PKG_CONFIG,;t t
    89018723s,@MSBITFIELDS@,$MSBITFIELDS,;t t
    89028724s,@GTK2_LIBS@,$GTK2_LIBS,;t t
     
    89048726s,@HAVE_GTK2_TRUE@,$HAVE_GTK2_TRUE,;t t
    89058727s,@HAVE_GTK2_FALSE@,$HAVE_GTK2_FALSE,;t t
    8906 s,@GTHREAD_LIBS@,$GTHREAD_LIBS,;t t
    8907 s,@GTHREAD_CFLAGS@,$GTHREAD_CFLAGS,;t t
    8908 s,@HAVE_GTHREAD_TRUE@,$HAVE_GTHREAD_TRUE,;t t
    8909 s,@HAVE_GTHREAD_FALSE@,$HAVE_GTHREAD_FALSE,;t t
    89108728s,@CURL_LIBS@,$CURL_LIBS,;t t
    89118729s,@CURL_CFLAGS@,$CURL_CFLAGS,;t t
  • orxonox/branches/physics/configure.ac

    r3953 r4178  
    2323#########################
    2424AC_PREREQ(2.56)
    25 AC_INIT(orxonox, 0.2.2-pre-alpha, [orxonox-dev at mail.datacore.ch])
     25AC_INIT(orxonox, 0.2.3-pre-alpha, [orxonox-dev at mail.datacore.ch])
    2626
    2727## Detect the canonical host and target build environment.
     
    3939#########################
    4040AC_PROG_CXX
     41AC_PROG_RANLIB
    4142AC_HEADER_STDC
    4243
     
    9697fi
    9798if test x$def_gtk = xno; then
    98   echo "no"
    99 fi
    100 
    101 #------------------#
    102 # gThread-disabled #
    103 #------------------#
    104 AC_MSG_CHECKING([if gThread should be enabled])
    105 AC_ARG_WITH([gthread],
    106         AC_HELP_STRING( [--without-gthread],
    107         [Prevents gThread from being loaded]), [def_gthread=no], [def_gthread=yes])
    108 if test x$def_gthread = xyes; then
    109   echo "yes"
    110 fi
    111 if test x$def_gthread = xno; then
    112   echo "no"
    113 fi
    114 
    115 #------------------#
    116 # pthread-disabled #
    117 #------------------#
    118 AC_MSG_CHECKING([if pthread should be enabled])
    119 AC_ARG_WITH([pthread],
    120         AC_HELP_STRING( [--without-pthread],
    121         [Prevents pthread from being loaded]), [def_pthread=no], [def_pthread=yes])
    122 if test x$def_pthread = xyes; then
    123   echo "yes"
    124 fi
    125 if test x$def_pthread = xno; then
    12699  echo "no"
    127100fi
     
    218191#--------------------#
    219192AC_PATH_PROG(GPROF, gprof)
     193
     194#-------------------------#
     195# checking for pkg-config #
     196#-------------------------#
     197if test x$def_gtk = xyes; then
     198 AC_PATH_PROG(PKG_CONFIG, pkg-config)
     199fi
     200
    220201
    221202#########################
     
    462443#-----#
    463444if test x$def_gtk = xyes; then
    464 
    465445        #PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no)
    466446        AC_MSG_CHECKING([for gtk2.0])
    467         if `pkg-config --exists gtk+-2.0`; then
     447        if `$PKG_CONFIG --exists gtk+-2.0`; then
    468448                echo "yes"
    469449                have_gtk2=yes
    470                 GTK2_LIBS=`pkg-config --libs gtk+-2.0`
    471                 GTK2_CFLAGS=`pkg-config --cflags gtk+-2.0`
     450                GTK2_LIBS=`$PKG_CONFIG --libs gtk+-2.0`
     451                GTK2_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0`
    472452                AC_DEFINE_UNQUOTED(HAVE_GTK2, 1, [if we have GTK2])
     453                if test $DEBUG -ge 3; then
     454                 echo "cflags: $GTK2_CFLAGS"
     455                 echo "libs: $GTK2_LIBS"
     456                fi
    473457        else
    474458                echo "no"
     
    479463AC_SUBST(GTK2_CFLAGS)
    480464AM_CONDITIONAL(HAVE_GTK2, test x$have_gtk2 = xyes)
    481 
    482 #---------#
    483 # gThread #
    484 #---------#
    485 if test x$def_gthread = xyes; then
    486 
    487         AC_MSG_CHECKING([for gthread])
    488         if `pkg-config --exists gthread-2.0`; then
    489                 echo "yes"
    490                 have_gthread=yes
    491                 GTHREAD_LIBS=`pkg-config --libs gthread-2.0`
    492                 GTHREAD_CFLAGS=`pkg-config --cflags gthread-2.0`
    493                 AC_DEFINE_UNQUOTED(HAVE_GTHREAD, 1, [if we have gThread])
    494         else
    495                 echo "no"
    496         fi
    497 
    498 fi
    499 AC_SUBST(GTHREAD_LIBS)
    500 AC_SUBST(GTHREAD_CFLAGS)
    501 AM_CONDITIONAL(HAVE_GTHREAD, test x$have_gthread = xyes)
    502465
    503466#---------#
     
    521484AC_SUBST(CURL_CFLAGS)
    522485AM_CONDITIONAL(HAVE_CURL, test x$have_curl = xyes)
    523 
    524 #---------#
    525 # pthread #
    526 #---------#
    527 if test x$def_pthread = xyes ; then
    528  if test x$have_gthread = xyes ; then
    529   AC_CHECK_HEADERS([pthread.h], [pthreadHeader="yes"], [pthreadHeader="no"])
    530   AC_CHECK_LIB([pthread], [main], [FOUND_pthread=yes])
    531    if test x$FOUND_pthread = xyes ; then
    532       LIBS="$LIBS -lpthread"
    533    fi
    534  fi
    535 fi
    536 
    537486
    538487#--------#
  • orxonox/branches/physics/src/Makefile.am

    r3961 r4178  
    88AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics
    99AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/importer
     10AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/particles
    1011AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/gui
     12AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/gui/gui
    1113AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/lang
    1214AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/util
     
    2123AM_CXXFLAGS+=-I$(MAINSRCDIR)/util/common
    2224AM_CXXFLAGS+=-I$(MAINSRCDIR)/util/physics
    23 
    24 
    25 AM_LDFLAGS= $(MWINDOWS)
     25AM_CXXFLAGS+=-I$(MAINSRCDIR)/subprojects
     26
     27
    2628
    2729#"-O3 -pedantic -fPIC -ffast-math -I/usr/X11R6/include"
    2830
    2931
    30 bin_PROGRAMS=orxonox
    31 
     32bin_PROGRAMS=orxonox
     33noinst_LIBRARIES = libORXgui.a
     34
     35orxonox_DEPENDENCIES = libORXgui.a
     36orxonox_LDADD = libORXgui.a $(GTK2_LIBS) $(GTHREAD_LIBS) $(CURL_LIBS)
    3237orxonox_SOURCES= orxonox.cc \
    3338                 game_loader.cc \
     
    3742                 track_manager.cc \
    3843                 track_node.cc \
     44                 factory.cc \
    3945                 util/animation/animation.cc \
    4046                 util/animation/animation3d.cc \
     
    7076                 lib/graphics/importer/material.cc \
    7177                 lib/graphics/importer/texture.cc \
     78                 lib/graphics/particles/particle_engine.cc \
     79                 lib/graphics/particles/particle_system.cc \
     80                 lib/graphics/particles/particle_emitter.cc \
    7281                 lib/lang/base_entity.cc \
    7382                 lib/lang/base_object.cc \
     
    8291                 lib/math/vector.cc \
    8392                 lib/math/curve.cc \
    84                  glmenu/glmenu_imagescreen.cc
     93                 glmenu/glmenu_imagescreen.cc \
     94                 lib/xmlparser/tinyxml.cc \
     95                 lib/xmlparser/tinystr.cc \
     96                 lib/xmlparser/tinyxmlerror.cc \
     97                 lib/xmlparser/tinyxmlparser.cc \
     98                 subprojects/benchmark.cc
    8599
    86100noinst_HEADERS = orxonox.h \
     
    125139                 defs/error.h \
    126140                 defs/debug.h \
     141                 defs/globals.h \
    127142                 lib/coord/p_node.h \
    128143                 lib/coord/null_parent.h \
     
    131146                 lib/graphics/light.h \
    132147                 lib/graphics/text_engine.h \
     148                 lib/graphics/particles/particle_engine.h \
     149                 lib/graphics/particles/particle_system.h \
     150                 lib/graphics/particles/particle_emitter.h \
    133151                 lib/data/data_tank.h \
    134152                 lib/lang/base_entity.h \
     
    140158                 util/physics/physics_engine.h \
    141159                 util/physics/physical_interaction.h \
    142                  util/physics/physical_interaction_sym.h \
     160                 util/physics/physical_interaction_sym.h \
    143161                 util/physics/physical_interaction_asym.h \
    144162                 lib/util/ini_parser.h \
    145163                 lib/math/vector.h \
    146164                 lib/math/curve.h \
    147                  glmenu/glmenu_imagescreen.h
     165                 glmenu/glmenu_imagescreen.h \
     166                 lib/gui/gui/gui.h \
     167                 lib/gui/gui/gui_gtk.h \
     168                 lib/gui/gui/gui_element.h \
     169                 lib/gui/gui/gui_video.h \
     170                 lib/gui/gui/gui_audio.h \
     171                 lib/gui/gui/gui_exec.h \
     172                 lib/gui/gui/gui_flags.h \
     173                 lib/gui/gui/gui_banner.h \
     174                 lib/gui/gui/gui_keys.h \
     175                 lib/gui/gui/gui_update.h \
     176                 subprojects/benchmark.h
     177
     178libORXgui_a_CPPFLAGS=$(GTK2_CFLAGS) $(GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS)
     179
     180libORXgui_a_SOURCES = lib/gui/gui/gui.cc \
     181                            lib/gui/gui/gui_gtk.cc \
     182                            lib/gui/gui/gui_element.cc \
     183                            lib/gui/gui/gui_video.cc \
     184                            lib/gui/gui/gui_audio.cc \
     185                            lib/gui/gui/gui_exec.cc \
     186                            lib/gui/gui/gui_flags.cc \
     187                            lib/gui/gui/gui_banner.cc \
     188                            lib/gui/gui/gui_keys.cc \
     189                            lib/gui/gui/gui_update.cc
    148190
    149191
  • orxonox/branches/physics/src/command_node.cc

    r3654 r4178  
    5757  this->bEnabled = true;
    5858  this->world = NULL;
    59   this->loadBindings (filename);
     59  this->loadBindings(filename);
    6060}
    6161
     
    111111   \param filename: The path and name of the file to load the bindings from
    112112*/
    113 void CommandNode::loadBindings (char* filename)
     113void CommandNode::loadBindings (char* filename = DEFAULT_KEYBIND_FILE)
    114114{
    115115  FILE* stream;
    116116 
    117117  PRINTF(4)("Loading key bindings from %s\n", filename);
    118  
    119   if( filename == NULL) filename = DEFAULT_KEYBIND_FILE;
    120118 
    121119  // remove old bindings if present
     
    128126  // create parser
    129127  IniParser parser (filename);
    130   if( parser.getSection ("Bindings") == -1)
    131     {
    132       PRINTF(1)("Could not find key bindings in %s\n", filename);
     128  if( parser.getSection (CONFIG_SECTION_PLAYER "1") == -1)
     129    {
     130      PRINTF(1)("Could not find key bindings " CONFIG_SECTION_PLAYER"1 in %s\n", filename);
    133131      return;
    134132    }
     
    144142  while( parser.nextVar (namebuf, valuebuf) != -1)
    145143    {
    146       index = nameToIndex (namebuf);
     144      index = nameToIndex (valuebuf);
    147145      switch( index[0])
    148146        {
    149147        case 0:
    150           PRINTF(4)("Key binding %d(%s) set to %s\n", index[1], SDLKToKeyname( index[1]), valuebuf);
    151           strcpy (aliases->keys[index[1]], valuebuf);
     148          PRINTF(4)("Key binding %d(%s) set to %s\n", index[1], SDLKToKeyname( index[1]), namebuf);
     149          strcpy (aliases->keys[index[1]], namebuf);
    152150          break;
    153151        case 1:
    154           PRINTF(4)("Button binding %d(%s) set to %s\n", index[1], SDLBToButtonname( index[1]), valuebuf);
    155           strcpy (aliases->buttons[index[1]], valuebuf);
     152          PRINTF(4)("Button binding %d(%s) set to %s\n", index[1], SDLBToButtonname( index[1]), namebuf);
     153          strcpy (aliases->buttons[index[1]], namebuf);
    156154          break;
    157155        default:
     
    161159      memset (valuebuf, 0, 256);
    162160    }
     161
     162
     163  // PARSE MISC SECTION
     164  if( parser.getSection (CONFIG_SECTION_MISC_KEYS) == -1)
     165    {
     166      PRINTF(1)("Could not find key bindings in %s\n", filename);
     167      return;
     168    }
     169
     170  while( parser.nextVar (namebuf, valuebuf) != -1)
     171    {
     172      index = nameToIndex (valuebuf);
     173      switch( index[0])
     174        {
     175        case 0:
     176          PRINTF(4)("Key binding %d(%s) set to %s\n", index[1], SDLKToKeyname( index[1]), namebuf);
     177          strcpy (aliases->keys[index[1]], namebuf);
     178          break;
     179        case 1:
     180          PRINTF(4)("Button binding %d(%s) set to %s\n", index[1], SDLBToButtonname( index[1]), namebuf);
     181          strcpy (aliases->buttons[index[1]], namebuf);
     182          break;
     183        default:
     184          break;
     185        }
     186      memset (namebuf, 0, 256);
     187      memset (valuebuf, 0, 256);
     188    }
     189
    163190}
    164191
  • orxonox/branches/physics/src/command_node.h

    r3608 r4178  
    1818#define N_STD_KEYS SDLK_LAST
    1919#define N_BUTTONS 6
    20 #define DEFAULT_KEYBIND_FILE "default.ini"
     20#define DEFAULT_KEYBIND_FILE "~/.orxonox/orxonox.conf"
    2121
    2222//! Key aliasing structure
  • orxonox/branches/physics/src/defs/debug.h

    r3953 r4178  
    5959#define DEBUG_MODULE_PNODE              1
    6060#define DEBUG_MODULE_WORLD_ENTITY       0
    61 #define DEBUG_MODULE_COMMAND_NODE       0
     61#define DEBUG_MODULE_COMMAND_NODE       4
    6262#define DEBUG_MODULE_GRAPHICS           0
    63 #define DEBUG_MODULE_LOAD               0
    64 
    65 #define DEBUG_MODULE_IMPORTER           1
     63#define DEBUG_MODULE_LOAD               2
     64
     65#define DEBUG_MODULE_IMPORTER           3
    6666#define DEBUG_MODULE_TRACK_MANAGER      0
    6767#define DEBUG_MODULE_GARBAGE_COLLECTOR  0
     
    7272#define DEBUG_MODULE_FONT               1
    7373#define DEBUG_MODULE_ANIM               1
     74#define DEBUG_MODULE_PARTICLE           4
    7475
    7576#define DEBUG_MODULE_NULL_PARENT        0
  • orxonox/branches/physics/src/defs/stdincl.h

    r3863 r4178  
    2525#include "error.h"
    2626#include "debug.h"
     27#include "globals.h"
    2728
    2829#include "compiler.h"
     30#include "xmlparser/tinyxml.h"
     31#include "factory.h"
    2932
    3033#endif /* _STDINCL_H */
  • orxonox/branches/physics/src/game_loader.cc

    r3727 r4178  
    2525#include "command_node.h"
    2626#include "vector.h"
     27#include "resource_manager.h"
     28#include "factory.h"
    2729
    2830#include <string.h>
     
    3537
    3638
    37 GameLoader::GameLoader () {}
     39GameLoader::GameLoader ()
     40{
     41  first = NULL;
     42}
    3843
    3944
     
    7277{
    7378  ErrorMessage errorCode;
    74  
    75   this->currentCampaign = this->fileToCampaign(name);
     79  char* campaignName;
     80  if (ResourceManager::isFile(name))
     81    {
     82      this->currentCampaign = this->fileToCampaign(name);
     83    }
     84  else
     85    {
     86      campaignName = new char[strlen(ResourceManager::getInstance()->getDataDir())+strlen(name)];
     87      sprintf(campaignName, "%s%s", ResourceManager::getInstance()->getDataDir(), name);
     88      this->currentCampaign = this->fileToCampaign(campaignName);
     89      delete campaignName;
     90    }
    7691}
    7792
     
    158173   this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns
    159174*/
    160 Campaign* GameLoader::fileToCampaign(char *name)
     175Campaign* GameLoader::fileToCampaign(const char *name)
    161176{
    162177  /* do not entirely load the campaign. just the current world
     
    164179     can load everything it needs into memory then.
    165180  */
     181 
     182  if( name == NULL)
     183    {
     184      PRINTF(2)("No filename specified for loading");
     185      return NULL;
     186    }
     187 
     188  TiXmlDocument* XMLDoc = new TiXmlDocument( name);
     189  // load the campaign document
     190  if( !XMLDoc->LoadFile())
     191    {
     192      // report an error
     193      PRINTF(1)("Could not load XML File %s: %s @ %d:%d\n", name, XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
     194      delete XMLDoc;
     195      return NULL;
     196    }
     197       
     198  // check basic validity
     199  TiXmlElement* root = XMLDoc->RootElement();
     200  assert( root != NULL);
     201       
     202  if( strcmp( root->Value(), "Campaign"))
     203    {
     204      // report an error
     205      PRINTF(2)("Specified XML File is not an orxonox campaign file (Campaign element missing)\n");
     206      delete XMLDoc;
     207      return NULL;
     208    }
     209       
     210  // construct campaign
     211  Campaign* c = new Campaign( root);
     212       
     213  // free the XML data
     214  delete XMLDoc;
     215       
     216  return c;
    166217}
    167218
     
    174225bool GameLoader::worldCommand (Command* cmd)
    175226{
    176   if( !strcmp( cmd->cmd, "up_world"))
     227  if( !strcmp( cmd->cmd, CONFIG_NAME_NEXT_WORLD))
    177228    {
    178229      if( !cmd->bUp)
     
    182233      return true;
    183234    }
    184   else if( !strcmp( cmd->cmd, "down_world"))
     235  else if( !strcmp( cmd->cmd, CONFIG_NAME_PREV_WORLD))
    185236    {
    186237      if( !cmd->bUp)
     
    190241      return true;
    191242    }
    192   else if( !strcmp( cmd->cmd, "pause"))
     243  else if( !strcmp( cmd->cmd, CONFIG_NAME_PAUSE))
    193244    {
    194245      if( !cmd->bUp)
     
    201252      return true;
    202253    }
    203   else if( !strcmp( cmd->cmd, "quit"))
     254  else if( !strcmp( cmd->cmd, CONFIG_NAME_QUIT))
    204255    {
    205256      if( !cmd->bUp) this->stop();
     
    230281    this->currentCampaign->previousLevel();
    231282}
     283
     284/**
     285   \brief add a Factory to the Factory Q
     286   \param factory a Factory to be registered
     287*/
     288void GameLoader::registerFactory( Factory* factory)
     289{
     290        assert( factory != NULL);
     291       
     292        PRINTF(4)("Registered factory for '%s'\n", factory->getFactoryName());
     293       
     294        if( first == NULL) first = factory;
     295        else first->registerFactory( factory);
     296}
     297
     298/**
     299   \brief load a StoryEntity
     300   \param element a XMLElement containing all the needed info
     301*/
     302BaseObject* GameLoader::fabricate( TiXmlElement* element)
     303{
     304  assert( element != NULL);
     305       
     306  if( first == NULL)
     307    {
     308      PRINTF(1)("GameLoader does not know any factories, fabricate() failed\n");
     309      return NULL;
     310    }
     311       
     312  if( element->Value() != NULL)
     313    {
     314      PRINTF(4)("Attempting fabrication of a '%s'\n", element->Value());
     315      BaseObject* b = first->fabricate( element);
     316      if( b == NULL)
     317        PRINTF(2)("Failed to fabricate a '%s'\n", element->Value());
     318      else
     319        PRINTF(4)("Successfully fabricated a '%s'\n", element->Value());
     320      return b;
     321    }
     322       
     323  PRINTF(2)("Fabricate failed, TiXmlElement did not contain a value\n");
     324       
     325  return NULL;
     326}
  • orxonox/branches/physics/src/game_loader.h

    r3629 r4178  
    1010#include "story_def.h"
    1111#include "comincl.h"
     12
    1213
    1314//-----------------------------------------------------------------------------
     
    5152  ErrorMessage loadDebugCampaign(Uint32 campaignID);
    5253 
     54  void registerFactory( Factory* factory);
     55  BaseObject* fabricate( TiXmlElement* data);
     56
    5357 private:
    5458  GameLoader ();
     
    6064  Campaign* currentCampaign; //!> the current campaign playing
    6165 
    62   Campaign* fileToCampaign(char* name);
     66  Campaign* fileToCampaign(const char* name);
    6367
     68  Factory* first;
    6469};
    6570
  • orxonox/branches/physics/src/glmenu/glmenu_imagescreen.cc

    r3729 r4178  
    2020
    2121#include "stdincl.h"
     22#include "graphics_engine.h"
    2223#include "material.h"
    2324
     25CREATE_FACTORY(GLMenuImageScreen);
     26
     27
    2428using namespace std;
    25 
    26 GLMenuImageScreen* GLMenuImageScreen::singletonRef = 0;
    27 
    28 GLMenuImageScreen* GLMenuImageScreen::getInstance()
    29 {
    30   if(!singletonRef)
    31     singletonRef = new GLMenuImageScreen ();
    32   return singletonRef;
    33 }
    34 
    3529/**
    3630   \brief standard constructor
    37 
    38    \todo this constructor is not jet implemented - do it
    3931*/
    4032GLMenuImageScreen::GLMenuImageScreen ()
    4133{
    42    this->setClassName ("GLMenuImageScreen");
    4334   this->init();
    4435}
    4536
     37/**
     38   \param root The Element to load the GLMenu from
     39*/
     40GLMenuImageScreen::GLMenuImageScreen (TiXmlElement* root)
     41{
     42  this->init();
     43  this->load(root);
     44
     45}
     46
     47/**
     48   \brief Loads a GLMenu from an inputElement
     49   \param root The Element to load the GLMenu from
     50
     51   Tags are:
     52   \li BackgroundImage STRING: the background Image
     53   \li BarImage: STRING: the Image on the Bar
     54   \li BackgroundPS: FLOAT FLOAT FLOAT FLOAT: posX posY scaleX scaleY
     55   \li BarPS: FLOAT FLOAT FLOAT FLOAT: posX posY scaleX scaleY
     56   \li ElementCount: INT: how many elements will be loaded
     57*/
     58void GLMenuImageScreen::load(TiXmlElement* root)
     59{
     60  const char* string;
     61
     62  // Model Loading     
     63  string = grabParameter( root, "BackgroundImage");
     64  if( string != NULL)
     65    this->setBackgroundImage(string);
     66
     67  string = grabParameter(root, "BackgroundPS");
     68  if (string != NULL)
     69    {
     70      float f1, f2, f3, f4;
     71      sscanf (string, "%f %f %f %f", &f1, &f2, &f3, &f4);
     72      this->setPosition(f1,f2);
     73      this->setScale(f3,f4);
     74    }
     75
     76  string = grabParameter( root, "BarImage");
     77  if (string != NULL)
     78    this->setBarImage(string);
     79  string = grabParameter(root, "BarPS");
     80  if (string != NULL)
     81    {
     82      float f1, f2, f3, f4;
     83      sscanf (string, "%f %f %f %f", &f1, &f2, &f3, &f4);
     84      this->setBarPosScale(f1,f2,f3,f4);
     85    }
     86
     87  string = grabParameter( root, "ElementCount");
     88  if (string != NULL)
     89    this->setMaximum(atoi(string));
     90}
    4691
    4792/**
     
    5196GLMenuImageScreen::~GLMenuImageScreen()
    5297{
    53   if (this->backMat)
    54     delete this->backMat;
     98  delete this->backMat;
     99  delete this->barMat;
    55100}
    56101
     
    60105void GLMenuImageScreen::init ()
    61106{
    62   /*
    63   int w = 680;
    64   int h = 480;
    65 
    66   glViewport(0,0,w,h);
    67  
    68   glMatrixMode(GL_PROJECTION);
    69   glLoadIdentity();
    70   gluPerspective(45.0f,(GLfloat)w/(GLfloat)h, .5f ,150.0f);
    71   glMatrixMode(GL_MODELVIEW);
    72 
    73   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    74   glLoadIdentity();
    75   gluLookAt(0, 0, 6,     0, 0, 0,     0, 1, 0);
    76 
    77   // Bind the texture stored at the zero index of g_Texture[]
    78   //glBindTexture(GL_TEXTURE_2D, g_Texture[0]);
    79   */
    80 
    81  
     107  this->setClassName ("GLMenuImageScreen");
     108
    82109  // Select Our VU Meter Background Texture
    83110  this->backMat = new Material("load_screen");
    84   this->backMat->setDiffuseMap("pictures/load_screen.jpg");
     111  this->barMat = new Material("bar");
    85112  this->maxValue = 10;
    86113  this->currentValue = 0;
    87 
     114  this->setPosition(0,0);
     115  this->setScale(1,1);
     116  this->setBarPosScale( .6, .75, .3, .1);
    88117  // End of Background image code.
    89118}
    90 
    91 
    92 /**
    93    \brief function to innit screen with all attributes set
    94    \param name of the background-image file
    95    \param height of the ImageScreen
    96    \param width of the Image Screen
    97    \param x offset from (0, 0)
    98    \param y offset from (0, 0)
    99 
    100    GLMenu uses its own coordinating system: upper left corner is (0, 0). x-axis is down=height,
    101    right axis is right direction (=width)
    102 */
    103 void GLMenuImageScreen::init (char* backImageName, float height, float width,
    104                               float offsetX, float offsetY)
    105 {}
    106 
    107 
    108 /**
    109    \brief draws the ImageScreen to the screenbuffer
    110 */
    111 void GLMenuImageScreen::draw ()
    112 {
    113 
    114   glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
    115 
    116   PRINTF(4)("GLMenuImagEscreen::draw() - drawing step %i/%i\n",
    117          this->currentValue, this->maxValue);
    118 
    119   /* screen size */
    120   int screenWidth = 640;
    121   int screenHeight = 480;
    122  
    123   /* set image size */
    124   int imageWidth = 640;
    125   int imageHeight = 480;
    126  
    127   /* start pos of image */
    128   int offsetX = (screenWidth - imageWidth)/2;
    129   int offsetY = (screenHeight - imageHeight)/2;
    130  
    131   /* loadbar pos */
    132   int barX = 390;
    133   int barY = 50;
    134   int barWidth = 230;
    135   int barHeight = 30;
    136  
    137   float val = ((float)this->currentValue/(float)this->maxValue) * barWidth;
    138   if( val > (float)barWidth)
    139     val = (float)barWidth;
    140 
    141   glMatrixMode(GL_PROJECTION);
    142   glPushMatrix();
    143   glLoadIdentity();
    144   /* set up an ortho screen */
    145   glOrtho(0, screenWidth, 0, screenHeight, -1, 1);
    146   glMatrixMode(GL_MODELVIEW);
    147   glLoadIdentity();
    148   glPushMatrix();
    149 
    150   glEnable(GL_BLEND);
    151   glPushAttrib(GL_LIGHTING_BIT | GL_TRANSFORM_BIT);
    152   glDisable(GL_LIGHTING);
    153 
    154   /* draw the progress bar */
    155   glBegin(GL_QUADS);
    156   glColor3f(0.96, 0.84, 0.34);
    157   glVertex2i(barX, barY);
    158   glVertex2i(barX + (int)val, barY);
    159   glVertex2i(barX + (int)val, barY + barHeight);
    160   glVertex2i(barX, barY + barHeight);
    161   glColor3f(1.0, 1.0, 1.0);
    162   glEnd();
    163 
    164   glBegin(GL_QUADS);
    165   glColor3f(0.0, 0.0, 0.0);
    166   glVertex2i(barX, barY);
    167   glVertex2i(barX + barWidth, barY);
    168   glVertex2i(barX + barWidth, barY + barHeight);
    169   glVertex2i(barX, barY + barHeight);
    170   glColor3f(1.0, 1.0, 1.0);
    171   glEnd();
    172 
    173   /* draw black border */
    174   glBegin(GL_QUADS);
    175   glColor3f(0.0, 0.0, 0.0);
    176   glVertex2i(barX-1, barY-1);
    177   glVertex2i(barX + barWidth +1, barY-1);
    178   glVertex2i(barX + barWidth+1, barY + barHeight+1);
    179   glVertex2i(barX - 1, barY + barHeight +1);
    180   glColor3f(1.0, 1.0, 1.0);
    181   glEnd();
    182 
    183   /* draw white border */
    184   glBegin(GL_QUADS);
    185   glColor3f(1.0, 1.0, 1.0);
    186   glVertex2i(barX-2, barY-2);
    187   glVertex2i(barX + barWidth +2, barY-2);
    188   glVertex2i(barX + barWidth+2, barY + barHeight+2);
    189   glVertex2i(barX - 2, barY + barHeight +2);
    190   glColor3f(1.0, 1.0, 1.0);
    191   glEnd();
    192 
    193   backMat->select();
    194   glBegin(GL_QUADS);
    195   glTexCoord2i(0, 0); glVertex2i(offsetX, offsetY);
    196   glTexCoord2i(1, 0); glVertex2i(offsetX + imageWidth, offsetY);
    197   glTexCoord2i(1, 1); glVertex2i(offsetX + imageWidth, offsetY + imageHeight);
    198   glTexCoord2i(0, 1); glVertex2i(offsetX, offsetY + imageHeight);
    199   glEnd();
    200   glDisable(GL_TEXTURE_2D);
    201 
    202   glDisable(GL_BLEND);
    203   glPopMatrix();
    204   glMatrixMode(GL_PROJECTION);
    205   glPopMatrix();
    206   glPopAttrib();
    207 
    208   SDL_GL_SwapBuffers();             
    209 }
    210  
    211119
    212120/**
     
    214122    \param file name of the backgroun-image
    215123 */
    216 void GLMenuImageScreen::setBackImageName (char* backImageName)
    217 {}
     124void GLMenuImageScreen::setBackgroundImage (const char* backImageName)
     125{
     126  this->backMat->setDiffuseMap(backImageName);
     127}
    218128
    219129
    220130/**
    221131   \brief sets position of the ImageScreen
    222    \param x offset from (0, 0)
    223    \param y offset from (0, 0)
     132   \param x offset from the top left corner in percent(0-1) of the screensize
     133   \param y offset from the top left corner in percent(0-1) of the screensize
    224134*/
    225135void GLMenuImageScreen::setPosition(float offsetX, float offsetY)
    226 {}
     136{
     137  this->offsetX = offsetX;
     138  this->offsetY = offsetY;
     139}
    227140
    228141
    229142/*
    230143  \brief sets size of the ImageScreen
    231   \param height of the ImageScreen
    232   \param width of the Image Screen
    233 */
    234 void GLMenuImageScreen::setSize(float height, float width)
    235 {}
     144  \param scaleX the scaleing of the image into the x-direction (in percent (0-1))
     145  \param scaleY the scaleing of the image into the y-direction (in percent (0-1))
     146*/
     147void GLMenuImageScreen::setScale(float scaleX, float scaleY)
     148{
     149  this->scaleX = scaleX;
     150  this->scaleY = scaleY;
     151}
     152
     153/**
     154   \param barImage An image for the Bar
     155*/
     156void GLMenuImageScreen::setBarImage(const char* barImage)
     157{
     158  this->barMat->setDiffuseMap(barImage);
     159}
     160
     161/**
     162   \brief sets the Position and the Size of the bar
     163   \param barX The Position in the x-direction in percent of the screen (0-1)
     164   \param barY The Position in the y-direction in percent of the screen (0-1)
     165   \param barW The Size in the x-direction in percent of the screen (0-1)
     166   \param barH The Size in the y-direction in percent of the screen (0-1)
     167*/
     168void GLMenuImageScreen::setBarPosScale(float barX, float barY, float barW, float barH)
     169{
     170  this->barX = barX;
     171  this->barY = barY;
     172  this->barW = barW;
     173  this->barH = barH;
     174}
    236175
    237176
     
    285224  this->draw();
    286225}
     226
     227
     228
     229/**
     230   \brief draws the ImageScreen to the screenbuffer
     231*/
     232void GLMenuImageScreen::draw ()
     233{
     234  glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
     235
     236  PRINTF(4)("GLMenuImagEscreen::draw() - drawing step %i/%i\n",
     237            this->currentValue, this->maxValue);
     238
     239  /* screen size */
     240  int screenWidth = GraphicsEngine::getInstance()->getResolutionX();
     241  int screenHeight = GraphicsEngine::getInstance()->getResolutionY();
     242 
     243  int imageWidth = (int)(screenWidth * this->scaleX);
     244  int imageHeight = (int)(screenHeight * this->scaleY);
     245
     246  int offsetX = (int)(this->offsetX * screenWidth);
     247  int offsetY = (int)(this->offsetY * screenHeight);
     248
     249  /* loadbar pos */
     250  int barX = (int)(this->barX *screenWidth);
     251  int barY = (int)(this->barY *screenHeight);
     252  int barW = (int)(this->barW *screenWidth);
     253  int barH = (int)(this->barH *screenHeight);
     254 
     255  float val = (float)this->currentValue/(float)this->maxValue;
     256                 
     257  if( val > barW)
     258    val = barW;
     259
     260  GraphicsEngine::enter2DMode();
     261
     262  /* draw the BackGround */
     263  backMat->select();
     264  glBegin(GL_TRIANGLE_STRIP);
     265  glTexCoord2i(0, 0); glVertex2i(offsetX, offsetY + imageHeight);
     266  glTexCoord2i(1, 0); glVertex2i(offsetX +imageWidth, offsetY + imageHeight);
     267  glTexCoord2i(0, 1); glVertex2i(offsetX, offsetY);
     268  glTexCoord2i(1, 1); glVertex2i(offsetX + imageWidth, offsetY);
     269  glEnd();
     270 
     271  glDisable(GL_TEXTURE_2D);
     272  /* draw white border */
     273  glBegin(GL_LINE_LOOP);
     274  glColor3f(1.0, 1.0, 1.0);
     275  glVertex2i(barX - 2, barY - 2);
     276  glVertex2i(barX + barW + 2, barY - 2);
     277  glVertex2i(barX + barW + 2, barY + barH + 2);
     278  glVertex2i(barX - 2, barY + barH + 2);
     279  glColor3f(1.0, 1.0, 1.0);
     280  glEnd();
     281 
     282  /* draw the progress bar */
     283  barMat->select();
     284  glBegin(GL_TRIANGLE_STRIP);
     285  glTexCoord2f(0, 0); glVertex2i(barX, barY + barH);
     286  glTexCoord2f(val, 0); glVertex2i(barX + (int)(val * this->barW * (float)screenWidth), barY + barH);
     287  glTexCoord2f(0, 1); glVertex2i(barX, barY);
     288  glTexCoord2f(val, 1); glVertex2i(barX + (int)(val * this->barW * (float)screenWidth), barY);
     289  glEnd();
     290
     291  /*
     292    glBegin(GL_QUADS);
     293    glColor3f(0.0, 0.0, 0.0);
     294    glVertex2i(barX, barY);
     295    glVertex2i(barX + barWidth, barY);
     296    glVertex2i(barX + barWidth, barY + barHeight);
     297    glVertex2i(barX, barY + barHeight);
     298    glColor3f(1.0, 1.0, 1.0);
     299    glEnd();
     300   
     301    /* draw black border
     302    glBegin(GL_QUADS);
     303    glColor3f(0.0, 0.0, 0.0);
     304    glVertex2i(barX-1, barY-1);
     305    glVertex2i(barX + barWidth +1, barY-1);
     306    glVertex2i(barX + barWidth+1, barY + barHeight+1);
     307    glVertex2i(barX - 1, barY + barHeight +1);
     308    glColor3f(1.0, 1.0, 1.0);
     309    glEnd();
     310   
     311  */
     312
     313  GraphicsEngine::leave2DMode();
     314
     315  SDL_GL_SwapBuffers();             
     316}
     317 
     318
  • orxonox/branches/physics/src/glmenu/glmenu_imagescreen.h

    r3675 r4178  
    1111
    1212class Material;
     13class TiXmlElement;
    1314
    1415class GLMenuImageScreen : public BaseObject {
    1516
    16  private:
     17 public:
    1718  GLMenuImageScreen ();
    18 
    19  public:
     19  GLMenuImageScreen (TiXmlElement* root);
     20  void load(TiXmlElement* root);
    2021  virtual ~GLMenuImageScreen ();
    21  
    22   static GLMenuImageScreen* getInstance();
    23 
    24   static GLMenuImageScreen* singletonRef;
    2522
    2623  void init ();
    27   void init (char* backImageName, float height, float width,
    28              float offsetX, float offsetY);
    2924
    3025  void draw ();
    3126 
    32   void setBackImageName (char* backImageName);
    33   void setPosition (float offsetX, float offsetY);
    34   void setSize (float height, float width);
    35  
     27  void setBackgroundImage(const char* backImageName);
     28  void setPosition(float offsetX, float offsetY);
     29  void setScale (float scaleX, float scaleY);
     30
     31  void setBarImage(const char* barImage);
     32  void setBarPosScale(float barX, float barY, float barW, float barH);
     33
    3634  void setMaximum (int maxValue);
    3735  int getMaximum ();
     
    4240 private:
    4341  char* backImageName;       //!< the name of the file of the background image
    44   float height, width;       //!< hight and width of the image
     42  float scaleX, scaleY;      //!< hight and width of the image
    4543  float offsetX, offsetY;    //!< offset of the image from left and up
    4644  Material* backMat;         //!< Background Material.
     45  float barX, barY, barW, barH; //!< Position and Scale of the bar.
     46  Material* barMat;          //!< A Material for the Loading-Bar
    4747
    4848  /* progress bar values */
  • orxonox/branches/physics/src/lib/Makefile.in

    r3789 r4178  
    8989EXEEXT = @EXEEXT@
    9090GPROF = @GPROF@
    91 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
    92 GTHREAD_LIBS = @GTHREAD_LIBS@
    9391GTK2_CFLAGS = @GTK2_CFLAGS@
    9492GTK2_LIBS = @GTK2_LIBS@
    9593HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
    9694HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
    97 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
    98 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    9995HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    10096HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
     
    117113PACKAGE_VERSION = @PACKAGE_VERSION@
    118114PATH_SEPARATOR = @PATH_SEPARATOR@
     115PKG_CONFIG = @PKG_CONFIG@
     116RANLIB = @RANLIB@
    119117SET_MAKE = @SET_MAKE@
    120118SHELL = @SHELL@
     
    125123ac_ct_CC = @ac_ct_CC@
    126124ac_ct_CXX = @ac_ct_CXX@
     125ac_ct_RANLIB = @ac_ct_RANLIB@
    127126ac_ct_STRIP = @ac_ct_STRIP@
    128127am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
  • orxonox/branches/physics/src/lib/coord/null_parent.cc

    r3809 r4178  
    5454  this->parent = this;
    5555  this->mode = PNODE_ALL;
    56   *this->absCoordinate = absCoordinate;
     56  this->absCoordinate = absCoordinate;
    5757  this->setName("NullParent");
    5858}
     
    8080{
    8181
    82   PRINTF(4)("NullParent::update - (%f, %f, %f)\n", this->absCoordinate->x, this->absCoordinate->y, this->absCoordinate->z);
    83   *this->absCoordinate = *this->relCoordinate;
    84   *this->absDirection = parent->getAbsDir () * *this->relDirection;
     82  PRINTF(4)("NullParent::update - (%f, %f, %f)\n", this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z);
     83  this->absCoordinate = this->relCoordinate;
     84  this->absDirection = parent->getAbsDir () * this->relDirection;
    8585
    8686  tIterator<PNode>* iterator = this->children->getIterator();
  • orxonox/branches/physics/src/lib/coord/p_node.cc

    r3860 r4178  
    6060  this->init(parent);
    6161
    62   *this->absCoordinate = absCoordinate;
     62  this->absCoordinate = absCoordinate;
    6363
    6464  if (likely(parent != NULL))
    6565  {
    66     *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor ();
     66    this->relCoordinate = this->absCoordinate - parent->getAbsCoor();
    6767    parent->addChild (this);
    6868  }
    69   else
    70     this->relCoordinate = new Vector();
    7169}
    7270
     
    8987  delete []this->objectName;
    9088
    91   delete this->relCoordinate;
    92   delete this->absCoordinate;
    93   delete this->relDirection;
    94   delete this->absDirection;
    95   delete this->lastAbsCoordinate;
    96   delete this->diffCoordinate;
    9789}
    9890
     
    10799  this->parent = parent;
    108100  this->objectName = NULL;
    109   this->time = 1.0; /* set time to 1 to make divisions by zero impossible */
    110 
    111   this->absCoordinate = new Vector();
    112   this->relCoordinate = new Vector();
    113   this->absDirection = new Quaternion();
    114   this->relDirection = new Quaternion();
    115   this->lastAbsCoordinate = new Vector();
    116   this->diffCoordinate = new Vector();
    117101}
    118102
     
    158142{
    159143  this->bRelCoorChanged = true;
    160   *this->relCoordinate = relCoord;
     144  this->relCoordinate = relCoord;
    161145}
    162146
     
    182166{
    183167  this->bAbsCoorChanged = true;
    184   *this->absCoordinate = absCoord;
     168  this->absCoordinate = absCoord;
    185169}
    186170
     
    211195  if( unlikely(this->bAbsCoorChanged))
    212196    {
    213       *this->absCoordinate = *this->absCoordinate + shift;
     197      this->absCoordinate += shift;
    214198    }
    215199  else
    216200    {
    217       *this->relCoordinate = *this->relCoordinate + shift;
     201      this->relCoordinate += shift;
    218202      this->bRelCoorChanged = true;
    219203    }
     
    241225{
    242226  this->bRelCoorChanged = true;
    243   *this->relDirection = relDir;
     227  this->relDirection = relDir;
    244228}
    245229
     
    264248{
    265249  this->bAbsDirChanged = true;
    266   *this->absDirection = absDir;
     250  this->absDirection = absDir;
    267251}
    268252
     
    293277{
    294278  this->bRelDirChanged = true;
    295   *this->relDirection = *this->relDirection * shift;
    296 }
    297 
    298 
    299 
    300 /**
    301    \brief this calculates the current movement speed of the node
    302 */
    303 float PNode::getSpeed() const
    304 {
    305   *this->diffCoordinate = *this->absCoordinate - *this->lastAbsCoordinate;
    306   return this->diffCoordinate->len() / this->time;
    307 }
    308 
     279  this->relDirection = this->relDirection * shift;
     280}
    309281
    310282/**
     
    432404void PNode::update (float dt)
    433405{
    434   *this->lastAbsCoordinate = *this->absCoordinate;
    435   this->time = dt;
    436   PRINTF(4)("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate->x, this->absCoordinate->y, this->absCoordinate->z);
     406  this->lastAbsCoordinate = this->absCoordinate;
     407
     408  PRINTF(4)("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z);
    437409
    438410
     
    442414        {
    443415          /* if you have set the absolute coordinates this overrides all other changes */
    444           *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor ();
     416          this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
    445417        }
    446418      if( likely(this->bRelCoorChanged) /*&& this->timeStamp != DataTank::timeStamp*/)
     
    455427            }
    456428            else */
    457           *this->absCoordinate = parent->getAbsCoor() + *this->relCoordinate;         /* update the current absCoordinate */
     429          this->absCoordinate = parent->getAbsCoor() + this->relCoordinate;           /* update the current absCoordinate */
    458430        }
    459431    }
     
    464436        {
    465437          /* if you have set the absolute coordinates this overrides all other changes */
    466           *this->relDirection = *this->absDirection - parent->getAbsDir();
     438          this->relDirection = this->absDirection - parent->getAbsDir();
    467439        }
    468440      else if( likely(this->bRelDirChanged) /*&& this->timeStamp != DataTank::timeStamp*/)
    469441        {
    470442          /* update the current absDirection - remember * means rotation around sth.*/
    471           *this->absDirection = parent->getAbsDir() * *this->relDirection;
     443          this->absDirection = parent->getAbsDir() * this->relDirection;
    472444        }
    473445    }
     
    478450        {
    479451          /* if you have set the absolute coordinates this overrides all other changes */
    480           *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor ();
     452          this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
    481453        }
    482454      else if( likely(this->bRelCoorChanged) /*&& this->timeStamp != DataTank::timeStamp*/)
     
    486458            *this->absCoordinate = *this->relCoordinate;
    487459            else*/
    488           *this->absCoordinate = parent->getAbsCoor() + parent->getAbsDir().apply(*this->relCoordinate);              /* update the current absCoordinate */
     460          this->absCoordinate = parent->getAbsCoor() + parent->getAbsDir().apply(this->relCoordinate);        /* update the current absCoordinate */
    489461        }
    490462    }
     
    508480  delete iterator;
    509481
     482  this->velocity = (this->absCoordinate - this->lastAbsCoordinate) / dt;
    510483  this->timeStamp = timeStamp;
    511484  this->bRelCoorChanged = false;
     
    540513{
    541514  PRINTF(2)("PNode::debug() - absCoord: (%f, %f, %f)\n",
    542          this->absCoordinate->x,
    543          this->absCoordinate->y,
    544          this->absCoordinate->z);
     515         this->absCoordinate.x,
     516         this->absCoordinate.y,
     517         this->absCoordinate.z);
    545518}
    546519
     
    551524  for debug purposes realy usefull, not used to work properly
    552525*/
    553 void PNode::setName (char* newName)
     526void PNode::setName (const char* newName)
    554527{
    555528  this->objectName = new char[strlen(newName)+1];
     
    561534  \brief gets the name of the node
    562535*/
    563 char* PNode::getName ()
     536const char* PNode::getName ()
    564537{
    565538  return this->objectName;
  • orxonox/branches/physics/src/lib/coord/p_node.h

    r3813 r4178  
    5757
    5858
    59   inline Vector* getRelCoor () const { return this->relCoordinate; }
     59  inline const Vector& getRelCoor () const { return this->relCoordinate; }
    6060  void setRelCoor (const Vector& relCoord);
    61   inline Vector getAbsCoor () const { return *this->absCoordinate; }
     61  inline const Vector& getAbsCoor () const { return this->absCoordinate; }
    6262  void setAbsCoor (const Vector& absCoord);
    6363  void shiftCoor (const Vector& shift);
    6464
    65   inline Quaternion getRelDir () const { return *this->relDirection; }
     65  inline const Quaternion& getRelDir () const { return this->relDirection; }
    6666  void setRelDir (const Quaternion& relDir);
    67   inline Quaternion getAbsDir () const { return *this->absDirection; }
     67  inline const Quaternion& getAbsDir () const { return this->absDirection; }
    6868  void setAbsDir (const Quaternion& absDir);
    6969  void shiftDir (const Quaternion& shift);
    7070
    71   float getSpeed() const;
     71  /** \returns the Speed of the Node */
     72  inline float getSpeed() const {return this->velocity.len()/1000;} //! \FIX THIS SHOULD NOT BE /1000
     73  /** \returns the Velocity of the Node */
     74  inline const Vector& getVelocity() const {return this->velocity;}
    7275
    7376  void addChild (PNode* pNode, int parentingMode = DEFAULT_MODE);
     
    8588  void processTick (float dt);
    8689
    87   void setName (char* newName);
    88   char* getName ();
     90  void setName (const char* newName);
     91  const char* getName ();
    8992
    9093
     
    99102  bool bRelDirChanged;     //!< If Relative Direction has changed since last time we checked
    100103
    101   Vector* relCoordinate;    //!< coordinates relative to the parent
    102   Vector* absCoordinate;    //!< absolute coordinates in the world ( from (0,0,0) )
    103   Quaternion* relDirection; //!< direction relative to the parent
    104   Quaternion* absDirection; //!< absolute direvtion in the world ( from (0,0,1) )
     104  Vector relCoordinate;    //!< coordinates relative to the parent
     105  Vector absCoordinate;    //!< absolute coordinates in the world ( from (0,0,0) )
     106  Quaternion relDirection; //!< direction relative to the parent
     107  Quaternion absDirection; //!< absolute direvtion in the world ( from (0,0,1) )
    105108
    106109  int mode;                //!< the mode of the binding
     
    109112  void init(PNode* parent);
    110113
    111   Vector* lastAbsCoordinate; //!< this is used for speedcalculation, it stores the last coordinate
    112   Vector* diffCoordinate;    //!< this is stored here for performance reasons, difference to the last vector
    113   float time;                //!< time since last update
     114  Vector velocity;          //!< Saves the velocity.
     115  Vector lastAbsCoordinate; //!< this is used for speedcalculation, it stores the last coordinate
    114116};
    115117
  • orxonox/branches/physics/src/lib/graphics/Makefile.in

    r3789 r4178  
    8989EXEEXT = @EXEEXT@
    9090GPROF = @GPROF@
    91 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
    92 GTHREAD_LIBS = @GTHREAD_LIBS@
    9391GTK2_CFLAGS = @GTK2_CFLAGS@
    9492GTK2_LIBS = @GTK2_LIBS@
    9593HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
    9694HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
    97 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
    98 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    9995HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    10096HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
     
    117113PACKAGE_VERSION = @PACKAGE_VERSION@
    118114PATH_SEPARATOR = @PATH_SEPARATOR@
     115PKG_CONFIG = @PKG_CONFIG@
     116RANLIB = @RANLIB@
    119117SET_MAKE = @SET_MAKE@
    120118SHELL = @SHELL@
     
    125123ac_ct_CC = @ac_ct_CC@
    126124ac_ct_CXX = @ac_ct_CXX@
     125ac_ct_RANLIB = @ac_ct_RANLIB@
    127126ac_ct_STRIP = @ac_ct_STRIP@
    128127am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
  • orxonox/branches/physics/src/lib/graphics/graphics_engine.cc

    r3844 r4178  
    1717
    1818#include "graphics_engine.h"
     19#include "resource_manager.h"
    1920
    2021#include "debug.h"
     
    3031{
    3132  this->setClassName ("GraphicsEngine");
     33
     34  this->fullscreen = false;
     35
    3236  this->initVideo();
    3337
     
    101105 
    102106  // TO DO: Create a cool icon and use it here
    103   SDL_WM_SetIcon(SDL_LoadBMP("../data/pictures/orxonox-icon32x32.bmp"), NULL); 
    104 
     107  char* loadPic = new char[strlen(ResourceManager::getInstance()->getDataDir())+ 100];
     108  sprintf(loadPic, "%s%s", ResourceManager::getInstance()->getDataDir(),  "pictures/orxonox-icon32x32.bmp");
     109  SDL_WM_SetIcon(SDL_LoadBMP(loadPic), NULL); 
     110  delete loadPic;
    105111  // Enable default GL stuff
    106112  glEnable(GL_DEPTH_TEST);
     
    137143int GraphicsEngine::setResolution(int width, int height, int bpp)
    138144{
     145  Uint32 fullscreenFlag;
    139146  this->resolutionX = width;
    140147  this->resolutionY = height;
    141148  this->bitsPerPixel = bpp;
     149  if (this->fullscreen)
     150    fullscreenFlag = SDL_FULLSCREEN;
     151  else
     152    fullscreenFlag = 0;
    142153 
    143154  printf ("ok\n");
    144   if((this->screen = SDL_SetVideoMode(this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags)) == NULL)
     155  if((this->screen = SDL_SetVideoMode(this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags | fullscreenFlag)) == NULL)
    145156    {
    146157      PRINTF(1)("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags, SDL_GetError());
     
    148159      //    return -1;
    149160    }
    150 
     161}
     162
     163void GraphicsEngine::setFullscreen(bool fullscreen)
     164{
     165  this->fullscreen = fullscreen;
     166  this->setResolution(this->resolutionX, this->resolutionY, this->bitsPerPixel);
    151167}
    152168
     
    254270  /* Check if our resolution is restricted */
    255271  if(this->videoModes == (SDL_Rect **)-1){
    256     PRINTF(1)("All resolutions available.\n");
     272    PRINTF(2)("All resolutions available.\n");
    257273  }
    258274  else{
     
    260276    PRINT(0)("Available Resoulution Modes are\n");
    261277    for(int i = 0; this->videoModes[i]; ++i)
    262       PRINT(0)(" |  %d x %d\n", this->videoModes[i]->w, this->videoModes[i]->h);
     278      PRINT(4)(" |  %d x %d\n", this->videoModes[i]->w, this->videoModes[i]->h);
    263279  }
    264280 
  • orxonox/branches/physics/src/lib/graphics/graphics_engine.h

    r3844 r4178  
    2626  int setGLattribs(void);
    2727  int setResolution(int width, int height, int bpp);
     28  void setFullscreen(bool fullscreen = false);
    2829  /** \returns the x resolution */
    2930  inline int getResolutionX(void) {return this->resolutionX;}
  • orxonox/branches/physics/src/lib/graphics/importer/Makefile.in

    r3953 r4178  
    119119EXEEXT = @EXEEXT@
    120120GPROF = @GPROF@
    121 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
    122 GTHREAD_LIBS = @GTHREAD_LIBS@
    123121GTK2_CFLAGS = @GTK2_CFLAGS@
    124122GTK2_LIBS = @GTK2_LIBS@
    125123HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
    126124HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
    127 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
    128 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    129125HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    130126HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
     
    147143PACKAGE_VERSION = @PACKAGE_VERSION@
    148144PATH_SEPARATOR = @PATH_SEPARATOR@
     145PKG_CONFIG = @PKG_CONFIG@
     146RANLIB = @RANLIB@
    149147SET_MAKE = @SET_MAKE@
    150148SHELL = @SHELL@
     
    155153ac_ct_CC = @ac_ct_CC@
    156154ac_ct_CXX = @ac_ct_CXX@
     155ac_ct_RANLIB = @ac_ct_RANLIB@
    157156ac_ct_STRIP = @ac_ct_STRIP@
    158157am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
  • orxonox/branches/physics/src/lib/graphics/importer/array.cc

    r3590 r4178  
    112112 
    113113/**
    114    \brief Gives back the array !! MUST be executed AFTER finalize.
    115    \returns The created array.
    116 */
    117 GLfloat* Array::getArray ()
    118 {
    119   return this->array;
    120 }
    121 
    122 /**
    123    \returns The Count of entries in the Array
    124 */
    125 int Array::getCount()
    126 {
    127   return this->entryCount;
    128 }
    129 
    130 /**
    131114   \brief Simple debug info about the Array
    132115*/
    133 void Array::debug ()
     116void Array::debug (void) const
    134117{
    135118  PRINT(0)("entryCount=%i, address=%p\n", this->entryCount, this->array);
  • orxonox/branches/physics/src/lib/graphics/importer/array.h

    r3590 r4178  
    2323  void addEntry(GLfloat entry0, GLfloat entry1, GLfloat entry2);
    2424 
    25   GLfloat* getArray ();
    26   int getCount();
    27   void debug(void);
     25  /** \returns The array */
     26  inline const GLfloat* getArray () const {return this->array;}
     27  /**   \returns The Count of entries in the Array*/
     28  inline int getCount(void)const {return this->entryCount;}
     29  void debug(void) const ;
    2830 private:
    2931  //! One entry of the Array
  • orxonox/branches/physics/src/lib/graphics/importer/framework.cc

    r3657 r4178  
    7979    obj = new OBJModel(argv[1]);
    8080  else
    81     obj = new PrimitiveModel(SPHERE);
     81    obj = new PrimitiveModel(CYLINDER);
    8282
    8383  M = Vector(wHandler.screen->w/2, wHandler.screen->h/2, 0);
  • orxonox/branches/physics/src/lib/graphics/importer/material.cc

    r3953 r4178  
    4545  this->setTransparency(1.0);
    4646
    47 
    4847  this->diffuseTexture = NULL;
    4948  this->ambientTexture = NULL;
    5049  this->specularTexture = NULL;
    51 
    52   this->diffuseTextureSet = false;
    53   this->ambientTextureSet = false;
    54   this->specularTextureSet = false;
    5550
    5651  this->setName(mtlName);
     
    8883 
    8984  // setting the transparency
    90   if (this->transparency == 1.0)
    91     {
    92       glDisable(GL_BLEND);
    93     }
    94   else
     85  if (this->transparency < 1.0)
    9586    {
    9687      glEnable(GL_BLEND);
     
    9889      glBlendFunc(GL_SRC_ALPHA, GL_ONE);
    9990    }
     91  else
     92    {
     93      glDisable(GL_BLEND);
     94      glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
     95    }
     96
    10097
    10198  // setting illumination Model
     
    105102    glShadeModel(GL_SMOOTH);
    106103
    107   if (this->diffuseTextureSet)
     104  if (this->diffuseTexture)
    108105    {
    109106      glEnable(GL_TEXTURE_2D);
    110107      glBindTexture(GL_TEXTURE_2D, this->diffuseTexture->getTexture());
     108
     109      /* This allows alpha blending of 2D textures with the scene */
     110      if (this->diffuseTexture->hasAlpha())
     111        {
     112          glEnable(GL_BLEND);
     113          glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     114        }
    111115    }
    112116  else
     
    291295{
    292296  PRINTF(4)("setting Diffuse Map %s\n", dMap);
    293   //    diffuseTexture = new Texture();
    294   //    this->diffuseTextureSet = diffuseTexture->loadImage(dMap);
    295297
    296298  //! \todo check if RESOURCE MANAGER is availiable
    297299  //! \todo Textures from .mtl-file need special care.
    298   this->diffuseTextureSet = this->diffuseTexture = (Texture*)ResourceManager::getInstance()->load(dMap, IMAGE);
     300  this->diffuseTexture = (Texture*)ResourceManager::getInstance()->load(dMap, IMAGE);
    299301}
    300302
  • orxonox/branches/physics/src/lib/graphics/importer/material.h

    r3953 r4178  
    6767  Texture* ambientTexture; //!< The ambient texture of the Material.
    6868  Texture* specularTexture;//!< The specular texture of the Material.
    69  
    70   bool diffuseTextureSet; //!< Chekcs if the diffuse texture is Set.
    71   bool ambientTextureSet; //!< Chekcs if the ambient texture is Set.
    72   bool specularTextureSet;//!< Chekcs if the specular texture is Set.
    73 
    7469};
    7570#endif
  • orxonox/branches/physics/src/lib/graphics/importer/model.cc

    r3953 r4178  
    2727using namespace std;
    2828
    29 //////////////////
    30 // DE-CONSTRUCT //
    31 //////////////////
    32 /**
    33    \brief Creates a 3D-Model. and assigns it a Name.
     29
     30////////////////////
     31/// SUB-Elements ///
     32////////////////////
     33/**
     34   \brief creates a new ModelFaceElement
     35*/
     36ModelFaceElement::ModelFaceElement()
     37{
     38  this->vertexNumber = -1;
     39  this->normalNumber = -1;
     40  this->texCoordNumber = -1;   
     41
     42  this->next = NULL;
     43}
     44
     45/**
     46   \brief destroys a ModelFaceElement
     47*/
     48ModelFaceElement::~ModelFaceElement()
     49{
     50  if (this->next)
     51    delete this->next;
     52}
     53
     54/**
     55   \brief creates a new ModelFace
     56*/
     57ModelFace::ModelFace()
     58{
     59  this->vertexCount = 0;
     60
     61  this->firstElem = NULL;
     62 
     63  this->material = NULL;
     64 
     65  this->next = NULL;
     66
     67}
     68
     69/**
     70   \brief deletes a ModelFace
     71*/
     72ModelFace::~ModelFace()
     73{
     74  PRINTF(5)("Cleaning up Face\n");
     75
     76  if (this->firstElem != NULL)
     77    delete this->firstElem;
     78 
     79  if (this->next != NULL)
     80    delete this->next;
     81}
     82
     83/**
     84   \brief Creates a new ModelGroup
     85*/
     86ModelGroup::ModelGroup()
     87{
     88  PRINTF(4)("Adding new Group\n");
     89  this->name = "";
     90  this->faceMode = -1;
     91  this->faceCount = 0; 
     92  this->next = NULL;
     93 
     94  this->firstFace = new ModelFace;
     95  this->currentFace = this->firstFace;
     96}
     97
     98/**
     99   \brief deletes a ModelGroup
     100*/
     101ModelGroup::~ModelGroup()
     102{
     103  PRINTF(5)("Cleaning up group\n");
     104  if (this->firstFace != NULL)
     105    delete this->firstFace;
     106
     107  if (this->next !=NULL)
     108    delete this->next;
     109}
     110
     111/**
     112   \brief cleans up a ModelGroup
     113
     114   actually does the same as the delete Operator, but does not delete the predecessing group
     115*/
     116void ModelGroup::cleanup(void)
     117{
     118  PRINTF(5)("Cleaning up group\n");
     119  if (this->firstFace)
     120    delete this->firstFace;
     121  this->firstFace = NULL;
     122  if (this->next)
     123    this->next->cleanup();
     124}
     125
     126
     127/////////////
     128/// MODEL ///
     129/////////////
     130/**
     131   \brief Creates a 3D-Model.
     132
     133   assigns it a Name and a Type
    34134*/
    35135Model::Model(const char* modelName, MODEL_TYPE type)
     
    42142  this->finalized = false;
    43143  // setting the start group;
    44   this->firstGroup = new Group;
    45   this->currentGroup = this->firstGroup;
     144  this->currentGroup = this->firstGroup = new ModelGroup;
    46145  this->groupCount = 0;
    47  
    48   this->initGroup (this->currentGroup);
     146  this->vertexCount = 0;
     147  this->normalCount = 0;
     148  this->texCoordCount = 0;
     149 
    49150  this->scaleFactor = 1;
    50151
     
    76177
    77178  PRINTF(5)("Deleting display Lists.\n");
    78   Group* walker = this->firstGroup;
    79   while (walker != NULL)
    80     {
    81       glDeleteLists (walker->listNumber, 1);
    82       Group* delWalker = walker;
    83       walker = walker->next;
    84       delete delWalker;
    85     }
     179  delete this->firstGroup;
    86180
    87181  // deleting Arrays
     
    92186  tIterator<Material>* tmpIt = this->materialList->getIterator();
    93187  Material* material = tmpIt->nextElement();
     188
     189  //! \todo do we really have to delete this material??
    94190  while(material)
    95191    {
     
    128224{
    129225  PRINTF(4)("drawing the 3D-Models\n");
    130   Group* walker = this->firstGroup;
    131   while (walker != NULL)
    132     {
    133       PRINTF(5)("Drawing model %s\n", walker->name);
    134       glCallList (walker->listNumber);
    135       walker = walker->next;
     226  ModelGroup* tmpGroup = this->firstGroup;
     227  while (tmpGroup != NULL)
     228    {
     229      PRINTF(5)("Drawing model %s\n", tmpGroup->name);
     230      glCallList (tmpGroup->listNumber);
     231      tmpGroup = tmpGroup->next;
    136232    }
    137233}
     
    151247    }
    152248  PRINTF(4)("drawing the requested 3D-Models if found.\n");
    153   Group* walker = this->firstGroup;
     249  ModelGroup* tmpGroup = this->firstGroup;
    154250  int counter = 0;
    155   while (walker != NULL)
     251  while (tmpGroup != NULL)
    156252    {
    157253      if (counter == groupNumber)
    158254        {
    159           PRINTF(4)("Drawing model number %i named %s\n", counter, walker->name);
    160           glCallList (walker->listNumber);
     255          PRINTF(4)("Drawing model number %i named %s\n", counter, tmpGroup->name);
     256          glCallList (tmpGroup->listNumber);
    161257          return;
    162258        }
    163259      ++counter;
    164       walker = walker->next;
     260      tmpGroup = tmpGroup->next;
    165261    }
    166262  PRINTF(2)("Model number %i in %s not Found.\n", groupNumber, this->name);
     
    178274{
    179275  PRINTF(4)("drawing the requested 3D-Models if found.\n");
    180   Group* walker = this->firstGroup;
    181   while (walker != NULL)
    182     {
    183       if (!strcmp(walker->name, groupName))
     276  ModelGroup* tmpGroup = this->firstGroup;
     277  while (tmpGroup != NULL)
     278    {
     279      if (!strcmp(tmpGroup->name, groupName))
    184280        {
    185           PRINTF(4)("Drawing model %s\n", walker->name);
    186           glCallList (walker->listNumber);
     281          PRINTF(4)("Drawing model %s\n", tmpGroup->name);
     282          glCallList (tmpGroup->listNumber);
    187283          return;
    188284        }
    189       walker = walker->next;
     285      tmpGroup = tmpGroup->next;
    190286    }
    191287  PRINTF(2)("Model Named %s in %s not Found.\n", groupName, this->name);
    192288  return;
    193 }
    194 
    195 /**
    196    \returns Count of the Models in this File
    197 */
    198 int Model::getGroupCount (void) const
    199 {
    200   return this->groupCount;
    201289}
    202290
     
    210298void Model::setName(const char* name)
    211299{
    212   if (this->name) 
    213     delete this->name;
     300  if (this->name)
     301    delete []this->name;
    214302  if (name)
    215303    {
     
    219307  else
    220308    this->name = NULL;
    221 }
    222 
    223 /**
    224    \brief initializes a new Group model
    225    \param group the group that should be initialized.
    226    \todo Maybe Group should be a Class, because it does a lot of stuff
    227    
    228 */
    229 bool Model::initGroup(Group* group)
    230 {
    231   PRINTF(4)("Adding new Group\n");
    232   group->name = "";
    233   group->faceMode = -1;
    234   group->faceCount = 0; 
    235   group->next = NULL;
    236 
    237   group->firstFace = new Face;
    238   this->initFace (group->firstFace);
    239   group->currentFace = group->firstFace;
    240 }
    241 
    242 /**
    243    \brief initializes a new Face. (sets default Values)
    244    \param face The face to initialize
    245 */
    246 bool Model::initFace (Face* face)
    247 {
    248   face->vertexCount = 0;
    249 
    250   face->firstElem = NULL;
    251  
    252   face->material = NULL;
    253  
    254   face->next = NULL;
    255 
    256   return true;
    257309}
    258310
     
    268320  if (this->normals)
    269321    delete this->normals;
     322
    270323  this->vertices = NULL;
    271324  this->vTexture = NULL;
     
    280333{
    281334  PRINTF(4)("cleaning up the 3D-Model to save Memory.\n");
    282   this->cleanupGroup(this->firstGroup);
     335  this->firstGroup->cleanup();
    283336  return true;
    284337}
    285338
    286 /**
    287    \brief Cleans up all groups starting from group.
    288    \param group the first Group to clean
    289 */
    290 bool Model::cleanupGroup (Group* group)
    291 {
    292   PRINTF(5)("Cleaning up group\n");
    293   if (group->firstFace != NULL)
    294     {
    295       cleanupFace (group->firstFace);
    296       delete group->firstFace;
    297     }
    298 
    299   if (group->next !=NULL)
    300     cleanupGroup (group->next);
    301   return true;
    302 }
    303 
    304 /**
    305    \brief Cleans up all Faces starting from face until NULL is reached.
    306    \param face the first face to clean.
    307 */
    308 bool Model::cleanupFace (Face* face)
    309 {
    310   PRINTF(5)("Cleaning up Face\n");
    311 
    312   if (face->firstElem != NULL)
    313     {
    314       this->cleanupFaceElement(face->firstElem);
    315       delete face->firstElem;
    316     }
    317      
    318   if (face->next != NULL)
    319     {
    320       this->cleanupFace (face->next);
    321       delete face->next;
    322     }
    323 }
    324 
    325 /**
    326    \brief Cleans up all FaceElements starting from faceElem.
    327    \param faceElem the first FaceElement to clean.
    328 */
    329 bool Model::cleanupFaceElement(FaceElement* faceElem)
    330 {
    331   if (faceElem->next != NULL)
    332     {
    333       this->cleanupFaceElement (faceElem->next);
    334       delete faceElem->next;
    335     }
    336 }
     339
    337340
    338341//////////
     
    354357/**
    355358   \brief adds a new Material to the Material List
    356    \param material the name of the Material to add
     359   \param materialName the name of the Material to add
    357360   \returns the added material
    358361*/
    359362Material* Model::addMaterial(const char* materialName)
    360363{
    361  
    362364  Material* newMat = new Material();
    363365  newMat->setName(materialName);
     
    395397
    396398   This function initializes a new Group.
    397    With it you should be able to import .obj-files with more than one Models inside.
    398 */
    399 bool Model::addGroup (const char* groupString)
     399   With it you should be able to create Models with more than one SubModel inside
     400*/
     401bool Model::addGroup(const char* groupString)
    400402{
    401403  PRINTF(5)("Read Group: %s.\n", groupString);
    402   if (this->groupCount != 0 && this->currentGroup->faceCount>0)
     404  if (this->groupCount != 0 && this->currentGroup->faceCount > 0)
    403405    {
    404406      //      finalizeGroup(currentGroup);
    405       this->currentGroup = this->currentGroup->next = new Group;
    406       this->initGroup(this->currentGroup);
     407      this->currentGroup = this->currentGroup->next = new ModelGroup;
    407408    }
    408409  // setting the group name if not default.
     
    429430  PRINTF(5)("reading in a vertex: %f %f %f\n", &subbuffer1, &subbuffer2, &subbuffer3);
    430431  this->vertices->addEntry(subbuffer1*scaleFactor, subbuffer2*scaleFactor, subbuffer3*scaleFactor);
     432  this->vertexCount++;
    431433  return true;
    432434}
     
    443445  PRINTF(5)("reading in a vertex: %f %f %f\n", x, y, z);
    444446  this->vertices->addEntry(x*scaleFactor, y*scaleFactor, z*scaleFactor);
     447  this->vertexCount++;
    445448  return true;
    446449}
     
    460463  PRINTF(5)("found vertex-Normal %f, %f, %f\n", &subbuffer1,&subbuffer2,&subbuffer3);
    461464  this->normals->addEntry(subbuffer1, subbuffer2, subbuffer3);
     465  this->normalCount++;
    462466  return true;
    463467}
     
    475479  PRINTF(5)("found vertex-Normal %f, %f, %f\n", x, y, z);
    476480  this->normals->addEntry(x, y, z);
     481  this->normalCount++;
     482  return true;
    477483}
    478484
     
    492498  this->vTexture->addEntry(subbuffer1);
    493499  this->vTexture->addEntry(subbuffer2);
     500  this->texCoordCount++;
    494501  return true;
    495502}
     
    507514  this->vTexture->addEntry(u);
    508515  this->vTexture->addEntry(v);
     516  this->texCoordCount++;
     517  return true;
    509518}
    510519
     
    514523
    515524   If a face line is found this function will add it to the glList.
     525
     526   String is different from the argument addFace, in this that the first Vertex/Normal/Texcoord is 1 instead of 0
    516527*/
    517528bool Model::addFace (const char* faceString)
    518529{
    519530  if (this->currentGroup->faceCount >0)
    520     this->currentGroup->currentFace = this->currentGroup->currentFace->next = new Face;
    521   this->initFace (this->currentGroup->currentFace);
    522 
    523   FaceElement* tmpElem = this->currentGroup->currentFace->firstElem = new FaceElement;
     531    this->currentGroup->currentFace = this->currentGroup->currentFace->next = new ModelFace;
     532
     533  ModelFaceElement* tmpElem = this->currentGroup->currentFace->firstElem = new ModelFaceElement;
    524534  tmpElem->next = NULL;
    525535  while(strcmp (faceString, "\0"))
    526536    {
    527537      if (this->currentGroup->currentFace->vertexCount>0)
    528           tmpElem = tmpElem->next = new FaceElement;
     538          tmpElem = tmpElem->next = new ModelFaceElement;
    529539      tmpElem->next = NULL;
    530540
     
    552562      if (vertex)
    553563        tmpElem->vertexNumber = atoi(vertex)-1;
    554       else
    555         tmpElem->vertexNumber = -1;
    556564      if (texture)
    557565        tmpElem->texCoordNumber = atoi(texture)-1;
    558       else
    559         tmpElem->texCoordNumber = -1;
    560566      if (normal)
    561567        tmpElem->normalNumber = atoi(normal)-1;
    562       else
    563         tmpElem->normalNumber = -1;
    564568
    565569      faceString += tmpLen;
     
    575579   \brief adds a new Face
    576580   \param faceElemCount the number of Vertices to add to the Face.
    577    \param type 0: vertex only, 1: vertex and normal, 2: vertex and Texture, 3 vertex, normal and texture
     581   \param type The information Passed with each Vertex
    578582*/
    579583bool Model::addFace(int faceElemCount, VERTEX_FORMAT type, ...)
    580584{
    581    if (this->currentGroup->faceCount > 0)
    582     this->currentGroup->currentFace = this->currentGroup->currentFace->next = new Face;
    583   this->initFace (this->currentGroup->currentFace);
    584 
    585   FaceElement* tmpElem = this->currentGroup->currentFace->firstElem = new FaceElement;
    586   tmpElem->next = NULL;
     585  if (this->currentGroup->faceCount > 0)
     586    this->currentGroup->currentFace = this->currentGroup->currentFace->next = new ModelFace;
     587 
     588  ModelFaceElement* tmpElem = this->currentGroup->currentFace->firstElem = new ModelFaceElement;
    587589 
    588590  va_list itemlist;
     
    591593  for (int i = 0; i < faceElemCount; i++)
    592594    {
    593       if (this->currentGroup->currentFace->vertexCount>0)
    594           tmpElem = tmpElem->next = new FaceElement;
    595       tmpElem->next = NULL;
    596 
    597       tmpElem->vertexNumber = va_arg (itemlist, int) -1;
     595      if (this->currentGroup->currentFace->vertexCount > 0)
     596        tmpElem = tmpElem->next = new ModelFaceElement;
     597
     598      tmpElem->vertexNumber = va_arg (itemlist, int);
    598599      if (type & TEXCOORD)
    599         tmpElem->texCoordNumber = va_arg (itemlist, int) -1;
     600        tmpElem->texCoordNumber = va_arg (itemlist, int);
    600601      if (type & NORMAL)
    601         tmpElem->normalNumber = va_arg(itemlist, int) -1;
     602        tmpElem->normalNumber = va_arg(itemlist, int);
    602603      this->currentGroup->currentFace->vertexCount++;
    603604    }
     
    614615{
    615616  if (this->currentGroup->faceCount > 0)
    616     this->currentGroup->currentFace = this->currentGroup->currentFace->next = new Face;
    617   this->initFace (this->currentGroup->currentFace);
     617    this->currentGroup->currentFace = this->currentGroup->currentFace->next = new ModelFace;
    618618 
    619619  this->currentGroup->currentFace->material = this->findMaterialByName(matString);
     
    630630{
    631631  if (this->currentGroup->faceCount > 0)
    632     this->currentGroup->currentFace = this->currentGroup->currentFace->next = new Face;
    633   this->initFace (this->currentGroup->currentFace);
     632    this->currentGroup->currentFace = this->currentGroup->currentFace->next = new ModelFace;
    634633 
    635634  this->currentGroup->currentFace->material = mtl;
     
    662661  Vector curV;
    663662
    664   Group* tmpGroup = firstGroup;
     663  ModelGroup* tmpGroup = firstGroup;
    665664  while (tmpGroup)
    666665    {
    667       Face* tmpFace = tmpGroup->firstFace;
     666      ModelFace* tmpFace = tmpGroup->firstFace;
    668667      while (tmpFace)
    669668        {
    670669          if (tmpFace->firstElem)
    671670            {
    672               FaceElement* firstElem = tmpFace->firstElem;
    673               FaceElement* prevElem;
    674               FaceElement* curElem = firstElem;
    675               FaceElement* nextElem;
    676               FaceElement* lastElem;
     671              ModelFaceElement* firstElem = tmpFace->firstElem;
     672              ModelFaceElement* prevElem;
     673              ModelFaceElement* curElem = firstElem;
     674              ModelFaceElement* nextElem;
     675              ModelFaceElement* lastElem;
    677676              // find last Element of the Chain. !! IMPORTANT:the last Element of the Chain must point to NULL, or it will resolv into an infinity-loop.
    678677              while (curElem)
     
    704703    }
    705704
    706   for (int i=0; i<vertices->getCount()/3;i++)
     705  for (int i=0; i < vertices->getCount()/3;i++)
    707706    {
    708707      normArray[i].normalize();
    709708      PRINTF(5)("Found Normale number %d: (%f; %f, %f).\n", i, normArray[i].x, normArray[i].y, normArray[i].z);
    710709     
    711       this->normals->addEntry(normArray[i].x, normArray[i].y, normArray[i].z);
     710      this->addVertexNormal(normArray[i].x, normArray[i].y, normArray[i].z);
    712711
    713712    }
     
    744743
    745744      // Putting Faces to GL
    746       Face* tmpFace = this->currentGroup->firstFace;
     745      ModelFace* tmpFace = this->currentGroup->firstFace;
    747746      while (tmpFace != NULL)
    748747        {
     
    794793            }
    795794         
    796           FaceElement* tmpElem = tmpFace->firstElem;
     795          ModelFaceElement* tmpElem = tmpFace->firstElem;
    797796          while (tmpElem != NULL)
    798797            {
     
    826825  glNormalPointer(3, 0, this->normals->getArray());
    827826  glTexCoordPointer(2, GL_FLOAT, 0, this->vTexture->getArray());
    828 
    829827}
    830828
     
    841839   merging this information, the face will be drawn.
    842840*/
    843 bool Model::addGLElement (FaceElement* elem)
     841bool Model::addGLElement (ModelFaceElement* elem)
    844842{
    845843  PRINTF(5)("importing grafical Element to openGL.\n");
    846844
    847845  if (elem->texCoordNumber != -1)
    848     glTexCoord2fv(this->vTexture->getArray() + elem->texCoordNumber * 2);
     846    {
     847      if (likely(elem->texCoordNumber < this->texCoordCount))
     848        glTexCoord2fv(this->vTexture->getArray() + elem->texCoordNumber * 2);
     849      else
     850        PRINTF(2)("TextureCoordinate %d is not in the List (max: %d)\nThe Model might be incomplete\n",
     851                  elem->texCoordNumber, this->texCoordCount);
     852    }
    849853  if (elem->normalNumber != -1)
    850     glNormal3fv(this->normals->getArray() + elem->normalNumber * 3);
     854    {
     855    if (likely(elem->normalNumber < this->normalCount))
     856      glNormal3fv(this->normals->getArray() + elem->normalNumber * 3);
     857    else
     858        PRINTF(2)("Normal %d is not in the List (max: %d)\nThe Model might be incomplete",
     859                  elem->normalNumber, this->normalCount);     
     860    }
    851861  if (elem->vertexNumber != -1)
    852     glVertex3fv(this->vertices->getArray() + elem->vertexNumber * 3);
     862    {
     863      if (likely(elem->vertexNumber < this->vertexCount))
     864          glVertex3fv(this->vertices->getArray() + elem->vertexNumber * 3);
     865      else
     866        PRINTF(2)("Vertex %d is not in the List (max: %d)\nThe Model might be incomplete",
     867                  elem->vertexNumber, this->vertexCount);     
     868    }   
    853869
    854870}
     
    910926  this->addVertexNormal (-1.0, 0.0, 0.0);
    911927
    912   /* normaleLess-testingMode
    913   this->addFace ("1 2 4 3");
    914   this->addFace ("3 4 6 5");
    915   this->addFace ("5 6 8 7");
    916   this->addFace ("7 8 2 1");
    917   this->addFace ("2 8 6 4");
    918   this->addFace ("7 1 3 5");
    919   */
    920 
    921   this->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,1,1, 2,2,2, 4,4,3, 3,3,4);
    922   this->addFace (4, VERTEX_TEXCOORD_NORMAL, 3,3,5, 4,4,6, 6,6,7, 5,5,8);
    923   this->addFace (4, VERTEX_TEXCOORD_NORMAL, 5,5,9, 6,6,10, 8,8,11, 7,7,12);
    924   this->addFace (4, VERTEX_TEXCOORD_NORMAL, 7,7,13, 8,8,14, 2,10,15, 1,9,16);
    925   this->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,2,17, 8,11,18, 6,12,19, 4,4,20);
    926   this->addFace (4, VERTEX_TEXCOORD_NORMAL, 7,13,21, 1,1,22, 3,3,23, 5,14,24);
    927 
    928 }
     928  this->addFace (4, VERTEX_TEXCOORD_NORMAL, 0,0,0, 1,1,1, 3,3,2, 2,2,3);
     929  this->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,2,4, 3,3,5, 5,5,6, 4,4,7);
     930  this->addFace (4, VERTEX_TEXCOORD_NORMAL, 4,4,8, 5,5,9, 7,7,10, 6,6,11);
     931  this->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,6,12, 7,7,13, 1,9,14, 0,8,15);
     932  this->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,1,16, 7,10,17, 5,11,18, 3,3,19);
     933  this->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,12,20, 0,0,21, 2,2,22, 4,13,23);
     934
     935}
  • orxonox/branches/physics/src/lib/graphics/importer/model.h

    r3953 r4178  
    3434                    VERTEX_TEXCOORD_NORMAL = NORMAL | TEXCOORD};
    3535
     36////////////////////
     37/// SUB-ELEMENTS ///
     38////////////////////
     39//! This is the placeholder of one Vertex beloning to a Face.
     40class ModelFaceElement
     41{
     42 public:
     43  ModelFaceElement();
     44  ~ModelFaceElement();
     45
     46  int vertexNumber;         //!< The number of the Vertex out of the Array* vertices, this vertex points to.
     47  int normalNumber;         //!< The number of the Normal out of the Array* normals, this vertex points to.
     48  int texCoordNumber;       //!< The number of the textureCoordinate out of the Array* vTexture, this vertex points to.
     49  ModelFaceElement* next;   //!< Point to the next FaceElement in this List.
     50};
     51
     52//! This is the placeholder of a Face belonging to a Group of Faces.
     53class ModelFace
     54{
     55 public:
     56  ModelFace();
     57  ~ModelFace();
     58
     59  int vertexCount;                //!< The Count of vertices this Face has.
     60  ModelFaceElement* firstElem;    //!< Points to the first Vertex (FaceElement) of this Face.
     61 
     62  Material* material;             //!< The Material to use.
     63 
     64  ModelFace* next;                //!< Pointer to the next Face.
     65};
     66
     67//! Group to handle multiple Models per obj-file.
     68class ModelGroup
     69{
     70 public:
     71  ModelGroup();
     72  ~ModelGroup();
     73
     74  void cleanup();
     75
     76  char* name;                 //!< the Name of the Group. this is an identifier, that can be accessed via the draw (char* name) function.
     77 
     78  GLubyte* indices;           //!< The indices of the Groups. Needed for vertex-arrays
     79  GLuint listNumber;          //!< The number of the GL-List this Group gets.
     80  ModelFace* firstFace;       //!< The first Face in this group.
     81  ModelFace* currentFace;     //!< The current Face in this Group (the one we are currently working with.)
     82  int faceMode;               //!< The Mode the Face is in: initially -1, 0 for FaceList opened, 1 for Material,  3 for triangle, 4 for Quad, 5+ for Poly \todo ENUM...
     83  int faceCount;              //!< The Number of Faces this Group holds.
     84 
     85  ModelGroup* next;           //!< Pointer to the next Group.
     86};
     87
     88/////////////
     89/// MODEL ///
     90/////////////
     91
    3692//! Class that handles 3D-Models. it can also read them in and display them.
    3793class Model
    3894{
    3995 private:
    40   /////////////
    41   // structs //
    42   /////////////
    43   //! This is the placeholder of one Vertex beloning to a Face.
    44   struct FaceElement
    45   {
    46     int vertexNumber;    //!< The number of the Vertex out of the Array* vertices, this vertex points to.
    47     int normalNumber;    //!< The number of the Normal out of the Array* normals, this vertex points to.
    48     int texCoordNumber;  //!< The number of the textureCoordinate out of the Array* vTexture, this vertex points to.
    49     FaceElement* next;   //!< Point to the next FaceElement in this List.
    50   };
    5196
    52   //! This is the placeholder of a Face belonging to a Group of Faces.
    53   struct Face
    54   {
    55     int vertexCount;        //!< The Count of vertices this Face has.
    56     FaceElement* firstElem; //!< Points to the first Vertex (FaceElement) of this Face.
     97  char* name;                 //!< This is the name of the Model.
     98  MODEL_TYPE type;            //!< A type for the Model
     99  bool finalized;             //!< Sets the Object to be finalized.
    57100
    58     Material* material;     //!< The Material to use.
     101  int vertexCount;            //!< A modelwide Counter for vertices.
     102  int normalCount;            //!< A modelwide Counter for the normals.
     103  int texCoordCount;          //!< A modelwide Counter for the texCoord.
     104  Array* vertices;            //!< The Array that handles the Vertices.
     105  Array* normals;             //!< The Array that handles the Normals.
     106  Array* vTexture;            //!< The Array that handles the VertexTextureCoordinates.
    59107
    60     Face* next;             //!< Pointer to the next Face.
    61   };
     108  ModelGroup* firstGroup;     //!< The first of all groups.
     109  ModelGroup* currentGroup;   //!< The currentGroup. this is the one we will work with.
     110  int groupCount;             //!< The Count of Groups.
    62111
    63   //! Group to handle multiple Models per obj-file.
    64   struct Group
    65   {
    66     char* name;         //!< the Name of the Group. this is an identifier, that can be accessed via the draw (char* name) function.
    67 
    68     GLubyte* indices;   //!< The indices of the Groups. Needed for vertex-arrays
    69     GLuint listNumber;  //!< The number of the GL-List this Group gets.
    70     Face* firstFace;    //!< The first Face in this group.
    71     Face* currentFace;  //!< The current Face in this Group (the one we are currently working with.)
    72     int faceMode;       //!< The Mode the Face is in: initially -1, 0 for FaceList opened, 1 for Material,  3 for triangle, 4 for Quad, 5+ for Poly \todo ENUM...
    73     int faceCount;      //!< The Number of Faces this Group holds.
    74 
    75     Group* next;        //!< Pointer to the next Group.
    76   };
    77 
    78   char* name;            //!< This is the name of the Model.
    79   MODEL_TYPE type;
    80   bool finalized;        //!< Sets the Object to be finalized.
    81 
    82   Array* vertices;      //!< The Array that handles the Vertices.
    83   int verticesCount;    //!< A global Counter for vertices.
    84   Array* normals;       //!< The Array that handles the Normals.
    85   Array* vTexture;      //!< The Array that handles the VertexTextureCoordinates.
    86 
    87   Group* firstGroup;    //!< The first of all groups.
    88   Group* currentGroup;  //!< The currentGroup. this is the one we will work with.
    89   int groupCount;       //!< The Count of Groups.
    90 
    91   tList<Material>* materialList;
     112  tList<Material>* materialList;//!< A list for all the Materials in this Model
    92113 
    93 
    94   bool initGroup(Group* group);
    95   bool initFace (Face* face);
    96 
    97114  bool buildVertexNormals(void);
    98115
    99116  bool importToDisplayList(void);
    100   bool addGLElement(FaceElement* elem);
     117  bool addGLElement(ModelFaceElement* elem);
    101118
    102119  bool importToVertexArray(void);
     
    104121  bool deleteArrays(void);
    105122  bool cleanup(void);
    106   bool cleanupGroup(Group* group);
    107   bool cleanupFace(Face* face);
    108   bool cleanupFaceElement(FaceElement* faceElem);
    109123
    110124
     
    121135
    122136  void setName(const char* name);
     137  /** \returns the Name of the Model */
    123138  inline const char* getName() {return this->name;}
    124139 
     
    126141  void draw(int groupNumber) const;
    127142  void draw(char* groupName) const;
    128   int getGroupCount() const;
     143
     144  /** \returns Count of the Models (Groups) in this File */
     145  inline int getGroupCount(void) const {return this->groupCount;}
    129146
    130147  Material* addMaterial(Material* material);
     
    143160  bool setMaterial(Material* mtl);
    144161  void finalize(void);
     162
     163  /** \returns The number of Vertices of the Model */
     164  inline int getVertexCount(void) const {return this->vertexCount;}
     165  /** \returns The number of Normals of the Model */
     166  inline int getNormalCount(void) const {return this->normalCount;}
     167  /** \returns The number of Texture Coordinates of the Model*/
     168  inline int getTexCoordCount(void) const {return this->texCoordCount;}
    145169};
    146170
  • orxonox/branches/physics/src/lib/graphics/importer/objModel.cc

    r3953 r4178  
    3434OBJModel::OBJModel(const char* fileName, float scaling) : Model(fileName)
    3535{
    36   this->initializeOBJ();
     36  this->objPath = "./";
     37
    3738  this->scaleFactor = scaling;
    3839
     
    5253  if (this->objPath)
    5354    delete []this->objPath;
    54   if (this->objFileName)
    55     delete []this->objFileName;
    56   if (this->mtlFileName)
    57     delete []this->mtlFileName;
    58 }
    59 
    60 /**
    61    \brief Initializes an obj-model
    62 */
    63 void OBJModel::initializeOBJ(void)
    64 {
    65   this->objPath = NULL;
    66   this->objFileName = NULL;
    67   this->mtlFileName = NULL;
    6855}
    6956
     
    7158   \brief Imports a obj file and handles the the relative location
    7259   \param fileName The file to import
     60
     61   Splits the FileName from the DirectoryName
    7362*/
    7463bool OBJModel::importFile (const char* fileName)
    7564{
    7665  PRINTF(4)("preparing to read in file: %s\n", fileName);
    77 
    78 
    79 #ifdef __WIN32__
    80   // win32 path reading
    81   char pathSplitter= '\\';
    82 #else /* __WIN32__ */
    83   // unix path reading
    84   char pathSplitter='/';
    85 #endif /* __WIN32__ */
    86   char* tmpName;
    87   strcpy(tmpName, fileName);
    88   if (tmpName[0] == pathSplitter)
    89     tmpName++;
    90   char* name = tmpName;
    91   while (( tmpName = strchr (tmpName+1, pathSplitter)))
    92     {
    93       name = tmpName+1;
    94     }
    95   this->objPath = new char[name-fileName+1];
    96   strncpy(this->objPath, fileName, name-fileName);
    97   this->objPath[name-fileName] = '\0';
    98   if (strlen(objPath)> 0)
    99     PRINTF(5)("Resolved file %s to folder: %s.\n", name, objPath);
    100   else
    101     PRINTF(5)("Resolved file %s.\n", name);
    102  
    103   this->setName(name);
    104 
    105   this->objFileName = new char[strlen(name)+1];
    106   strcpy (this->objFileName, name);
    107   this->readFromObjFile ();
     66  // splitting the
     67  char* split = NULL;
     68
     69  if (!(split = strrchr(fileName, '/')))
     70    split = strrchr(fileName, '\\'); // windows Case
     71  if (split)
     72    {
     73      int len = split - fileName+1;
     74      this->objPath = new char[len +2];
     75      strncpy(this->objPath, fileName, len);
     76      this->objPath[len] = '\0';
     77      PRINTF(1)("Resolved file %s to Path %s.\n", fileName, this->objPath);
     78    }
     79  this->readFromObjFile (fileName);
    10880  return true;
    10981}
     
    11385   This function does read the file, parses it for the occurence of things like vertices, faces and so on, and executes the specific tasks
    11486*/
    115 bool OBJModel::readFromObjFile (void)
    116 {
    117   char* fileName = new char [strlen(objPath)+strlen(objFileName)+1];
    118   if (this->objFileName != NULL && !strcmp(this->objFileName, ""))
    119     return false;
    120   strcpy(fileName, this->objPath);
    121   strcat(fileName, this->objFileName);
    122 
     87bool OBJModel::readFromObjFile(const char* fileName)
     88{
    12389  FILE* stream;
    12490  if( (stream = fopen (fileName, "r")) == NULL)
    12591    {
    126       printf("IniParser could not open %s\n", fileName);
     92      printf("Object File Could not be Opened %s\n", fileName);
    12793      return false;
    12894    }
     
    179145    }
    180146  fclose (stream);
    181   delete []fileName;
    182147  return true;
    183148}
     
    194159bool OBJModel::readMtlLib (const char* mtlFile)
    195160{
    196   this->mtlFileName = new char [strlen(mtlFile)+1];
    197   strcpy(this->mtlFileName, mtlFile);
    198   char* fileName = new char [strlen(objPath) + strlen(this->mtlFileName)+1];
    199   strcpy(fileName, this->objPath);
    200   strcat(fileName, this->mtlFileName);
    201  
     161  char* fileName = new char [strlen(this->objPath) + strlen(mtlFile)+1];
     162  sprintf(fileName, "%s%s", this->objPath, mtlFile);
    202163
    203164  FILE* stream;
    204165  if( (stream = fopen (fileName, "r")) == NULL)
    205166    {
    206       printf("IniParser could not open %s\n", fileName);
     167      PRINTF(2)("MaterialLibrary could not be opened %s\n", fileName);
     168      delete []fileName;
    207169      return false;
    208170    }
  • orxonox/branches/physics/src/lib/graphics/importer/objModel.h

    r3953 r4178  
    1515  OBJModel(const char* fileName, float scaling = 1.0);
    1616  virtual ~OBJModel();
    17   void initializeOBJ(void);
    1817
    1918 private:
    2019  // Variables
    2120  char* objPath;        //!< The Path where the obj and mtl-file are located.
    22   char* objFileName;    //!< The Name of the obj-file.
    23   char* mtlFileName;    //!< The Name of the mtl-file (parsed out of the obj-file)
    2421
    2522  ///// readin /////
    2623  bool importFile (const char* fileName);
    27   bool readFromObjFile (void);
     24  bool readFromObjFile (const char* fileName);
    2825  bool readMtlLib (const char* matFile);
    2926};
  • orxonox/branches/physics/src/lib/graphics/importer/primitive_model.cc

    r3953 r4178  
    7171void PrimitiveModel::sphereModel(float size, unsigned int detail)
    7272{
    73   int vertexCount = 0;
    7473  if (detail <= 0)
    7574    detail = 1;
     
    8988                          size * sin(vi) * cos(vj));
    9089          this->addVertexTexture(i / (df *2.0), (j-1.0)/(df)+.5);
    91           vertexCount++;
    9290        }
    9391    }
    9492  this->addVertex(0, -size, 0);
     93  this->addVertexTexture(0,0);
    9594  this->addVertex(0, size, 0);
     95  this->addVertexTexture(0 ,1);
    9696
    9797  // defining the binding Faces.
     
    102102        {
    103103         
    104           v1 = i*detail + j;
    105           v4 = i*detail + (j+1);
     104          v1 = i*detail + j-1;
     105          v4 = i*detail + j;
    106106         
    107107          if (i == detail*2 -1)
    108108            {
    109               v2 = j;
    110               v3 = j+1;
     109              v2 = j-1;
     110              v3 = j;
    111111            }
    112112          else
    113113            {
    114               v2 = (i+1)*detail + j;
    115               v3 = (i+1)*detail + (j+1);
    116             }
    117          
     114              v2 = (i+1)*detail + j-1;
     115              v3 = (i+1)*detail + j;
     116            }
     117
    118118          if (j == 0)
    119119            {
    120               v1 = vertexCount+1;
     120              v1 = this->getVertexCount()-2;
    121121              this->addFace(3, VERTEX_TEXCOORD, v1, v1, v3, v3, v4, v4);
    122122            }
    123123          else if (j == detail)
    124124            {
    125               v3 = vertexCount+2;
     125              v3 = this->getVertexCount()-1;
    126126              this->addFace(3, VERTEX_TEXCOORD, v1, v1, v2, v2, v3, v3);
    127127            }
     
    157157    {
    158158      int p1, p2, p3, p4;
    159       p1 = 2*i+1;
    160       p2 = 2*i+2;
    161       p3 = 2*i+4;
    162       p4 = 2*i+3;
     159      p1 = 2*i;
     160      p2 = 2*i+1;
     161      p3 = 2*i+3;
     162      p4 = 2*i+2;
    163163      // something is wrong here
    164164      this->addFace(4, VERTEX_ONLY, p1, p2, p3, p4);
    165       this->addFace(3, VERTEX_ONLY, p4, p1, 2*detail+1);
    166       this->addFace(3, VERTEX_ONLY, p2, p3, 2*detail+2);
     165      this->addFace(3, VERTEX_ONLY, p4, p1, 2*detail);
     166      this->addFace(3, VERTEX_ONLY, p2, p3, 2*detail+1);
    167167    }
    168168  // caps
    169   this->addFace(4, VERTEX_ONLY, 2*detail-1, 2*detail, 2, 1);
    170   this->addFace(3, VERTEX_ONLY, 1, 2*detail-1, 2*detail+1);
    171   this->addFace(3, VERTEX_ONLY, 2*detail, 2, 2*detail+2);
     169  this->addFace(4, VERTEX_ONLY, 2*detail-2, 2*detail-1, 1, 0);
     170  this->addFace(3, VERTEX_ONLY, 0, 2*detail-2, 2*detail);
     171  this->addFace(3, VERTEX_ONLY, 2*detail-1, 1, 2*detail+1);
    172172}
    173173
     
    198198    {
    199199      unsigned int v1, v2;
    200       v1 = i+3;
     200      v1 = i+2;
    201201      if (i == detail -1)
    202         v2 = 3;
     202        v2 = 2;
    203203      else
    204         v2 = i+4;
    205       this->addFace(3, VERTEX_ONLY, 1, v1, v2);
    206       this->addFace(3, VERTEX_ONLY, 2, v1, v2);
     204        v2 = i+3;
     205      this->addFace(3, VERTEX_ONLY, 0, v1, v2);
     206      this->addFace(3, VERTEX_ONLY, 1, v1, v2);
    207207    }
    208208}
     
    228228  unsigned int v1, v2, v3, v4;
    229229  for (int i = 0; i < detail-1; i++)
    230     for (int j = 1; j < detail; j++)
     230    for (int j = 0; j < detail-1; j++)
    231231      {
    232232        v1 = i*detail + j;
  • orxonox/branches/physics/src/lib/graphics/importer/texture.cc

    r3953 r4178  
    2525Texture::Texture(const char* imageName)
    2626{
     27  bAlpha = false;
    2728  this->texture = 0;
    2829  if (imageName)
     
    112113      if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
    113114        SDL_SetAlpha(surface, saved_flags | SDL_OPENGL, saved_alpha);
     115        this->bAlpha = true;
    114116      }
    115117     
     
    119121      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
    120122      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
    121       /*      glTexImage2D(GL_TEXTURE_2D,
     123      // build the Texture
     124      glTexImage2D(GL_TEXTURE_2D,
    122125                   0,
    123126                   GL_RGBA,
     
    127130                   GL_UNSIGNED_BYTE,
    128131                   image->pixels);
    129       */
     132      // build the MipMaps
    130133      gluBuild2DMipmaps(GL_TEXTURE_2D,
    131                         3,
     134                        GL_RGBA,
    132135                        w,
    133136                        h,
     
    135138                        GL_UNSIGNED_BYTE,
    136139                        image->pixels);
    137 
     140     
    138141      SDL_FreeSurface(image); /* No longer needed */
    139142     
  • orxonox/branches/physics/src/lib/graphics/importer/texture.h

    r3953 r4178  
    2323  char* searchTextureInPaths(const char* texName) const;
    2424  void swap(unsigned char &a, unsigned char &b);
     25
     26  bool bAlpha;           //!< if the texture has an alpha channel.
    2527 public:
    2628  Texture(const char* imageName = NULL);
     
    3032  inline GLuint getTexture(void) {return this->texture;}
    3133  GLuint loadTexToGL (SDL_Surface* surface);
     34  inline bool hasAlpha(void) {return bAlpha;}
    3235
    3336  bool loadImage(const char* imageName);
  • orxonox/branches/physics/src/lib/gui/Makefile.in

    r3789 r4178  
    8989EXEEXT = @EXEEXT@
    9090GPROF = @GPROF@
    91 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
    92 GTHREAD_LIBS = @GTHREAD_LIBS@
    9391GTK2_CFLAGS = @GTK2_CFLAGS@
    9492GTK2_LIBS = @GTK2_LIBS@
    9593HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
    9694HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
    97 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
    98 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    9995HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    10096HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
     
    117113PACKAGE_VERSION = @PACKAGE_VERSION@
    118114PATH_SEPARATOR = @PATH_SEPARATOR@
     115PKG_CONFIG = @PKG_CONFIG@
     116RANLIB = @RANLIB@
    119117SET_MAKE = @SET_MAKE@
    120118SHELL = @SHELL@
     
    125123ac_ct_CC = @ac_ct_CC@
    126124ac_ct_CXX = @ac_ct_CXX@
     125ac_ct_RANLIB = @ac_ct_RANLIB@
    127126ac_ct_STRIP = @ac_ct_STRIP@
    128127am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
  • orxonox/branches/physics/src/lib/gui/console/Makefile.in

    r3789 r4178  
    107107EXEEXT = @EXEEXT@
    108108GPROF = @GPROF@
    109 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
    110 GTHREAD_LIBS = @GTHREAD_LIBS@
    111109GTK2_CFLAGS = @GTK2_CFLAGS@
    112110GTK2_LIBS = @GTK2_LIBS@
    113111HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
    114112HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
    115 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
    116 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    117113HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    118114HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
     
    136132PACKAGE_VERSION = @PACKAGE_VERSION@
    137133PATH_SEPARATOR = @PATH_SEPARATOR@
     134PKG_CONFIG = @PKG_CONFIG@
     135RANLIB = @RANLIB@
    138136SET_MAKE = @SET_MAKE@
    139137SHELL = @SHELL@
     
    144142ac_ct_CC = @ac_ct_CC@
    145143ac_ct_CXX = @ac_ct_CXX@
     144ac_ct_RANLIB = @ac_ct_RANLIB@
    146145ac_ct_STRIP = @ac_ct_STRIP@
    147146am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
  • orxonox/branches/physics/src/lib/gui/gui/Makefile.am

    r3624 r4178  
    77AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/coord
    88AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/data
    9 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/gaphics
    10 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/font
     9AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics
    1110AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/importer
    1211AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/gui
     
    1918AM_CXXFLAGS+=-I$(MAINSRCDIR)/glmenu
    2019AM_CXXFLAGS+=-I$(MAINSRCDIR)/ai
     20AM_CXXFLAGS+=-I$(MAINSRCDIR)/util
     21AM_CXXFLAGS+=-I$(MAINSRCDIR)/util/animation
     22AM_CXXFLAGS+=-I$(MAINSRCDIR)/util/common
    2123
    2224#AM_LDFLAGS=$(GTK2_LIBS)   $(GTHREAD_LIBS)
     
    2426
    2527bin_PROGRAMS=gui
    26 gui_SOURCES=orxonox_gui.cc \
    27             orxonox_gui_gtk.cc \
    28             orxonox_gui_video.cc \
    29             orxonox_gui_audio.cc \
    30             orxonox_gui_exec.cc \
    31             orxonox_gui_flags.cc \
    32             orxonox_gui_banner.cc \
    33             orxonox_gui_keys.cc \
    34             orxonox_gui_update.cc
     28gui_SOURCES=gui_main.cc \
     29            gui.cc \
     30            gui_gtk.cc \
     31            gui_element.cc \
     32            gui_video.cc \
     33            gui_audio.cc \
     34            gui_exec.cc \
     35            gui_flags.cc \
     36            gui_banner.cc \
     37            gui_keys.cc \
     38            gui_update.cc \
     39                  $(MAINSRCDIR)/lib/graphics/graphics_engine.cc \
     40                  $(MAINSRCDIR)/lib/lang/base_object.cc \
     41                  $(MAINSRCDIR)/lib/math/vector.cc \
     42                  $(MAINSRCDIR)/util/resource_manager.cc \
     43                  $(MAINSRCDIR)/lib/graphics/text_engine.cc \
     44                  $(MAINSRCDIR)/lib/coord/p_node.cc \
     45                  $(MAINSRCDIR)/lib/coord/null_parent.cc \
     46                  $(MAINSRCDIR)/lib/graphics/importer/array.cc \
     47                  $(MAINSRCDIR)/lib/graphics/importer/model.cc \
     48                  $(MAINSRCDIR)/lib/graphics/importer/objModel.cc \
     49                  $(MAINSRCDIR)/lib/graphics/importer/material.cc \
     50                  $(MAINSRCDIR)/lib/graphics/importer/texture.cc \
     51                  $(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc
    3552
    36 noinst_HEADERS=orxonox_gui.h \
    37             orxonox_gui_gtk.h \
    38             orxonox_gui_video.h \
    39             orxonox_gui_audio.h \
    40             orxonox_gui_exec.h \
    41             orxonox_gui_flags.h \
    42             orxonox_gui_banner.h \
    43             orxonox_gui_keys.h \
    44             orxonox_gui_update.h
     53noinst_HEADERS=gui.h \
     54            gui_gtk.h \
     55            gui_element.h \
     56            gui_video.h \
     57            gui_audio.h \
     58            gui_exec.h \
     59            gui_flags.h \
     60            gui_banner.h \
     61            gui_keys.h \
     62            gui_update.h
    4563
    4664#  uncomment the following if orxonox requires the mathlibrary
  • orxonox/branches/physics/src/lib/gui/gui/Makefile.in

    r3789 r4178  
    5353binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
    5454PROGRAMS = $(bin_PROGRAMS)
    55 am_gui_OBJECTS = orxonox_gui.$(OBJEXT) orxonox_gui_gtk.$(OBJEXT) \
    56         orxonox_gui_video.$(OBJEXT) orxonox_gui_audio.$(OBJEXT) \
    57         orxonox_gui_exec.$(OBJEXT) orxonox_gui_flags.$(OBJEXT) \
    58         orxonox_gui_banner.$(OBJEXT) orxonox_gui_keys.$(OBJEXT) \
    59         orxonox_gui_update.$(OBJEXT)
     55am_gui_OBJECTS = gui_main.$(OBJEXT) gui.$(OBJEXT) gui_gtk.$(OBJEXT) \
     56        gui_element.$(OBJEXT) gui_video.$(OBJEXT) gui_audio.$(OBJEXT) \
     57        gui_exec.$(OBJEXT) gui_flags.$(OBJEXT) gui_banner.$(OBJEXT) \
     58        gui_keys.$(OBJEXT) gui_update.$(OBJEXT) \
     59        graphics_engine.$(OBJEXT) base_object.$(OBJEXT) \
     60        vector.$(OBJEXT) resource_manager.$(OBJEXT) \
     61        text_engine.$(OBJEXT) p_node.$(OBJEXT) null_parent.$(OBJEXT) \
     62        array.$(OBJEXT) model.$(OBJEXT) objModel.$(OBJEXT) \
     63        material.$(OBJEXT) texture.$(OBJEXT) primitive_model.$(OBJEXT)
    6064gui_OBJECTS = $(am_gui_OBJECTS)
    6165gui_LDADD = $(LDADD)
     
    6367depcomp = $(SHELL) $(top_srcdir)/depcomp
    6468am__depfiles_maybe = depfiles
    65 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/orxonox_gui.Po \
    66 @AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_audio.Po \
    67 @AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_banner.Po \
    68 @AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_exec.Po \
    69 @AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_flags.Po \
    70 @AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_gtk.Po \
    71 @AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_keys.Po \
    72 @AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_update.Po \
    73 @AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_video.Po
     69@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/array.Po \
     70@AMDEP_TRUE@    ./$(DEPDIR)/base_object.Po \
     71@AMDEP_TRUE@    ./$(DEPDIR)/graphics_engine.Po ./$(DEPDIR)/gui.Po \
     72@AMDEP_TRUE@    ./$(DEPDIR)/gui_audio.Po ./$(DEPDIR)/gui_banner.Po \
     73@AMDEP_TRUE@    ./$(DEPDIR)/gui_element.Po ./$(DEPDIR)/gui_exec.Po \
     74@AMDEP_TRUE@    ./$(DEPDIR)/gui_flags.Po ./$(DEPDIR)/gui_gtk.Po \
     75@AMDEP_TRUE@    ./$(DEPDIR)/gui_keys.Po ./$(DEPDIR)/gui_main.Po \
     76@AMDEP_TRUE@    ./$(DEPDIR)/gui_update.Po ./$(DEPDIR)/gui_video.Po \
     77@AMDEP_TRUE@    ./$(DEPDIR)/material.Po ./$(DEPDIR)/model.Po \
     78@AMDEP_TRUE@    ./$(DEPDIR)/null_parent.Po ./$(DEPDIR)/objModel.Po \
     79@AMDEP_TRUE@    ./$(DEPDIR)/p_node.Po \
     80@AMDEP_TRUE@    ./$(DEPDIR)/primitive_model.Po \
     81@AMDEP_TRUE@    ./$(DEPDIR)/resource_manager.Po \
     82@AMDEP_TRUE@    ./$(DEPDIR)/text_engine.Po ./$(DEPDIR)/texture.Po \
     83@AMDEP_TRUE@    ./$(DEPDIR)/vector.Po
    7484CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
    7585        $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     
    116126EXEEXT = @EXEEXT@
    117127GPROF = @GPROF@
    118 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
    119 GTHREAD_LIBS = @GTHREAD_LIBS@
    120128GTK2_CFLAGS = @GTK2_CFLAGS@
    121129GTK2_LIBS = @GTK2_LIBS@
    122130HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
    123131HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
    124 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
    125 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    126132HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    127133HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
     
    144150PACKAGE_VERSION = @PACKAGE_VERSION@
    145151PATH_SEPARATOR = @PATH_SEPARATOR@
     152PKG_CONFIG = @PKG_CONFIG@
     153RANLIB = @RANLIB@
    146154SET_MAKE = @SET_MAKE@
    147155SHELL = @SHELL@
     
    152160ac_ct_CC = @ac_ct_CC@
    153161ac_ct_CXX = @ac_ct_CXX@
     162ac_ct_RANLIB = @ac_ct_RANLIB@
    154163ac_ct_STRIP = @ac_ct_STRIP@
    155164am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
     
    193202target_vendor = @target_vendor@
    194203MAINSRCDIR = ../../..
    195 AM_CXXFLAGS = $(GTK2_CFLAGS) $(GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS) -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/gaphics -I$(MAINSRCDIR)/lib/graphics/font -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai
     204AM_CXXFLAGS = $(GTK2_CFLAGS) $(GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS) -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai -I$(MAINSRCDIR)/util -I$(MAINSRCDIR)/util/animation -I$(MAINSRCDIR)/util/common
    196205
    197206#AM_LDFLAGS=$(GTK2_LIBS)   $(GTHREAD_LIBS)
    198207AM_LDFLAGS = $(GTK2_LIBS) $(GTHREAD_LIBS) $(CURL_LIBS)
    199 gui_SOURCES = orxonox_gui.cc \
    200             orxonox_gui_gtk.cc \
    201             orxonox_gui_video.cc \
    202             orxonox_gui_audio.cc \
    203             orxonox_gui_exec.cc \
    204             orxonox_gui_flags.cc \
    205             orxonox_gui_banner.cc \
    206             orxonox_gui_keys.cc \
    207             orxonox_gui_update.cc
    208 
    209 noinst_HEADERS = orxonox_gui.h \
    210             orxonox_gui_gtk.h \
    211             orxonox_gui_video.h \
    212             orxonox_gui_audio.h \
    213             orxonox_gui_exec.h \
    214             orxonox_gui_flags.h \
    215             orxonox_gui_banner.h \
    216             orxonox_gui_keys.h \
    217             orxonox_gui_update.h
     208gui_SOURCES = gui_main.cc \
     209            gui.cc \
     210            gui_gtk.cc \
     211            gui_element.cc \
     212            gui_video.cc \
     213            gui_audio.cc \
     214            gui_exec.cc \
     215            gui_flags.cc \
     216            gui_banner.cc \
     217            gui_keys.cc \
     218            gui_update.cc \
     219                  $(MAINSRCDIR)/lib/graphics/graphics_engine.cc \
     220                  $(MAINSRCDIR)/lib/lang/base_object.cc \
     221                  $(MAINSRCDIR)/lib/math/vector.cc \
     222                  $(MAINSRCDIR)/util/resource_manager.cc \
     223                  $(MAINSRCDIR)/lib/graphics/text_engine.cc \
     224                  $(MAINSRCDIR)/lib/coord/p_node.cc \
     225                  $(MAINSRCDIR)/lib/coord/null_parent.cc \
     226                  $(MAINSRCDIR)/lib/graphics/importer/array.cc \
     227                  $(MAINSRCDIR)/lib/graphics/importer/model.cc \
     228                  $(MAINSRCDIR)/lib/graphics/importer/objModel.cc \
     229                  $(MAINSRCDIR)/lib/graphics/importer/material.cc \
     230                  $(MAINSRCDIR)/lib/graphics/importer/texture.cc \
     231                  $(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc
     232
     233noinst_HEADERS = gui.h \
     234            gui_gtk.h \
     235            gui_element.h \
     236            gui_video.h \
     237            gui_audio.h \
     238            gui_exec.h \
     239            gui_flags.h \
     240            gui_banner.h \
     241            gui_keys.h \
     242            gui_update.h
    218243
    219244
     
    293318        -rm -f *.tab.c
    294319
    295 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui.Po@am__quote@
    296 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_audio.Po@am__quote@
    297 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_banner.Po@am__quote@
    298 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_exec.Po@am__quote@
    299 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_flags.Po@am__quote@
    300 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_gtk.Po@am__quote@
    301 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_keys.Po@am__quote@
    302 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_update.Po@am__quote@
    303 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_video.Po@am__quote@
     320@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@
     321@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_object.Po@am__quote@
     322@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graphics_engine.Po@am__quote@
     323@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui.Po@am__quote@
     324@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_audio.Po@am__quote@
     325@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_banner.Po@am__quote@
     326@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_element.Po@am__quote@
     327@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_exec.Po@am__quote@
     328@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_flags.Po@am__quote@
     329@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_gtk.Po@am__quote@
     330@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_keys.Po@am__quote@
     331@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_main.Po@am__quote@
     332@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_update.Po@am__quote@
     333@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_video.Po@am__quote@
     334@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/material.Po@am__quote@
     335@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/model.Po@am__quote@
     336@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/null_parent.Po@am__quote@
     337@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objModel.Po@am__quote@
     338@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_node.Po@am__quote@
     339@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/primitive_model.Po@am__quote@
     340@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resource_manager.Po@am__quote@
     341@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text_engine.Po@am__quote@
     342@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@
     343@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@
    304344
    305345.cc.o:
     
    318358@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    319359@am__fastdepCXX_FALSE@  $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
     360
     361graphics_engine.o: $(MAINSRCDIR)/lib/graphics/graphics_engine.cc
     362@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT graphics_engine.o -MD -MP -MF "$(DEPDIR)/graphics_engine.Tpo" -c -o graphics_engine.o `test -f '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/graphics_engine.cc; \
     363@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/graphics_engine.Tpo" "$(DEPDIR)/graphics_engine.Po"; else rm -f "$(DEPDIR)/graphics_engine.Tpo"; exit 1; fi
     364@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/graphics_engine.cc' object='graphics_engine.o' libtool=no @AMDEPBACKSLASH@
     365@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/graphics_engine.Po' tmpdepfile='$(DEPDIR)/graphics_engine.TPo' @AMDEPBACKSLASH@
     366@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     367@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o graphics_engine.o `test -f '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/graphics_engine.cc
     368
     369graphics_engine.obj: $(MAINSRCDIR)/lib/graphics/graphics_engine.cc
     370@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT graphics_engine.obj -MD -MP -MF "$(DEPDIR)/graphics_engine.Tpo" -c -o graphics_engine.obj `if test -f '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; fi`; \
     371@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/graphics_engine.Tpo" "$(DEPDIR)/graphics_engine.Po"; else rm -f "$(DEPDIR)/graphics_engine.Tpo"; exit 1; fi
     372@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/graphics_engine.cc' object='graphics_engine.obj' libtool=no @AMDEPBACKSLASH@
     373@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/graphics_engine.Po' tmpdepfile='$(DEPDIR)/graphics_engine.TPo' @AMDEPBACKSLASH@
     374@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     375@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o graphics_engine.obj `if test -f '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; fi`
     376
     377base_object.o: $(MAINSRCDIR)/lib/lang/base_object.cc
     378@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT base_object.o -MD -MP -MF "$(DEPDIR)/base_object.Tpo" -c -o base_object.o `test -f '$(MAINSRCDIR)/lib/lang/base_object.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/lang/base_object.cc; \
     379@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/base_object.Tpo" "$(DEPDIR)/base_object.Po"; else rm -f "$(DEPDIR)/base_object.Tpo"; exit 1; fi
     380@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/lang/base_object.cc' object='base_object.o' libtool=no @AMDEPBACKSLASH@
     381@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/base_object.Po' tmpdepfile='$(DEPDIR)/base_object.TPo' @AMDEPBACKSLASH@
     382@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     383@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o base_object.o `test -f '$(MAINSRCDIR)/lib/lang/base_object.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/lang/base_object.cc
     384
     385base_object.obj: $(MAINSRCDIR)/lib/lang/base_object.cc
     386@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT base_object.obj -MD -MP -MF "$(DEPDIR)/base_object.Tpo" -c -o base_object.obj `if test -f '$(MAINSRCDIR)/lib/lang/base_object.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/lang/base_object.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/lang/base_object.cc'; fi`; \
     387@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/base_object.Tpo" "$(DEPDIR)/base_object.Po"; else rm -f "$(DEPDIR)/base_object.Tpo"; exit 1; fi
     388@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/lang/base_object.cc' object='base_object.obj' libtool=no @AMDEPBACKSLASH@
     389@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/base_object.Po' tmpdepfile='$(DEPDIR)/base_object.TPo' @AMDEPBACKSLASH@
     390@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     391@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o base_object.obj `if test -f '$(MAINSRCDIR)/lib/lang/base_object.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/lang/base_object.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/lang/base_object.cc'; fi`
     392
     393vector.o: $(MAINSRCDIR)/lib/math/vector.cc
     394@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT vector.o -MD -MP -MF "$(DEPDIR)/vector.Tpo" -c -o vector.o `test -f '$(MAINSRCDIR)/lib/math/vector.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/math/vector.cc; \
     395@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/vector.Tpo" "$(DEPDIR)/vector.Po"; else rm -f "$(DEPDIR)/vector.Tpo"; exit 1; fi
     396@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/math/vector.cc' object='vector.o' libtool=no @AMDEPBACKSLASH@
     397@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/vector.Po' tmpdepfile='$(DEPDIR)/vector.TPo' @AMDEPBACKSLASH@
     398@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     399@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vector.o `test -f '$(MAINSRCDIR)/lib/math/vector.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/math/vector.cc
     400
     401vector.obj: $(MAINSRCDIR)/lib/math/vector.cc
     402@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT vector.obj -MD -MP -MF "$(DEPDIR)/vector.Tpo" -c -o vector.obj `if test -f '$(MAINSRCDIR)/lib/math/vector.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/math/vector.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/math/vector.cc'; fi`; \
     403@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/vector.Tpo" "$(DEPDIR)/vector.Po"; else rm -f "$(DEPDIR)/vector.Tpo"; exit 1; fi
     404@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/math/vector.cc' object='vector.obj' libtool=no @AMDEPBACKSLASH@
     405@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/vector.Po' tmpdepfile='$(DEPDIR)/vector.TPo' @AMDEPBACKSLASH@
     406@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     407@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vector.obj `if test -f '$(MAINSRCDIR)/lib/math/vector.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/math/vector.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/math/vector.cc'; fi`
     408
     409resource_manager.o: $(MAINSRCDIR)/util/resource_manager.cc
     410@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT resource_manager.o -MD -MP -MF "$(DEPDIR)/resource_manager.Tpo" -c -o resource_manager.o `test -f '$(MAINSRCDIR)/util/resource_manager.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/util/resource_manager.cc; \
     411@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/resource_manager.Tpo" "$(DEPDIR)/resource_manager.Po"; else rm -f "$(DEPDIR)/resource_manager.Tpo"; exit 1; fi
     412@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/util/resource_manager.cc' object='resource_manager.o' libtool=no @AMDEPBACKSLASH@
     413@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/resource_manager.Po' tmpdepfile='$(DEPDIR)/resource_manager.TPo' @AMDEPBACKSLASH@
     414@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     415@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o resource_manager.o `test -f '$(MAINSRCDIR)/util/resource_manager.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/util/resource_manager.cc
     416
     417resource_manager.obj: $(MAINSRCDIR)/util/resource_manager.cc
     418@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT resource_manager.obj -MD -MP -MF "$(DEPDIR)/resource_manager.Tpo" -c -o resource_manager.obj `if test -f '$(MAINSRCDIR)/util/resource_manager.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/util/resource_manager.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/util/resource_manager.cc'; fi`; \
     419@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/resource_manager.Tpo" "$(DEPDIR)/resource_manager.Po"; else rm -f "$(DEPDIR)/resource_manager.Tpo"; exit 1; fi
     420@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/util/resource_manager.cc' object='resource_manager.obj' libtool=no @AMDEPBACKSLASH@
     421@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/resource_manager.Po' tmpdepfile='$(DEPDIR)/resource_manager.TPo' @AMDEPBACKSLASH@
     422@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     423@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o resource_manager.obj `if test -f '$(MAINSRCDIR)/util/resource_manager.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/util/resource_manager.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/util/resource_manager.cc'; fi`
     424
     425text_engine.o: $(MAINSRCDIR)/lib/graphics/text_engine.cc
     426@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT text_engine.o -MD -MP -MF "$(DEPDIR)/text_engine.Tpo" -c -o text_engine.o `test -f '$(MAINSRCDIR)/lib/graphics/text_engine.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/text_engine.cc; \
     427@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/text_engine.Tpo" "$(DEPDIR)/text_engine.Po"; else rm -f "$(DEPDIR)/text_engine.Tpo"; exit 1; fi
     428@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/text_engine.cc' object='text_engine.o' libtool=no @AMDEPBACKSLASH@
     429@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/text_engine.Po' tmpdepfile='$(DEPDIR)/text_engine.TPo' @AMDEPBACKSLASH@
     430@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     431@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o text_engine.o `test -f '$(MAINSRCDIR)/lib/graphics/text_engine.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/text_engine.cc
     432
     433text_engine.obj: $(MAINSRCDIR)/lib/graphics/text_engine.cc
     434@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT text_engine.obj -MD -MP -MF "$(DEPDIR)/text_engine.Tpo" -c -o text_engine.obj `if test -f '$(MAINSRCDIR)/lib/graphics/text_engine.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/text_engine.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/text_engine.cc'; fi`; \
     435@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/text_engine.Tpo" "$(DEPDIR)/text_engine.Po"; else rm -f "$(DEPDIR)/text_engine.Tpo"; exit 1; fi
     436@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/text_engine.cc' object='text_engine.obj' libtool=no @AMDEPBACKSLASH@
     437@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/text_engine.Po' tmpdepfile='$(DEPDIR)/text_engine.TPo' @AMDEPBACKSLASH@
     438@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     439@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o text_engine.obj `if test -f '$(MAINSRCDIR)/lib/graphics/text_engine.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/text_engine.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/text_engine.cc'; fi`
     440
     441p_node.o: $(MAINSRCDIR)/lib/coord/p_node.cc
     442@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT p_node.o -MD -MP -MF "$(DEPDIR)/p_node.Tpo" -c -o p_node.o `test -f '$(MAINSRCDIR)/lib/coord/p_node.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/coord/p_node.cc; \
     443@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/p_node.Tpo" "$(DEPDIR)/p_node.Po"; else rm -f "$(DEPDIR)/p_node.Tpo"; exit 1; fi
     444@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/coord/p_node.cc' object='p_node.o' libtool=no @AMDEPBACKSLASH@
     445@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/p_node.Po' tmpdepfile='$(DEPDIR)/p_node.TPo' @AMDEPBACKSLASH@
     446@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     447@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o p_node.o `test -f '$(MAINSRCDIR)/lib/coord/p_node.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/coord/p_node.cc
     448
     449p_node.obj: $(MAINSRCDIR)/lib/coord/p_node.cc
     450@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT p_node.obj -MD -MP -MF "$(DEPDIR)/p_node.Tpo" -c -o p_node.obj `if test -f '$(MAINSRCDIR)/lib/coord/p_node.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/coord/p_node.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/coord/p_node.cc'; fi`; \
     451@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/p_node.Tpo" "$(DEPDIR)/p_node.Po"; else rm -f "$(DEPDIR)/p_node.Tpo"; exit 1; fi
     452@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/coord/p_node.cc' object='p_node.obj' libtool=no @AMDEPBACKSLASH@
     453@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/p_node.Po' tmpdepfile='$(DEPDIR)/p_node.TPo' @AMDEPBACKSLASH@
     454@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     455@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o p_node.obj `if test -f '$(MAINSRCDIR)/lib/coord/p_node.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/coord/p_node.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/coord/p_node.cc'; fi`
     456
     457null_parent.o: $(MAINSRCDIR)/lib/coord/null_parent.cc
     458@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT null_parent.o -MD -MP -MF "$(DEPDIR)/null_parent.Tpo" -c -o null_parent.o `test -f '$(MAINSRCDIR)/lib/coord/null_parent.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/coord/null_parent.cc; \
     459@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/null_parent.Tpo" "$(DEPDIR)/null_parent.Po"; else rm -f "$(DEPDIR)/null_parent.Tpo"; exit 1; fi
     460@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/coord/null_parent.cc' object='null_parent.o' libtool=no @AMDEPBACKSLASH@
     461@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/null_parent.Po' tmpdepfile='$(DEPDIR)/null_parent.TPo' @AMDEPBACKSLASH@
     462@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     463@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o null_parent.o `test -f '$(MAINSRCDIR)/lib/coord/null_parent.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/coord/null_parent.cc
     464
     465null_parent.obj: $(MAINSRCDIR)/lib/coord/null_parent.cc
     466@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT null_parent.obj -MD -MP -MF "$(DEPDIR)/null_parent.Tpo" -c -o null_parent.obj `if test -f '$(MAINSRCDIR)/lib/coord/null_parent.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/coord/null_parent.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/coord/null_parent.cc'; fi`; \
     467@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/null_parent.Tpo" "$(DEPDIR)/null_parent.Po"; else rm -f "$(DEPDIR)/null_parent.Tpo"; exit 1; fi
     468@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/coord/null_parent.cc' object='null_parent.obj' libtool=no @AMDEPBACKSLASH@
     469@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/null_parent.Po' tmpdepfile='$(DEPDIR)/null_parent.TPo' @AMDEPBACKSLASH@
     470@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     471@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o null_parent.obj `if test -f '$(MAINSRCDIR)/lib/coord/null_parent.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/coord/null_parent.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/coord/null_parent.cc'; fi`
     472
     473array.o: $(MAINSRCDIR)/lib/graphics/importer/array.cc
     474@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT array.o -MD -MP -MF "$(DEPDIR)/array.Tpo" -c -o array.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/array.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/array.cc; \
     475@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/array.Tpo" "$(DEPDIR)/array.Po"; else rm -f "$(DEPDIR)/array.Tpo"; exit 1; fi
     476@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/array.cc' object='array.o' libtool=no @AMDEPBACKSLASH@
     477@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/array.Po' tmpdepfile='$(DEPDIR)/array.TPo' @AMDEPBACKSLASH@
     478@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     479@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o array.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/array.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/array.cc
     480
     481array.obj: $(MAINSRCDIR)/lib/graphics/importer/array.cc
     482@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT array.obj -MD -MP -MF "$(DEPDIR)/array.Tpo" -c -o array.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/array.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/array.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/array.cc'; fi`; \
     483@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/array.Tpo" "$(DEPDIR)/array.Po"; else rm -f "$(DEPDIR)/array.Tpo"; exit 1; fi
     484@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/array.cc' object='array.obj' libtool=no @AMDEPBACKSLASH@
     485@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/array.Po' tmpdepfile='$(DEPDIR)/array.TPo' @AMDEPBACKSLASH@
     486@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     487@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o array.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/array.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/array.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/array.cc'; fi`
     488
     489model.o: $(MAINSRCDIR)/lib/graphics/importer/model.cc
     490@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT model.o -MD -MP -MF "$(DEPDIR)/model.Tpo" -c -o model.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/model.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/model.cc; \
     491@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/model.Tpo" "$(DEPDIR)/model.Po"; else rm -f "$(DEPDIR)/model.Tpo"; exit 1; fi
     492@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/model.cc' object='model.o' libtool=no @AMDEPBACKSLASH@
     493@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/model.Po' tmpdepfile='$(DEPDIR)/model.TPo' @AMDEPBACKSLASH@
     494@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     495@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o model.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/model.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/model.cc
     496
     497model.obj: $(MAINSRCDIR)/lib/graphics/importer/model.cc
     498@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT model.obj -MD -MP -MF "$(DEPDIR)/model.Tpo" -c -o model.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/model.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/model.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/model.cc'; fi`; \
     499@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/model.Tpo" "$(DEPDIR)/model.Po"; else rm -f "$(DEPDIR)/model.Tpo"; exit 1; fi
     500@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/model.cc' object='model.obj' libtool=no @AMDEPBACKSLASH@
     501@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/model.Po' tmpdepfile='$(DEPDIR)/model.TPo' @AMDEPBACKSLASH@
     502@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     503@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o model.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/model.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/model.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/model.cc'; fi`
     504
     505objModel.o: $(MAINSRCDIR)/lib/graphics/importer/objModel.cc
     506@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT objModel.o -MD -MP -MF "$(DEPDIR)/objModel.Tpo" -c -o objModel.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/objModel.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/objModel.cc; \
     507@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/objModel.Tpo" "$(DEPDIR)/objModel.Po"; else rm -f "$(DEPDIR)/objModel.Tpo"; exit 1; fi
     508@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/objModel.cc' object='objModel.o' libtool=no @AMDEPBACKSLASH@
     509@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/objModel.Po' tmpdepfile='$(DEPDIR)/objModel.TPo' @AMDEPBACKSLASH@
     510@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     511@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o objModel.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/objModel.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/objModel.cc
     512
     513objModel.obj: $(MAINSRCDIR)/lib/graphics/importer/objModel.cc
     514@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT objModel.obj -MD -MP -MF "$(DEPDIR)/objModel.Tpo" -c -o objModel.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/objModel.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/objModel.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/objModel.cc'; fi`; \
     515@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/objModel.Tpo" "$(DEPDIR)/objModel.Po"; else rm -f "$(DEPDIR)/objModel.Tpo"; exit 1; fi
     516@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/objModel.cc' object='objModel.obj' libtool=no @AMDEPBACKSLASH@
     517@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/objModel.Po' tmpdepfile='$(DEPDIR)/objModel.TPo' @AMDEPBACKSLASH@
     518@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     519@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o objModel.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/objModel.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/objModel.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/objModel.cc'; fi`
     520
     521material.o: $(MAINSRCDIR)/lib/graphics/importer/material.cc
     522@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT material.o -MD -MP -MF "$(DEPDIR)/material.Tpo" -c -o material.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/material.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/material.cc; \
     523@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/material.Tpo" "$(DEPDIR)/material.Po"; else rm -f "$(DEPDIR)/material.Tpo"; exit 1; fi
     524@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/material.cc' object='material.o' libtool=no @AMDEPBACKSLASH@
     525@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/material.Po' tmpdepfile='$(DEPDIR)/material.TPo' @AMDEPBACKSLASH@
     526@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     527@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o material.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/material.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/material.cc
     528
     529material.obj: $(MAINSRCDIR)/lib/graphics/importer/material.cc
     530@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT material.obj -MD -MP -MF "$(DEPDIR)/material.Tpo" -c -o material.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/material.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/material.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/material.cc'; fi`; \
     531@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/material.Tpo" "$(DEPDIR)/material.Po"; else rm -f "$(DEPDIR)/material.Tpo"; exit 1; fi
     532@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/material.cc' object='material.obj' libtool=no @AMDEPBACKSLASH@
     533@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/material.Po' tmpdepfile='$(DEPDIR)/material.TPo' @AMDEPBACKSLASH@
     534@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     535@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o material.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/material.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/material.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/material.cc'; fi`
     536
     537texture.o: $(MAINSRCDIR)/lib/graphics/importer/texture.cc
     538@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT texture.o -MD -MP -MF "$(DEPDIR)/texture.Tpo" -c -o texture.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/texture.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/texture.cc; \
     539@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/texture.Tpo" "$(DEPDIR)/texture.Po"; else rm -f "$(DEPDIR)/texture.Tpo"; exit 1; fi
     540@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/texture.cc' object='texture.o' libtool=no @AMDEPBACKSLASH@
     541@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/texture.Po' tmpdepfile='$(DEPDIR)/texture.TPo' @AMDEPBACKSLASH@
     542@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     543@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o texture.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/texture.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/texture.cc
     544
     545texture.obj: $(MAINSRCDIR)/lib/graphics/importer/texture.cc
     546@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT texture.obj -MD -MP -MF "$(DEPDIR)/texture.Tpo" -c -o texture.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/texture.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/texture.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/texture.cc'; fi`; \
     547@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/texture.Tpo" "$(DEPDIR)/texture.Po"; else rm -f "$(DEPDIR)/texture.Tpo"; exit 1; fi
     548@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/texture.cc' object='texture.obj' libtool=no @AMDEPBACKSLASH@
     549@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/texture.Po' tmpdepfile='$(DEPDIR)/texture.TPo' @AMDEPBACKSLASH@
     550@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     551@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o texture.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/texture.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/texture.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/texture.cc'; fi`
     552
     553primitive_model.o: $(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc
     554@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT primitive_model.o -MD -MP -MF "$(DEPDIR)/primitive_model.Tpo" -c -o primitive_model.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc; \
     555@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/primitive_model.Tpo" "$(DEPDIR)/primitive_model.Po"; else rm -f "$(DEPDIR)/primitive_model.Tpo"; exit 1; fi
     556@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc' object='primitive_model.o' libtool=no @AMDEPBACKSLASH@
     557@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/primitive_model.Po' tmpdepfile='$(DEPDIR)/primitive_model.TPo' @AMDEPBACKSLASH@
     558@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     559@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o primitive_model.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc
     560
     561primitive_model.obj: $(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc
     562@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT primitive_model.obj -MD -MP -MF "$(DEPDIR)/primitive_model.Tpo" -c -o primitive_model.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc'; fi`; \
     563@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/primitive_model.Tpo" "$(DEPDIR)/primitive_model.Po"; else rm -f "$(DEPDIR)/primitive_model.Tpo"; exit 1; fi
     564@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc' object='primitive_model.obj' libtool=no @AMDEPBACKSLASH@
     565@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/primitive_model.Po' tmpdepfile='$(DEPDIR)/primitive_model.TPo' @AMDEPBACKSLASH@
     566@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     567@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o primitive_model.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc'; fi`
    320568uninstall-info-am:
    321569
  • orxonox/branches/physics/src/lib/gui/gui/rc

    r3423 r4178  
    1 # pixmap_path "<dir 1>:<dir 2>:<dir 3>:..."
    2 #
    3 pixmap_path "/usr/include/X11R6/pixmaps:/home/imain/pixmaps"
    4 #
    5 # style <name> [= <name>]
    6 # {
    7 #   <option>
    8 # }
    9 #
    10 # widget <widget_set> style <style_name>
    11 # widget_class <widget_class_set> style <style_name>
    12 
    13 # Here is a list of all the possible states.  Note that some do not apply to
    14 # certain widgets.
    15 #
    16 # NORMAL - The normal state of a widget, without the mouse over top of
    17 # it, and not being pressed, etc.
    18 #
    19 # PRELIGHT - When the mouse is over top of the widget, colors defined
    20 # using this state will be in effect.
    21 #
    22 # ACTIVE - When the widget is pressed or clicked it will be active, and
    23 # the attributes assigned by this tag will be in effect.
    24 #
    25 # INSENSITIVE - When a widget is set insensitive, and cannot be
    26 # activated, it will take these attributes.
    27 #
    28 # SELECTED - When an object is selected, it takes these attributes.
    29 #
    30 # Given these states, we can set the attributes of the widgets in each of
    31 # these states using the following directives.
    32 #
    33 # fg - Sets the foreground color of a widget.
    34 # bg - Sets the background color of a widget.
    35 # bg_pixmap - Sets the background of a widget to a tiled pixmap.
    36 # font - Sets the font to be used with the given widget.
    37 #
    38 
    39 # This sets a style called "button".  The name is not really important, as
    40 # it is assigned to the actual widgets at the bottom of the file.
    41 
    42 style "window"
    43 {
    44   #This sets the padding around the window to the pixmap specified.
    45   #bg_pixmap[<STATE>] = "<pixmap filename>"
    46   #bg_pixmap[NORMAL] = "warning.xpm"
    47   bg[NORMAL] = { 0, 0, 0 }
    48   fg[NORMAL] = { 0, 1.0, 0 }
    49   base[NORMAL] = { 0, 0, 0 }
    50   base[INSENSITIVE] = { 0, 0, 0 }
    51 }
    52 
    53 style "scale"
    54 {
    55   #Sets the foreground color (font color) to red when in the "NORMAL"
    56   #state.
    57  
    58   fg[NORMAL] = { 0, 1.0, 0 }
    59   bg[NORMAL] = { 0, 1.0, 0 }
    60   bg[INSENSITIVE] = { 0, 1.0, 0 }
    61   bg[PRELIGHT] = { 0, 1.0, 0 }
    62   bg[ACTIVE] =   {0.2, 0.2, 0.2 }
    63  
    64   #Sets the background pixmap of this widget to that of its parent.
    65   bg_pixmap[NORMAL] = "<parent>"
    66 }
    67 
    68 style "button"
    69 {
    70   # This shows all the possible states for a button.  The only one that
    71   # doesn't apply is the SELECTED state.
    72  
    73   fg[PRELIGHT] = { 0, 0, 0 }
    74   bg[PRELIGHT] = { 0, 1.0, 0 }
    75   bg[ACTIVE] = { 0, 1.0, 0 }
    76   fg[ACTIVE] = { 0, 1.0, 0 }
    77   bg[NORMAL] = { 0, 0, 0 }
    78   fg[NORMAL] = { 0, 1.0, 0 }
    79   bg[INSENSITIVE] = { 1.0, 0, 1.0 }
    80   fg[INSENSITIVE] = { 1.0, 0, 1.0 }
    81   base[NORMAL] = { 0, 1.0, 0 }
    82   base[PRELIGHT] = { 0, 1.0, 0 }
    83 }
    84 
    85 # In this example, we inherit the attributes of the "button" style and then
    86 # override the font and background color when prelit to create a new
    87 # "main_button" style.
    88 
    89 style "main_button" = "button"
    90 {
    91   font = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*"
    92   bg[PRELIGHT] = { 0, 0.75, 0 }
    93 }
    94 
    95 style "toggle_button" = "button"
    96 {
    97   fg[NORMAL] = { 0, 1.0, 0 }
    98   fg[ACTIVE] = { 0, 1.0, 0 }
    99   text[NORMAL] = { 0, 0, 0}
    100   # This sets the background pixmap of the toggle_button to that of its
    101   # parent widget (as defined in the application).
    102   #bg_pixmap[NORMAL] = "<parent>"
    103 }
    104 
    105 style "text"
    106 {
    107   #bg_pixmap[NORMAL] = "marble.xpm"
    108   fg[NORMAL] = { 0, 1.0, 0 }
    109 }
    110 
    111 style "ruler"
    112 {
    113   font = "-adobe-helvetica-medium-r-normal--*-20-*-*-*-*-*-*"
    114 }
    115 
    116 # pixmap_path "~/.pixmaps"
    117 
    118 # These set the widget types to use the styles defined above.
    119 # The widget types are listed in the class hierarchy, but could probably be
    120 # just listed in this document for the users reference.
    121 
    122 widget_class "GtkWindow"           style "window"
    123 widget_class "GtkFrame"            style "window"
    124 widget_class "Gtk*EventBox"        style "window"
    125 widget_class "GtkDialog"           style "window"
    126 widget_class "GtkFileSelection"    style "window"
    127 widget_class "*Gtk*Scale"          style "scale"
    128 widget_class "*GtkCheckButton*"    style "toggle_button"
    129 widget_class "*Gtk*Menu*"          style "toggle_button"
    130 widget_class "*GtkRadioButton*"    style "toggle_button"
    131 widget_class "*GtkButton*"         style "button"
    132 widget_class "*Ruler"              style "ruler"
    133 widget_class "*GtkText"            style "text"
    134 widget_class "*GtkLabel"           style "text"
     1/*
     2 * style <name> [= <name>]
     3 * {
     4 *   <option>
     5 * }
     6 *
     7 * widget <widget_set> style <style_name>
     8 * widget_class <widget_class_set> style <style_name>
     9 *
     10 * Here is a list of all the possible states.  Note that some do not apply to
     11 * certain widgets.
     12 *
     13 * NORMAL - The normal state of a widget, without the mouse over top of
     14 * it, and not being pressed, etc.
     15 *
     16 * PRELIGHT - When the mouse is over top of the widget, colors defined
     17 * using this state will be in effect.
     18 *
     19 * ACTIVE - When the widget is pressed or clicked it will be active, and
     20 * the attributes assigned by this tag will be in effect.
     21 *
     22 * INSENSITIVE - When a widget is set insensitive, and cannot be
     23 * activated, it will take these attributes.
     24 *
     25 * SELECTED - When an object is selected, it takes these attributes.
     26 *
     27 * Given these states, we can set the attributes of the widgets in each of
     28 * these states using the following directives.
     29 *
     30 * fg - Sets the foreground color of a widget.
     31 * bg - Sets the background color of a widget.
     32 * bg_pixmap - Sets the background of a widget to a tiled pixmap.
     33 * base - Sets the base of Widgets
     34 * font - Sets the font to be used with the given widget.
     35*/
    13536
    13637
    137 # This sets all the buttons that are children of the "main window" to
    138 # the main_button style.  These must be documented to be taken advantage of.
    139 widget "main window.*GtkButton*" style "main_button"
     38
     39static const gchar* rc_string =
     40(
     41"style'orxonox'"
     42"{"
     43"fg[NORMAL]      = { 0.0, 1.0, 0.0 }"
     44"fg[PRELIGHT]    = { 0.0, 1.0, 0.0 }"
     45"fg[ACTIVE]      = { 0.0, 1.0, 0.0 }"
     46"fg[INSENSITIVE] = { 0.0, 0.8, 0.0 }"
     47"fg[SELECTED]    = { 0.0, 1.0, 0.0 }"
     48
     49"bg[NORMAL]      = { 0.0, 0.0, 0.0 }"
     50"bg[PRELIGHT]    = { 0.0, 1.0, 0.0 }"
     51"bg[ACTIVE]      = { 0.0, 0.3, 0.0 }"
     52"bg[INSENSITIVE] = { 0.0, 0.1, 0.0 }"
     53"bg[SELECTED]    = { 0.0, 0.1, 0.0 }"
     54
     55"base[NORMAL]      = { 0.0, 1.0, 0.0 }"
     56"base[PRELIGHT]    = { 0.0, 1.0, 0.0 }"
     57"base[ACTIVE]      = { 0.0, 1.0, 0.0 }"
     58"base[INSENSITIVE] = { 0.0, 1.0, 0.0 }"
     59"base[SELECTED]    = { 0.0, 1.0, 0.0 }"
     60
     61"font              = '-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*'"
     62"}"
     63
     64"style'window'"
     65"{"                     
     66"bg[NORMAL] = { 0, 0, 0 }"
     67"fg[NORMAL] = { 0, 1.0, 0 }"
     68"base[NORMAL] = { 0, 0, 0 }"
     69"base[INSENSITIVE] = { 0, 0, 0 }"
     70"}"
     71
     72"style'frame'"
     73"{"
     74"bg[NORMAL]  = { 0.0, 0.4, 0.0 }"
     75"}"
     76
     77"style'scale'"
     78"{"
     79"fg[NORMAL] = { 0, 1.0, 0 }"
     80"bg[NORMAL] = { 0, 1.0, 0 }"
     81"bg[INSENSITIVE] = { 0, 1.0, 0 }"
     82"bg[PRELIGHT] = { 0, 1.0, 0 }"
     83"bg[ACTIVE] =   {0.2, 0.2, 0.2 }"
     84"}"
     85
     86"style'button'"
     87"{"
     88"fg[PRELIGHT] = { 0, 0, 0 }"
     89"bg[PRELIGHT] = { 0, 1.0, 0 }"
     90"bg[ACTIVE] = { 0, 1.0, 0 }"
     91"fg[ACTIVE] = { 0, 1.0, 0 }"
     92"bg[NORMAL] = { 0, 0, 0 }"
     93"fg[NORMAL] = { 0, 1.0, 0 }"
     94"bg[INSENSITIVE] = { 0.0, 0.2, 0.0 }"
     95"fg[INSENSITIVE] = { 0.0, 0.8, 0.0 }"
     96"base[NORMAL] = { 0, 1.0, 0 }"
     97"base[PRELIGHT] = { 0, 1.0, 0 }"
     98"}"
     99
     100"style'main_button' = 'button'"
     101"{"
     102"font = '-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*'"
     103"bg[PRELIGHT] = { 0, 0.75, 0 }"
     104"}"
     105
     106"style'toggle_button' = 'button'"
     107"{"
     108"fg[NORMAL] = { 0, 1.0, 0 }"
     109"fg[ACTIVE] = { 0, 1.0, 0 }"
     110"text[NORMAL] = { 0, 0, 0}"
     111"}"
     112
     113"style'text'"
     114"{"
     115"fg[NORMAL] = { 0, 1.0, 0 }"
     116"}"
     117
     118"style'ruler'"
     119"{"
     120"font = '-adobe-helvetica-medium-r-normal--*-20-*-*-*-*-*-*'"
     121"}"
     122
     123"widget'Gtk*'                   style'orxonox'"
     124"widget'*Gtk*Frame*'              style'frame'"
     125"widget'GtkWindow'              style'window'"
     126"widget'GtkFileSelection'       style'window'"
     127"widget'*Gtk*Scale'             style'scale'"
     128"widget'*GtkCheckButton*'       style'toggle_button'"
     129"widget'*Gtk*Menu*'             style'toggle_button'"
     130"widget'*GtkRadioButton*'       style'toggle_button'"
     131"widget'*GtkButton*'            style'button'"
     132"widget'*Ruler'                 style'ruler'"
     133"widget'*GtkText'               style'text'"
     134"widget'*GtkLabel'              style'text'"
     135
     136"widget'main window.*GtkButton*' style 'main_button'"
     137
     138
     139);
  • orxonox/branches/physics/src/lib/math/vector.cc

    r3860 r4178  
    100100*/
    101101
    102 Vector* Vector::getNormalized()
     102Vector Vector::getNormalized()
    103103{
    104104  float l = len();
    105105  if(unlikely(l != 1.0))
    106106    {
    107       return this;
     107      return *this;
    108108    }
    109109  else if(unlikely(l == 0.0))
    110110    {
    111       return 0;
     111      return *this;
    112112    }
    113113
    114   return new Vector(x / l, y /l, z / l);
     114  return *this / l;
    115115}
    116116
     
    172172   \brief Outputs the values of the Vector
    173173*/
    174 void Vector::debug(void)
     174void Vector::debug(void) const
    175175{
    176176  PRINT(0)("Vector Debug information\n");
     
    435435/**
    436436   \brief performs a smooth move.
    437    \param from from where
    438    \param to to where
    439    \param t the time this transformation should take
    440    \param res The approximation-density
    441 */
    442 void Quaternion::quatSlerp(const Quaternion* from, const Quaternion* to, float t, Quaternion* res)
     437   \param from  where
     438   \param to where
     439   \param t the time this transformation should take value [0..1]
     440
     441   \returns the Result of the smooth move
     442*/
     443Quaternion quatSlerp(const Quaternion& from, const Quaternion& to, float t)
    443444{
    444445  float tol[4];
    445446  double omega, cosom, sinom, scale0, scale1;
    446   DELTA = 0.2;
    447 
    448   cosom = from->v.x * to->v.x + from->v.y * to->v.y + from->v.z * to->v.z + from->w * to->w;
     447  //  float DELTA = 0.2;
     448
     449  cosom = from.v.x * to.v.x + from.v.y * to.v.y + from.v.z * to.v.z + from.w * to.w;
    449450
    450451  if( cosom < 0.0 )
    451452    {
    452453      cosom = -cosom;
    453       tol[0] = -to->v.x;
    454       tol[1] = -to->v.y;
    455       tol[2] = -to->v.z;
    456       tol[3] = -to->w;
     454      tol[0] = -to.v.x;
     455      tol[1] = -to.v.y;
     456      tol[2] = -to.v.z;
     457      tol[3] = -to.w;
    457458    }
    458459  else
    459460    {
    460       tol[0] = to->v.x;
    461       tol[1] = to->v.y;
    462       tol[2] = to->v.z;
    463       tol[3] = to->w;
     461      tol[0] = to.v.x;
     462      tol[1] = to.v.y;
     463      tol[2] = to.v.z;
     464      tol[3] = to.w;
    464465    }
    465466 
    466467  //if( (1.0 - cosom) > DELTA )
    467468  //{
    468       omega = acos(cosom);
    469       sinom = sin(omega);
    470       scale0 = sin((1.0 - t) * omega) / sinom;
    471       scale1 = sin(t * omega) / sinom;
    472       //}
    473       /*
    474   else
     469  omega = acos(cosom);
     470  sinom = sin(omega);
     471  scale0 = sin((1.0 - t) * omega) / sinom;
     472  scale1 = sin(t * omega) / sinom;
     473  //}
     474  /*
     475    else
    475476    {
    476       scale0 = 1.0 - t;
    477       scale1 = t;
     477    scale0 = 1.0 - t;
     478    scale1 = t;
    478479    }
    479       */
    480   res->v.x = scale0 * from->v.x + scale1 * tol[0];
    481   res->v.y = scale0 * from->v.y + scale1 * tol[1];
    482   res->v.z = scale0 * from->v.z + scale1 * tol[2];
    483   res->w = scale0 * from->w + scale1 * tol[3];
     480  */
     481
     482
     483  /*
     484    Quaternion res;
     485    res.v.x = scale0 * from.v.x + scale1 * tol[0];
     486    res.v.y = scale0 * from.v.y + scale1 * tol[1];
     487    res.v.z = scale0 * from.v.z + scale1 * tol[2];
     488    res.w = scale0 * from.w + scale1 * tol[3];
     489  */
     490  return Quaternion(Vector(scale0 * from.v.x + scale1 * tol[0],
     491                           scale0 * from.v.y + scale1 * tol[1],
     492                           scale0 * from.v.z + scale1 * tol[2]),
     493                    scale0 * from.w + scale1 * tol[3]);
    484494}
    485495
  • orxonox/branches/physics/src/lib/math/vector.h

    r3860 r4178  
    3131
    3232  inline Vector operator+ (const Vector& v) const { return Vector(x + v.x, y + v.y, z + v.z); }
     33  inline const Vector& operator+= (const Vector& v) {this->x += v.x; this->y += v.y; this->z += v.z; return *this;}
    3334  inline Vector operator- (const Vector& v) const { return Vector(x - v.x, y - v.y, z - v.z); }
     35  inline const Vector& operator-= (const Vector& v) {this->x -= v.x; this->y -= v.y; this->z -= v.z; return *this;}
    3436  inline float operator* (const Vector& v) const { return x * v.x + y * v.y + z * v.z; }
     37  inline const Vector& operator*= (const Vector& v) {this->x *= v.x; this->y *= v.y; this->z *= v.z; return *this;}
    3538  inline Vector operator* (float f) const { return Vector(x * f, y * f, z * f); }
     39  inline const Vector& operator*= (float f) {this->x *= f; this->y *= f; this->z *= f; return *this;}
    3640  Vector operator/ (float f) const;
     41  inline const Vector& operator/= (float f) {this->x /= f; this->y /= f; this->z /= f; return *this;}
     42  inline const Vector& operator= (const Vector& v) {this->x = v.x; this->y = v.y; this->z = v.z; return *this;}
    3743  float dot (const Vector& v) const;
    38   inline Vector cross (const Vector& v) const {  return Vector(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x ); }
     44  inline Vector cross (const Vector& v) const { return Vector(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x ); }
    3945  void scale(const Vector& v);
    4046  inline float len() const { return sqrt (x*x+y*y+z*z); }
     
    5056                      z = z / l;
    5157                    }
    52   Vector* getNormalized();
     58  Vector getNormalized();
    5359  Vector abs();
    5460
    55   void debug();
     61  void debug() const;
    5662};
    5763
     
    7076 
    7177  inline Quaternion () { w = 1; v = Vector(0,0,0); }
    72   inline Quaternion (const Vector& b, float a) { w = a; v = b; }
     78  inline Quaternion (const Vector& v, float f) { this->w = f; this->v = v; }
    7379  Quaternion (float m[4][4]);
    7480  inline Quaternion (float angle, const Vector& axis) { w = cos(angle/2); v = axis * sin(angle/2); }
     
    7682  Quaternion (float roll, float pitch, float yaw);
    7783  Quaternion operator/ (const float& f) const;
     84  inline const Quaternion operator/= (const float& f) {*this = *this / f; return *this;}
    7885  Quaternion operator* (const float& f) const;
     86  inline const Quaternion operator*= (const float& f) {*this = *this * f; return *this;}
    7987  Quaternion operator* (const Quaternion& q) const;
     88  inline const Quaternion operator*= (const Quaternion& q) {*this = *this * q; return *this;}
    8089  inline Quaternion operator+ (const Quaternion& q) const { return Quaternion(q.v + v, q.w + w); }
     90  inline const Quaternion& operator+= (const Quaternion& q) {this->v += q.v; this->w += q.w; return *this;}
    8191  inline Quaternion operator- (const Quaternion& q) const { return Quaternion(q.v - v, q.w - w); }
     92  inline const Quaternion& operator-= (const Quaternion& q) {this->v -= q.v; this->w -= q.w; return *this;}
     93  inline Quaternion operator= (const Quaternion& q) {this->v = q.v; this->w = q.w; return *this;}
    8294  Quaternion conjugate () const {  Quaternion r(*this);
    8395  r.v = Vector() - r.v;
     
    8799  float norm () const;
    88100  void matrix (float m[4][4]) const;
    89   void quatSlerp(const Quaternion* from, const Quaternion* to, const float t, Quaternion* res);
    90101 
    91102  void debug();
    92  private:
    93   float DELTA;      //!< resolution of calculation
     103};
    94104
    95 };
     105Quaternion quatSlerp(const Quaternion& from, const Quaternion& to, float t);
     106
     107
    96108
    97109//! 3D rotation (OBSOLETE)
  • orxonox/branches/physics/src/lib/util/ini_parser.cc

    r3484 r4178  
    1616
    1717#include "ini_parser.h"
     18#include "resource_manager.h"
    1819
    1920using namespace std;
    2021
    2122/**
    22         \brief constructs an IniParser using a file
    23         \param filename: the path and name of the file to parse
     23   \brief constructs an IniParser using a file
     24   \param filename: the path and name of the file to parse
    2425*/
    25 IniParser::IniParser (char* filename)
     26IniParser::IniParser (const char* filename)
    2627{
    2728  stream = NULL;
    2829  bInSection = false;
    29   openFile(filename);
     30  this->openFile(filename);
    3031}
    3132
    3233/**
    33         \brief removes the IniParser from memory
     34   \brief removes the IniParser from memory
    3435*/
    3536IniParser::~IniParser ()
     
    4344   \return zero on success or -1 if an error occured;
    4445*/
    45 int IniParser::openFile( char* filename)
     46int IniParser::openFile(const char* filename)
    4647{
     48  char* tmpName = ResourceManager::homeDirCheck(filename);
    4749  if( filename == NULL) return -1;
    4850  if( stream != NULL)   fclose (stream);
    49   if( (stream = fopen (filename, "r")) == NULL)
     51  if( (stream = fopen (tmpName, "r")) == NULL)
    5052    {
    51       printf("IniParser could not open %s\n", filename);
     53      PRINTF(1)("IniParser could not open %s\n", filename);
     54      delete tmpName;
    5255      return -1;
    5356    }
    5457  bInSection = false;
     58  delete tmpName;
    5559  return 0;
    5660}
     
    123127          return -1;
    124128        }
    125       if( (ptr = strchr( linebuffer, '=')) != NULL)
     129      sscanf(linebuffer, "%s = %s", name, value);
     130      return 0;
     131      /*
     132        if( (ptr = strchr( tmpBuffer, '=')) != NULL)
    126133        {
    127           if( ptr == linebuffer) continue;
    128           strcpy (value, &ptr[1]);
    129           strncpy (name, linebuffer, strlen (linebuffer) - strlen (value) - 1);
    130           return 0;
     134        if( ptr == linebuffer) continue;
     135        strcpy (value, &ptr[1]);
     136        strncpy (name, linebuffer, strlen (linebuffer) - strlen (value) - 1);
     137        printf ("%s, %s\n", value, name);
     138        return 0;
    131139        }
     140      */
    132141    }
    133142  return -1;   
     
    144153   lead to unwanted behaviour.
    145154*/
    146 char* IniParser::getVar( char* name, char* section, char* defvalue = "")
     155char* IniParser::getVar(const char* name, char* section, char* defvalue = "")
    147156{
    148157  strcpy (internbuf, defvalue);
  • orxonox/branches/physics/src/lib/util/ini_parser.h

    r3484 r4178  
    2626       
    2727 public:
    28   IniParser (char* filename);
     28  IniParser (const char* filename);
    2929  ~IniParser ();
    3030 
    31   char* getVar( char* name, char* section, char* defvalue);
    32         int openFile( char* name);
     31  char* getVar(const char* name, char* section, char* defvalue);
     32  int openFile(const char* name);
    3333  int getSection( char* section);
    3434  int nextVar( char* name, char* value);
  • orxonox/branches/physics/src/orxonox.cc

    r3790 r4178  
    2222   main-programmer: Patrick Boenzli
    2323   co-programmer: Christian Meyer
    24    co-programmer: Benjamin Grauer: injected ResourceManager/GraphicsEngine
     24   co-programmer: Benjamin Grauer: injected ResourceManager/GraphicsEngine/GUI
    2525*/
    2626
    2727#include "orxonox.h"
     28
     29#include "gui.h"
    2830
    2931#include "world.h"
    3032#include "data_tank.h"
    3133#include "command_node.h"
     34#include "ini_parser.h"
    3235#include "game_loader.h"
    3336#include "graphics_engine.h"
    3437#include "resource_manager.h"
    3538#include "text_engine.h"
     39#include "factory.h"
     40#include "benchmark.h"
    3641
    3742#include <string.h>
    38 int verbose = 3;
     43
     44int verbose = 4;
    3945
    4046using namespace std;
     
    4248/**
    4349   \brief create a new Orxonox
     50
     51   In this funcitons only global values are set. The game will not be started here.
    4452*/
    4553Orxonox::Orxonox ()
    4654{
    47   pause = false;
     55  this->pause = false;
     56
     57  this->world = NULL;
     58  this->resources = NULL;
     59  this->localinput = NULL;
     60
     61  this->argc = 0;
     62  this->argv = NULL;
    4863}
    4964
     
    5368Orxonox::~Orxonox ()
    5469{
     70  int i =0;
    5571  Orxonox::singletonRef = NULL;
    5672  if( world != NULL) delete world;
    57   if( localinput != NULL) delete world;
     73  if( localinput != NULL) delete localinput;
    5874  if( resources != NULL) delete resources;
    5975  delete GraphicsEngine::getInstance(); // deleting the Graphics
     
    84100void Orxonox::getConfigFile (int argc, char** argv)
    85101{
    86   strcpy (configfilename, "orxonox.conf");
     102  strcpy (configfilename, "~/.orxonox/orxonox.conf");
    87103}
    88104
     
    92108int Orxonox::init (int argc, char** argv)
    93109{
     110  this->argc = argc;
     111  this->argv = argv;
    94112  // parse command line
    95113  // config file
     
    98116  SDL_Init (SDL_INIT_TIMER);
    99117  // initialize everything
     118  printf("> Initializing resources\n");
     119  if( initResources () == -1) return -1;
     120
    100121  if( initVideo() == -1) return -1;
    101122  if( initSound() == -1) return -1;
     
    104125  printf("> Initializing networking\n");
    105126  if( initNetworking () == -1) return -1;
    106   printf("> Initializing resources\n");
    107   if( initResources () == -1) return -1;
    108127  //printf("> Initializing world\n");
    109128  //if( init_world () == -1) return -1; PB: world will be initialized when started
     
    120139 
    121140  GraphicsEngine::getInstance();
    122  
     141   
    123142  return 0;
    124143}
     
    143162{
    144163  // create localinput
    145   localinput = new CommandNode( configfilename);
     164  localinput = new CommandNode(configfilename);
    146165 
    147166  return 0;
     
    164183int Orxonox::initResources()
    165184{
    166   //  printf("Not yet implemented\n");
    167185  PRINT(3)("initializing ResourceManager\n");
    168186  resourceManager = ResourceManager::getInstance();
    169   resourceManager->setDataDir("../data/");
    170   return 0;
     187
     188  // create parser
     189  IniParser parser (DEFAULT_CONFIG_FILE);
     190  if( parser.getSection (CONFIG_SECTION_DATA) == -1)
     191    {
     192      PRINTF(1)("Could not find Section %s in %s\n", CONFIG_SECTION_DATA, DEFAULT_CONFIG_FILE);
     193      return -1;
     194    }
     195  char namebuf[256];
     196  char valuebuf[256];
     197  memset (namebuf, 0, 256);
     198  memset (valuebuf, 0, 256);
     199 
     200  while( parser.nextVar (namebuf, valuebuf) != -1)
     201    {
     202      if (!strcmp(namebuf, CONFIG_NAME_DATADIR))
     203        {
     204          //  printf("Not yet implemented\n");
     205          if (!resourceManager->setDataDir(valuebuf))
     206            {
     207              PRINTF(1)("Data Could not be located\n");
     208              exit(-1);
     209            }
     210        }
     211     
     212      memset (namebuf, 0, 256);
     213      memset (valuebuf, 0, 256);
     214    }
     215 
     216  if (!resourceManager->checkDataDir(DEFAULT_DATA_DIR_CHECKFILE))
     217    {
     218      PRINTF(1)("The DataDirectory %s could not be verified\nPlease Change in File %s Section %s Entry %s to a suitable value\n",
     219                resourceManager->getDataDir(),
     220                DEFAULT_CONFIG_FILE,
     221                CONFIG_SECTION_DATA,
     222                CONFIG_NAME_DATADIR);
     223      exit(-1);
     224    }
     225
     226
    171227  PRINT(3)("initializing TextEngine\n");
    172228  TextEngine::getInstance();
     229
     230  return 0;
    173231}
    174232
     
    200258 
    201259  this->gameLoader = GameLoader::getInstance();
    202   this->gameLoader->loadDebugCampaign(DEBUG_CAMPAIGN_0);
     260  this->gameLoader->loadCampaign("worlds/DefaultCampaign.oxc");
     261  //  this->gameLoader->loadDebugCampaign(DEBUG_CAMPAIGN_0);
    203262  this->gameLoader->init();
    204263  this->gameLoader->start();
     
    279338
    280339
     340bool showGui = false;
    281341
    282342/**
     
    286346*/
    287347int main(int argc, char** argv)
    288 
    289  
    290   /* reading arguments
    291      
    292      currently supported arguments are:
    293      <no args>                   ::    just starts orxonox
    294      --benchmark                 ::    start the benchmark without starting orxonox
    295      
    296      this is a preselection: it matches to one of the start* functions, the
    297      finetuning is made in those functions.
    298   */
    299 
    300 
     348{
     349
     350  // here the pre-arguments are loaded, these are needed to go either to orxonx itself, Help, or Benchmark.
    301351  int i;
    302   for(i = 0; i < argc; ++i)
    303     {
    304       if(! strcmp( "--help", argv[i])) return startHelp();
    305       else if(! strcmp( "--benchmark", argv[i])) return startBenchmarks();
    306     }
    307 
    308   PRINTF(2)("Orxonox does not understand the arguments");
     352  for(i = 1; i < argc; ++i)
     353    {
     354      if(! strcmp( "--help", argv[i]) || !strcmp("-h", argv[i])) return startHelp(argc, argv);
     355      else if(!strcmp( "--benchmark", argv[i]) || !strcmp("-b", argv[i])) return startBenchmarks();
     356      else if(!strcmp( "--gui", argv[i]) || !strcmp("-g", argv[i])) showGui = true;
     357      //      else PRINTF(2)("Orxonox does not understand the arguments %s\n", argv[i]);
     358    }
     359
    309360  return startOrxonox(argc, argv);
    310361}
     
    312363
    313364
    314 int startHelp()
    315 {
    316   printf("orxonox: starts the orxonox game - rules\n");
    317   printf("usage: orxonox [arg]\n\n");
    318   printf("valid options:\n");
    319   printf(" --benchmark\tstarts the orxonox benchmark\n");
    320   printf(" --help \tshows this menu\n");
     365int startHelp(int argc, char** argv)
     366{
     367  PRINT(0)("orxonox: starts the orxonox game - rules\n");
     368  PRINT(0)("usage: orxonox [arg [arg...]]\n\n");
     369  PRINT(0)("valid options:\n");
     370  {
     371    Gui* gui = new Gui(argc, argv);
     372    gui->printHelp();
     373    delete gui;
     374  }
     375  PRINT(0)(" -b|--benchmark:\t\tstarts the orxonox benchmark\n");
     376  PRINT(0)(" -h|--help:\t\t\tshows this help\n");
    321377}
    322378
     
    324380int startOrxonox(int argc, char** argv)
    325381{
    326   printf(">>> Starting Orxonox <<<\n");
     382  // checking for existence of the configuration-files
     383  if (showGui ||
     384      !ResourceManager::isFile("~/.orxonox/orxonox.conf") ||
     385      ResourceManager::isFile("~/.orxonox/orxonox.lock"))
     386    {
     387      if (ResourceManager::isFile("~/.orxonox/orxonox.lock"))
     388        ResourceManager::deleteFile("~/.orxonox/orxonox.lock");
     389     
     390      // starting the GUI
     391      Gui* gui = new Gui(argc, argv);
     392      gui->startGui();
     393
     394      if (! gui->startOrxonox)
     395        return 0;
     396     
     397      delete gui;
     398    }
     399 
     400  PRINT(0)(">>> Starting Orxonox <<<\n");
     401
     402  ResourceManager::touchFile("~/.orxonox/orxonox.lock");
     403
    327404  Orxonox *orx = Orxonox::getInstance();
    328405 
    329406  if((*orx).init(argc, argv) == -1)
    330407    {
    331       printf("! Orxonox initialization failed\n");
     408      PRINTF(1)("! Orxonox initialization failed\n");
    332409      return -1;
    333410    }
     
    336413 
    337414  delete orx;
    338  
    339 }
    340 
    341 #if defined __linux__
    342 
    343 #include "list.h"
    344 #include "world_entity.h"
    345 #include "vector.h"
    346 #include "player.h"
    347 #include "base_object.h"
    348 #include <asm/msr.h>
    349 #include <linux/timex.h>
    350 
    351 
    352 #define LIST_MAX 1000
    353 #define VECTOR_MAX 1000000
    354 #define ITERATIONS 10000
    355 
    356 
    357 int startBenchmarks()
    358 {
    359 
    360   printf("===========================================================\n");
    361   printf("=                      BENCHMARKS                         =\n");
    362   printf("===========================================================\n");
    363   printf(" the author is not paying any attention to cacheing effects\n");
    364   printf(" of the CPU.\n\n");
    365   printf("[title]\t\t\t\t\t     [cycles]\t[loops]\n\n");
    366   //  printf("------------------------------------------------------------\n\n");
    367 
    368   // first measure the time overhead:
    369   unsigned long ini, end, dt, tmp;
    370   rdtscl(ini); rdtscl(end);
    371   dt = end - ini;
    372 
    373   int type = -1;
    374   /* type   -1 == all
    375      type    0 == framework
    376      type    1 == vector
    377      type    2 == quaternion
    378      type    3 == lists
    379   */
    380   if(type == 0 || type == -1)
    381     {
    382       /* framework test*/
    383      
    384       printf("Generating Objects:\t\t\t\t\t%i\n", ITERATIONS);
    385       /* ************WorldEntity class test************** */
    386       WorldEntity* w = NULL;
    387       int i = 0;
    388       unsigned long mittel = 0;
    389      
    390       for(i = 0; i < ITERATIONS; ++i)
    391         {
    392           rdtscl(ini);
    393          
    394           WorldEntity* w = new WorldEntity();
    395          
    396           rdtscl(end);
    397           delete w;
    398           mittel += (end - ini - dt);
    399         }
    400       float mi = mittel / (float)ITERATIONS;
    401       printf(" Generate a WorldEntity object:\t\t%11.2f\n", mi);
    402      
    403       /*
    404         mittel = 0;
    405         for(i = 0; i < ITERATIONS; ++i)
    406         {
    407         rdtscl(ini);
    408        
    409         WorldEntity* w = new Primitive(P_SPHERE);
    410        
    411         rdtscl(end);
    412         delete w;
    413         mittel += (end - ini - dt);
    414         }
    415         mi = mittel / (float)ITERATIONS;
    416         printf(" Generate a Primitive  object:\t\t%11.2f\n", mi);
    417       */
    418 
    419       mittel = 0;
    420       for(i = 0; i < ITERATIONS; ++i)
    421         {
    422           rdtscl(ini);
    423          
    424           Vector* v = new Vector();
    425          
    426           rdtscl(end);
    427           delete v;
    428           mittel += (end - ini - dt);
    429         }
    430       mi = mittel / (float)ITERATIONS;
    431       printf(" Generate a Vector object:\t\t%11.2f\n", mi);
    432 
    433 
    434      mittel = 0;
    435       for(i = 0; i < ITERATIONS; ++i)
    436         {
    437           rdtscl(ini);
    438          
    439           Quaternion* q = new Quaternion();
    440          
    441           rdtscl(end);
    442           delete q;
    443           mittel += (end - ini - dt);
    444         }
    445       mi = mittel / (float)ITERATIONS;
    446       printf(" Generate a Quaternion object:\t\t%11.2f\n", mi);
    447 
    448 
    449 
    450 
    451       printf("\nCalling function inline &| virtual, \t\t\t%i\n", ITERATIONS);
    452       mittel = 0;
    453       w = new WorldEntity();
    454       for(i = 0; i < ITERATIONS; ++i)
    455         {
    456           rdtscl(ini);
    457          
    458           w->tick(0.0f);
    459 
    460           rdtscl(end);
    461           mittel += (end - ini - dt);
    462           }
    463       //delete w;
    464       mi = mittel / (float)ITERATIONS;
    465       printf(" Virt funct tick() of WE: \t\t%11.2f\n", mi);
    466 
    467 
    468       mittel = 0;
    469       WorldEntity wo;
    470       for(i = 0; i < ITERATIONS; ++i)
    471         {
    472           rdtscl(ini);
    473          
    474           wo.tick(0.0f);
    475            
    476           rdtscl(end);
    477           mittel += (end - ini - dt);
    478           }
    479       //delete w;
    480       mi = mittel / (float)ITERATIONS;
    481       printf(" Inl virt funct tick() of WE v2: \t%11.2f\n", mi);
    482 
    483      
    484       mittel = 0;
    485       BaseObject* bo = new BaseObject();
    486       for(i = 0; i < ITERATIONS; ++i)
    487         {
    488           rdtscl(ini);
    489          
    490           bo->isFinalized();
    491            
    492           rdtscl(end);
    493           mittel += (end - ini - dt);
    494           }
    495       //delete w;
    496       mi = mittel / (float)ITERATIONS;
    497       printf(" Inl funct BaseObject::isFinazlized(): \t%11.2f\n", mi);
    498 
    499      
    500       tList<WorldEntity>* list = new tList<WorldEntity>();
    501 
    502      
    503       /* ************Primitvie class test************** */
    504       list = new tList<WorldEntity>();
    505  
    506      
    507       /*
    508         mittel = 0;
    509         w = new Primitive(P_SPHERE);
    510         for(i = 0; i < ITERATIONS; ++i)
    511         {
    512         rdtscl(ini);
    513        
    514         w->tick(0.0f);
    515        
    516         rdtscl(end);
    517         mittel += (end - ini - dt);
    518         }
    519         mi = mittel / (float)ITERATIONS;
    520         printf(" Call function tick() of Prim:\t\t%11.2f\n", mi);
    521       */
    522      
    523     }
    524  
    525   if(type == 1 || type == -1)
    526     {
    527       printf("\nDoing some simple vector operations: \t\t\t%i\n", VECTOR_MAX);
    528       /* vector test */
    529       Vector* a = new Vector(1.3, 5.3, 4.1);
    530       Vector* b = new Vector(0.4, 2.5, 6.2);
    531       Vector* c = new Vector();
    532      
    533       unsigned long mittel, ini, end;
    534       float mi;
    535       int i = 0;
    536       // addition
    537       mittel = 0;
    538       for(i = 0; i < VECTOR_MAX; ++i)
    539         {
    540           rdtscl(ini);
    541          
    542           *c = *a + *b;
    543            
    544           rdtscl(end);
    545           mittel += (end - ini - dt);
    546         }
    547       mi = mittel / (float)VECTOR_MAX;
    548       printf(" Addition of two vectors:\t\t%11.2f\n", mi);
    549      
    550       // multiplikation
    551 
    552       mittel = 0;
    553       for(i = 0; i < VECTOR_MAX; ++i)
    554         {
    555           rdtscl(ini);
    556          
    557           *c = a->cross( *b);
    558            
    559           rdtscl(end);
    560           mittel += (end - ini - dt);
    561         }
    562       mi = mittel / (float)VECTOR_MAX;
    563       printf(" CrossMult of two vectors:\t\t%11.2f\n", mi);
    564 
    565     }
    566   if( type == 2 || type == -1)
    567     {
    568       /* quaternion test */
    569       printf("\nDoing some simple quaternion operations: \t\t%i\n", VECTOR_MAX);
    570       /* vector test */
    571       Quaternion* a = new Quaternion();
    572       Quaternion* b = new Quaternion();
    573       Quaternion* c = new Quaternion();
    574      
    575       unsigned long mittel, ini, end;
    576       float mi;
    577       int i = 0;
    578       // quaternion generieren mit spez konstruktor
    579       mittel = 0;
    580       Vector* qa = new Vector(4.6, 9.3, 0.4);
    581       Vector* qb = new Vector(3.5, 6.1, 4.3);
    582       for(i = 0; i < VECTOR_MAX; ++i)
    583         {
    584           rdtscl(ini);
    585          
    586           Quaternion* qu = new Quaternion(*qa, *qb);
    587          
    588           rdtscl(end);
    589           delete qu;
    590           mittel += (end - ini - dt);
    591         }
    592       delete a;
    593       delete b;
    594       mi = mittel / (float)VECTOR_MAX;
    595       printf(" Gen. quatern. betw. two vectors:\t%11.2f\n", mi);
    596      
    597      
    598       // multiplication
    599       mittel = 0;
    600       for(i = 0; i < VECTOR_MAX; ++i)
    601         {
    602           rdtscl(ini);
    603          
    604           *c = *a * *b;
    605          
    606           rdtscl(end);
    607           mittel += (end - ini - dt);
    608         }
    609       mi = mittel / (float)VECTOR_MAX;
    610       printf(" Multiplying two quat.(=rot): a * b\t%11.2f\n", mi);
    611      
    612      
    613      
    614       // rotating a vector by a quaternion
    615       mittel = 0;
    616       for(i = 0; i < VECTOR_MAX; ++i)
    617         {
    618           rdtscl(ini);
    619          
    620           *qa = a->apply(*qb);
    621          
    622           rdtscl(end);
    623           mittel += (end - ini - dt);
    624         }
    625       mi = mittel / (float)VECTOR_MAX;
    626       printf(" Rot a vec by a quat: q->apply(v)\t%11.2f\n", mi);
    627      
    628      
    629      
    630       // generate rotation matrix
    631       mittel = 0;
    632       float matrix[4][4];
    633       for(i = 0; i < VECTOR_MAX; ++i)
    634         {
    635           rdtscl(ini);
    636          
    637           a->matrix(matrix);
    638          
    639           rdtscl(end);
    640           mittel += (end - ini - dt);
    641         }
    642       mi = mittel / (float)VECTOR_MAX;
    643       printf(" Generate rot matrix: q->matrix(m)\t%11.2f\n", mi);
    644     }
    645   if( type == 3 || type == -1)
    646     {
    647       /* list tests*/
    648       printf("\nList operations tests: \t\t\t\t\t%i\n", LIST_MAX);
    649       tList<char>* list = new tList<char>();
    650       char* name;
    651      
    652       printf(" Adding[1..10] elements to list, found:\n");
    653       list->add("1");
    654       list->add("2");
    655       list->add("3");
    656       list->add("4");
    657       list->add("5");
    658       list->add("6");
    659       list->add("7");
    660       list->add("8");
    661       list->add("9");
    662       list->add("10");
    663      
    664       /*give list out */
    665       tIterator<char>* iterator = list->getIterator();
    666       name = iterator->nextElement();
    667       printf("  List Elements: \t\t");
    668       while( name != NULL)
    669         {
    670           printf("%s,", name);
    671           name = iterator->nextElement();
    672         }
    673       delete iterator;
    674       printf("\n");
    675      
    676      
    677       /*removing some elements from the list*/
    678       printf(" Removing elements [2,3,6,8,10], adding [11] now found:\n");
    679       list->remove("2");
    680       list->remove("3");
    681       list->remove("6");
    682       list->remove("8");
    683       list->remove("10");
    684       list->add("11");
    685       /*give list out */
    686       iterator = list->getIterator();
    687       name = iterator->nextElement();
    688       printf("  List Elements: \t\t");
    689       while( name != NULL)
    690         {
    691           printf("%s,", name);
    692           name = iterator->nextElement();
    693         }
    694       delete iterator;
    695       printf("\n");
    696      
    697       delete list;
    698       printf("\nChecking list performance:\t\t\t\t%i\n", LIST_MAX);
    699      
    700       tList<int>* plist = new tList<int>();
    701       unsigned long mittel, ini, end;
    702       float mi;
    703       int i = 0;
    704       mittel = 0;
    705       for(i = 0; i < LIST_MAX; ++i)
    706         {
    707           rdtscl(ini);
    708          
    709           plist->add(&i);
    710          
    711           rdtscl(end);
    712           mittel += (end - ini - dt);
    713         }
    714       mi = mittel / (float)LIST_MAX;
    715       printf(" Adding reference to list:\t\t%11.2f\n", mi);
    716      
    717       mittel = 0;
    718       for(i = 0; i < LIST_MAX; ++i)
    719         {
    720           rdtscl(ini);
    721          
    722           plist->remove(&i);
    723          
    724           rdtscl(end);
    725           mittel += (end - ini - dt);
    726         }
    727       mi = mittel / (float)LIST_MAX;
    728       printf(" Removing 1st reference from list:\t%11.2f\n", mi);
    729      
    730 
    731       printf("\nList operations tests: \t\t\t\t\t%i\n", LIST_MAX);
    732       list = new tList<char>();
    733       printf(" Adding[1..10] elements to list, found:\n");
    734       list->add("1");
    735       list->add("2");
    736       list->add("3");
    737       list->add("4");
    738       list->add("5");
    739       list->add("6");
    740       list->add("7");
    741       list->add("8");
    742       list->add("9");
    743       list->add("10");
    744      
    745       /*give list out */
    746       iterator = list->getIterator();
    747       name = iterator->nextElement();
    748       printf("  List Elements: \t\t");
    749       while( name != NULL)
    750         {
    751           printf("%s,", name);
    752           name = iterator->nextElement();
    753         }
    754       delete iterator;
    755       printf("\n");
    756      
    757      
    758       int c = 0;
    759       printf(" Going trough list with nextElement(el) func: ");
    760       name = list->firstElement();
    761       while(c < 20)
    762         {
    763           printf("%s,", name);
    764           name = list->nextElement(name);
    765           c++;
    766         }
    767       printf("\n");
    768      
    769 
    770      
    771     }
    772  
    773 }
    774 
    775 #else
    776 
    777 int startBenchmarks()
    778 {
    779   PRINTF(1)("Benchmark is not implemented in this system\n");
    780 }
    781 
    782 #endif
     415  ResourceManager::deleteFile("~/.orxonox/orxonox.lock");
     416 
     417}
  • orxonox/branches/physics/src/orxonox.h

    r3660 r4178  
    3939  Uint32 lastframe;           //!< Time of the last Frame
    4040 
     41  unsigned int argc;          //!< Count of Arguments of orxonox
     42  char** argv;                //!< Values of th Arguments of orxonox.
     43 
    4144  void getConfigFile (int argc, char** argv);
    4245 
    43   // main loop functions
    44   //  void synchronize ();
    45   //void handle_input ();
    46   //void time_slice ();
    47   //void collision ();
    48   //void display ();
    49  
    50         // subsystem initialization
     46  // subsystem initialization
    5147  int initVideo ();
    5248  int initSound ();
     
    7571};
    7672
    77 int startHelp(void);
     73int startHelp(int argc, char** argv);
    7874int startOrxonox(int argc, char** argv);
    79 int startBenchmarks(void);
    8075
    8176#endif /* _ORXONOX_H */
  • orxonox/branches/physics/src/proto/proto_class.cc

    r3655 r4178  
    1 
    2 
    31/*
    42   orxonox - the future of 3D-vertical-scrollers
     
    1614*/
    1715
    18 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
     16//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
    1917
    2018#include "proto_class.h"
    21 
    22 #include "stdincl.h" // maybe
    2319
    2420using namespace std;
     
    4339  // delete what has to be deleted here
    4440}
    45 
    46 /**
    47    \brief nonsense - delete this method
    48    \param realy nothing to give
    49    \returns true or false - probably nothing?
    50 
    51    this is just to show the doxygen abilities (this for example is an extension for a long comment)
    52 */
    53 bool ProtoClass::doNonSense (int nothing) {}
  • orxonox/branches/physics/src/proto/proto_class.h

    r3655 r4178  
    11/*!
    22    \file proto_class.h
    3     \brief Definition of the proto class template, used quickly start work
    4     \todo Example: this shows how to use simply add a Marker that here has to be done something.
     3    \brief Definition of ...
    54
    6     The Protoclass exists, to help you quikly getting the run for how to develop in orxonox.
    7     It is an example for the CODING-CONVENTION, and a starting-point for every class.
    85*/
    96
     
    118#define _PROTO_CLASS_H
    129
    13 #include "what realy has to be included"
    1410#include "base_object.h"
    1511
    16 // FORWARD DEFINITION \\
    17 class someClassWeNeed;
     12// FORWARD DEFINITION
    1813
    1914
    20 /*class Test;*/ /* forward definition of class Test (without including it here!)*/
    2115
    22 //! A default class that aids you to start creating a new class
    23 /**
    24    here can be some longer description of this class
    25 */
     16//! A class for ...
    2617class ProtoClass : public BaseObject {
    2718
     
    3021  virtual ~ProtoClass();
    3122
    32   bool doNonSense (int nothing);
    3323
    3424 private:
    35   int nonSense;  //!< doxygen tag here like this for all the variables - delete this variable if you use this
    3625
    3726};
  • orxonox/branches/physics/src/proto/proto_singleton.h

    r3655 r4178  
    11/*!
    22    \file proto_singleton.h
    3     \brief Definition of the proto class template, used quickly start work
     3    \brief Definition of the ... singleton Class
    44   
    5     a simple file to copy and create a singleton-class from
    65*/
    76
     
    1110#include "base_object.h"
    1211
    13 // FORWARD DEFINITION \\
     12// FORWARD DEFINITION
    1413
    1514//! A default singleton class.
  • orxonox/branches/physics/src/story_entities/campaign.cc

    r3832 r4178  
    1919#include "campaign.h"
    2020
     21#include "game_loader.h"
    2122#include "story_entity.h"
    2223
     
    3435  this->isInit = false;
    3536}
    36 
     37Campaign::Campaign ( TiXmlElement* root)
     38{
     39  TiXmlElement* element;
     40  const char* string;
     41  int id;
     42 
     43  PRINTF(3)("Loading Campaign...\n");
     44 
     45  assert( root != NULL);
     46  GameLoader* loader = GameLoader::getInstance();
     47 
     48  this->entities = new tList<StoryEntity>();
     49  this->isInit = false;
     50 
     51  // grab all the necessary parameters
     52  string = grabParameter( root, "identifier");
     53  if( string == NULL || sscanf(string, "%d", &id) != 1)
     54    {
     55      PRINTF(2)("Campaign is missing a proper 'identifier'\n");
     56      this->setStoryID( -1);
     57    }
     58  else this->setStoryID( id);
     59 
     60  // find WorldList
     61  element = root->FirstChildElement( "WorldList");
     62  if( element == NULL)
     63    {
     64      PRINTF(2)("Campaign is missing a proper 'WorldList'\n");
     65    }
     66  else
     67    element = element->FirstChildElement();
     68 
     69  // load Worlds/Subcampaigns/Whatever
     70  StoryEntity* lastCreated = NULL;
     71  while( element != NULL)
     72    {
     73      printf("Campaign: Constructor: adding a world\n");
     74      StoryEntity* created = (StoryEntity*) loader->fabricate( element);
     75      /*
     76      if( lastCreated != NULL)
     77        created->setNextStoryID( lastCreated->getStoryID());
     78      else
     79        created->setNextStoryID( WORLD_ID_GAMEEND);
     80      */
     81      if( created != NULL)
     82        {
     83          this->addEntity( created);   
     84          lastCreated = created;
     85        }
     86      element = element->NextSiblingElement();
     87    }
     88  //if( lastCreated != NULL)
     89  //lastCreated->setStoryID( WORLD_ID_GAMEEND);
     90}
    3791
    3892Campaign::~Campaign () {}
  • orxonox/branches/physics/src/story_entities/campaign.h

    r3608 r4178  
    1414 public:
    1515  Campaign ();
     16  Campaign ( TiXmlElement* root);
    1617  virtual ~Campaign ();
    1718
  • orxonox/branches/physics/src/story_entities/world.cc

    r3953 r4178  
     1
    12
    23/*
     
    3940#include "garbage_collector.h"
    4041#include "animation_player.h"
     42#include "particle_engine.h"
    4143
    4244#include "command_node.h"
    4345#include "glmenu_imagescreen.h"
    4446#include "list.h"
    45 
    46 
     47#include "game_loader.h"
     48
     49#include "animation3d.h"
     50
     51#include "substring.h"
    4752
    4853using namespace std;
    49 
    5054
    5155WorldInterface* WorldInterface::singletonRef = 0;
     
    113117}
    114118
    115 
     119CREATE_FACTORY(World);
     120
     121World::World( TiXmlElement* root)
     122{
     123  this->constuctorInit("", -1);
     124  this->path = NULL;
     125  const char *string;
     126  char *name;
     127  int id;
     128 
     129  PRINTF0("Creating a World\n");
     130 
     131  // identifier
     132  string = grabParameter( root, "identifier");
     133  if( string == NULL || sscanf(string, "%d", &id) != 1)
     134    {
     135      PRINTF0("World is missing a proper 'identifier'\n");
     136      this->setStoryID( -1);
     137    }
     138  else setStoryID( id);
     139
     140  // next id
     141  string = grabParameter( root, "nextid");
     142  if( string == NULL || sscanf(string, "%d", &id) != 1)
     143    {
     144      PRINTF0("World is missing a proper 'nextid'\n");
     145      this->setStoryID( -1);
     146    }
     147  else setNextStoryID( id);
     148 
     149
     150  // path
     151  string = grabParameter( root, "path");
     152  if( string == NULL)
     153    {
     154      PRINTF0("World is missing a proper 'path'\n");
     155      this->setPath( NULL);
     156    }
     157  else
     158    {
     159      name = new char[strlen(string + 2)];
     160      strcpy( name, string);
     161      this->setPath( name);
     162    }
     163}
    116164
    117165/**
     
    122170World::World (char* name)
    123171{
    124   this->init(name, -1);
     172  this->path = NULL;
     173  this->constuctorInit(name, -1);
    125174  //NullParent* np = NullParent::getInstance();
    126175}
     
    132181World::World (int worldID)
    133182{
    134   this->init(NULL, worldID);
     183  this->path = NULL;
     184  this->constuctorInit(NULL, worldID);
    135185}
    136186
     
    148198  cn->reset();
    149199
    150   ResourceManager::getInstance()->debug();
    151   ResourceManager::getInstance()->unloadAllByPriority(RP_LEVEL);
    152   ResourceManager::getInstance()->debug();
    153 
    154200  delete WorldInterface::getInstance();
    155201
     
    158204  delete this->lightMan;
    159205  delete this->trackManager;
     206  delete this->particleEngine;
    160207  TextEngine::getInstance()->flush();
    161208
    162   AnimationPlayer::getInstance()->debug();
    163209  delete AnimationPlayer::getInstance(); // this should be at the end of the unloading sequence.
    164210  //delete garbagecollecor
    165211  //delete animator
    166212
    167 
     213  ResourceManager::getInstance()->unloadAllByPriority(RP_LEVEL);
    168214}
    169215
     
    177223   NO LEVEL LOADING HERE - NEVER!
    178224*/
    179 void World::init(char* name, int worldID)
     225void World::constuctorInit(char* name, int worldID)
    180226{
    181227  this->setClassName ("World");
    182228
    183   this->worldName = name;
     229  //this->worldName = name;
     230  //this->worldName = new char[strlen(name)+1];
     231  //strcpy(this->worldName, name);
    184232  this->debugWorldNr = worldID;
    185233  this->entities = new tList<WorldEntity>();
    186   AnimationPlayer::getInstance(); // initializes the animationPlayer
    187234}
    188235
     
    200247  wi->init(this);
    201248  this->garbageCollector = GarbageCollector::getInstance();
     249
     250  this->particleEngine = ParticleEngine::getInstance();
     251  this->trackManager = TrackManager::getInstance();
     252  this->lightMan = LightManager::getInstance();
     253  this->nullParent = NullParent::getInstance ();
     254  this->nullParent->setName ("NullParent");
     255
     256  AnimationPlayer::getInstance(); // initializes the animationPlayer
     257
     258  this->localCamera = new Camera();
     259  this->localCamera->setName ("camera");
    202260}
    203261
     
    207265*/
    208266ErrorMessage World::load()
    209 {
    210   //  BezierCurve* tmpCurve = new BezierCurve();
    211   if(this->debugWorldNr != -1)
    212     {
    213       // initializing Font
    214       this->glmis->step();
     267{       
     268  PRINTF(3)("> Loading world: '%s'\n", getPath());
     269  TiXmlElement* element;
     270  GameLoader* loader = GameLoader::getInstance();
     271 
     272  if( getPath() == NULL)
     273    {
     274      PRINTF(1)("World has no path specified for loading");
     275      return (ErrorMessage){213,"Path not specified","World::load()"};
     276    }
     277 
     278  TiXmlDocument* XMLDoc = new TiXmlDocument( path);
     279  // load the campaign document
     280  if( !XMLDoc->LoadFile()) 
     281  {
     282    // report an error
     283    PRINTF(1)("loading XML File: %s @ %d:%d\n", XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
     284    delete XMLDoc;
     285    return (ErrorMessage){213,"XML File parsing error","World::load()"};
     286  }
     287 
     288  // check basic validity
     289  TiXmlElement* root = XMLDoc->RootElement();
     290  assert( root != NULL);
     291 
     292  if( root == NULL || root->Value() == NULL || strcmp( root->Value(), "WorldDataFile"))
     293    {
     294      // report an error
     295      PRINTF(1)("Specified XML File is not an orxonox world data file (WorldDataFile element missing)\n");
     296      delete XMLDoc;
     297      return (ErrorMessage){213,"Path not a WorldDataFile","World::load()"};
     298    }
     299 
     300  // load the parameters
     301  // name
     302  char* temp;
     303  const char* string = grabParameter( root, "name");
     304  if( string == NULL)
     305    {
     306      PRINTF(2)("World is missing a proper 'name'\n");
     307      string = "Unknown";
     308      temp = new char[strlen(string + 2)];
     309      strcpy( temp, string);
     310      this->worldName = temp;
     311    }
     312  else
     313    {
     314      temp = new char[strlen(string + 2)];
     315      strcpy( temp, string);
     316      this->worldName = temp;
     317    }
     318  ////////////////
     319  // LOADSCREEN //
     320  ////////////////
     321  element = root->FirstChildElement("LoadScreen");
     322  if (element == NULL)
     323    {
     324      PRINTF(2)("no LoadScreen specified, loading default\n");
     325
     326      glmis->setBackgroundImage("pictures/load_screen.jpg");
     327      this->glmis->setMaximum(8);
     328      this->glmis->draw();
     329    }
     330  else
     331    {
     332      this->glmis->load(element);
     333      this->glmis->draw();
     334    }
     335  this->glmis->draw();
     336  // find WorldEntities
     337  element = root->FirstChildElement("WorldEntities");
     338 
     339  if( element == NULL)
     340    {
     341      PRINTF(1)("World is missing 'WorldEntities'\n");
     342    }
     343  else
     344    {
     345      element = element->FirstChildElement();
     346      // load Players/Objects/Whatever
     347      PRINTF(4)("Loading WorldEntities\n");
     348      while( element != NULL)
     349        {
     350          WorldEntity* created = (WorldEntity*) loader->fabricate( element);
     351          if( created != NULL) this->spawn( created);
     352          // if we load a 'Player' we use it as localPlayer
     353          //todo do this more elegant
     354          if( element->Value() != NULL && !strcmp( element->Value(), "Player")) localPlayer = (Player*) created;
     355          if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox")) sky = (SkyBox*) created;
     356          element = element->NextSiblingElement();
     357          glmis->step(); //! \todo temporary
     358        }
     359      PRINTF(4)("Done loading WorldEntities\n");
     360    }
     361 
     362  // find Track
     363  /*element = root->FirstChildElement( "Track");
     364  if( element == NULL)
     365    {
     366      PRINTF0("============>>>>>>>>>>>>>>>>>World is missing a 'Track'\n");
     367    }
     368  else
     369    {   
     370      //load track
     371      PRINTF0("============>>>>>>>>>>>>>>>>Loading Track\n");
     372
     373      trackManager->loadTrack( element);
     374      trackManager->finalize();
     375      PRINTF0("============>>>>>>>>>>>>>>>>Done loading Track\n");
     376    }*/
     377 
     378  // free the XML data
     379
     380  delete XMLDoc;
     381  /* GENERIC LOADING PROCESS FINISHED */
     382 
     383  // bind input
     384  Orxonox *orx = Orxonox::getInstance ();
     385  orx->getLocalInput()->bind (localPlayer);
     386 
     387  // bind camera
     388  //this->localCamera->bind (localPlayer);
     389  this->localPlayer->addChild (this->localCamera);
     390 
     391 
     392  // stuff beyond this point remains to be loaded properly
     393 
    215394      // initializing the TrackManager
    216       trackManager = TrackManager::getInstance();
     395  this->trackManager = TrackManager::getInstance();
    217396      //trackManager->addPoint(Vector(0,0,0));
    218397      trackManager->addPoint(Vector(150, -35, 5));
     
    272451
    273452     
    274       /*monitor progress*/
    275       this->glmis->step();
    276 
    277       // LIGHT initialisation
    278       lightMan = LightManager::getInstance();
    279       lightMan->setAmbientColor(.1,.1,.1);
    280       lightMan->addLight();
    281       //      lightMan->setAttenuation(1.0, .01, 0.0);
    282       //      lightMan->setDiffuseColor(1,1,1);
    283       //  lightMan->addLight(1);
    284       //  lightMan->setPosition(20, 10, -20);
    285       //  lightMan->setDiffuseColor(0,0,0);
    286       lightMan->debug();
    287 
    288       switch(this->debugWorldNr)
    289         {
    290           /*
    291             this loads the hard-coded debug world. this only for simplicity and will be
    292             removed by a reald world-loader, which interprets a world-file.
    293             if you want to add an own debug world, just add a case DEBUG_WORLD_[nr] and
    294             make whatever you want...
    295            */
    296         case DEBUG_WORLD_0:
    297           {
    298             lightMan->setPosition(-5.0, 10.0, -40.0);
    299             this->nullParent = NullParent::getInstance ();
    300             this->nullParent->setName ("NullParent");
    301 
    302             // !\todo old track-system has to be removed
    303 
    304             //create helper for player
    305             //HelperParent* hp = new HelperParent ();
    306             /* the player has to be added to this helper */
    307 
    308             // create a player
    309             this->localPlayer = new Player ();
    310             this->localPlayer->setName ("player");
    311             this->spawn (this->localPlayer);
    312             /*monitor progress*/
    313             //this->glmis->step();
    314             this->glmis->step();
    315 
    316             // bind input
    317             Orxonox *orx = Orxonox::getInstance ();
    318             orx->getLocalInput()->bind (this->localPlayer);
     453  lightMan->setAmbientColor(.1,.1,.1);
     454  lightMan->addLight();
     455  //      lightMan->setAttenuation(1.0, .01, 0.0);
     456  //      lightMan->setDiffuseColor(1,1,1);
     457  //  lightMan->addLight(1);
     458  //  lightMan->setPosition(20, 10, -20);
     459  //  lightMan->setDiffuseColor(0,0,0);
     460  lightMan->debug();
     461  lightMan->setPosition(-5.0, 10.0, -40.0);
     462 
     463  //        trackManager->setBindSlave(env);
     464  PNode* tn = trackManager->getTrackNode();
     465  tn->addChild(this->localPlayer);
     466 
     467  //localCamera->setParent(TrackNode::getInstance());
     468  tn->addChild(this->localCamera);
     469  localCamera->lookAt(tn);
     470  localCamera->setMode(PNODE_MOVEMENT);
     471  this->localPlayer->setMode(PNODE_ALL);
     472  Vector* cameraOffset = new Vector (0, 5, -10);
     473  trackManager->condition(2, LEFTRIGHT, this->localPlayer);
     474 
     475  this->sky->setParent(this->localCamera);
     476
     477  // initialize debug coord system
     478  objectList = glGenLists(1);
     479  glNewList (objectList, GL_COMPILE);
     480 
     481  //  trackManager->drawGraph(.01);
     482  trackManager->debug(2);
     483  glEndList();
     484
     485  terrain = new Terrain("worlds/newGround.obj");
     486  terrain->setRelCoor(Vector(0,-10,0));
     487  this->spawn(terrain);
     488
     489
     490  ParticleSystem* system = new ParticleSystem(1000, PARTICLE_SPRITE);
     491  system->setLifeSpan(.5);
     492  system->setConserve(.99);
     493  system->setRadius(2, 0, 2, 0);
     494
     495  ParticleEmitter* emitter = new ParticleEmitter(Vector(-1, 0, 0), M_PI_4, 100, .05);
     496  emitter->setParent(this->localPlayer);
     497 
     498  particleEngine->addConnection(emitter, system);
     499}
     500
     501void World::loadDebugWorld(int worldID)
     502{
     503  /*monitor progress*/
     504  this->glmis->step();
     505
     506  // LIGHT initialisation
     507
     508  lightMan->setAmbientColor(.1,.1,.1);
     509  lightMan->addLight();
     510  //      lightMan->setAttenuation(1.0, .01, 0.0);
     511  //      lightMan->setDiffuseColor(1,1,1);
     512  //  lightMan->addLight(1);
     513  //  lightMan->setPosition(20, 10, -20);
     514  //  lightMan->setDiffuseColor(0,0,0);
     515  lightMan->debug();
     516
     517  switch(this->debugWorldNr)
     518    {
     519      /*
     520        this loads the hard-coded debug world. this only for simplicity and will be
     521        removed by a reald world-loader, which interprets a world-file.
     522        if you want to add an own debug world, just add a case DEBUG_WORLD_[nr] and
     523        make whatever you want...
     524      */
     525    case DEBUG_WORLD_0:
     526      {
     527        lightMan->setPosition(-5.0, 10.0, -40.0);
     528
     529        // !\todo old track-system has to be removed
     530
     531        //create helper for player
     532        //HelperParent* hp = new HelperParent ();
     533        /* the player has to be added to this helper */
     534
     535        // create a player
     536        this->localPlayer = new Player ();
     537        this->localPlayer->setName ("player");
     538        this->spawn (this->localPlayer);
     539        /*monitor progress*/
     540        //this->glmis->step();
     541        this->glmis->step();
     542
     543        // bind input
     544        Orxonox *orx = Orxonox::getInstance ();
     545        orx->getLocalInput()->bind (this->localPlayer);
    319546           
    320             // bind camera
    321             this->localCamera = new Camera();
    322             this->localCamera->setName ("camera");
     547        // bind camera
     548        this->localCamera = new Camera();
     549        this->localCamera->setName ("camera");
    323550           
    324             /*monitor progress*/
    325             this->glmis->step();
    326 
    327             // Create SkySphere
    328             //      this->skySphere = new Skysphere("../data/pictures/sky-replace.jpg");
    329             //      this->skySphere->setName("SkySphere");
    330             //      this->localCamera->addChild(this->skySphere);
    331             //      this->spawn(this->skySphere);
    332             skyBox = new SkyBox();
    333             skyBox->setTexture("pictures/sky/skybox", "jpg");
    334             skyBox->setParent(localCamera);
    335             this->spawn(skyBox);
    336 
    337             /*monitor progress*/
    338             this->glmis->step();
     551        /*monitor progress*/
     552        this->glmis->step();
     553
     554        sky = new SkyBox();
     555        //      (SkyBox*)(sky)->setTexture("pictures/sky/skybox", "jpg");
     556        sky->setParent(localCamera);
     557        this->spawn(sky);
     558
     559        /*monitor progress*/
     560        this->glmis->step();
    339561
    340562           
    341             WorldEntity* env = new Environment();
    342             env->setName ("env");
    343             this->spawn(env);
     563        WorldEntity* env = new Environment();
     564        env->setName ("env");
     565        this->spawn(env);
    344566
    345567           
    346             /*
    347             Vector* es = new Vector (10, 5, 0);
    348             Quaternion* qs = new Quaternion ();
    349             WorldEntity* pr = new Primitive(P_CYLINDER);
    350             pr->setName("primitive");
    351             this->spawn(pr, this->localPlayer, es, qs, PNODE_MOVEMENT);
    352             */
    353 
    354             /*monitor progress*/
    355             this->glmis->step();
    356 
    357             //      trackManager->setBindSlave(env);
    358             PNode* tn = trackManager->getTrackNode();
    359             tn->addChild(this->localPlayer);
    360             this->localCamera->lookAt(tn);
    361 
    362             //localCamera->setParent(TrackNode::getInstance());
    363             tn->addChild(this->localCamera);
    364             //      localCamera->lookAt(tn);
    365             this->localPlayer->setMode(PNODE_ALL);
    366             //Vector* cameraOffset = new Vector (0, 5, -10);
    367             trackManager->condition(2, LEFTRIGHT, this->localPlayer);
    368             this->glmis->step();
    369             break;
    370           }
    371         case DEBUG_WORLD_1:
    372           {
    373             lightMan->setPosition(.0, .0, .0);
    374             lightMan->setAttenuation(1.0, .01, 0.0);
    375             lightMan->setSpecularColor(1,0,0);
    376             this->nullParent = NullParent::getInstance ();
    377             this->nullParent->setName ("NullParent");
    378 
    379             // create a player
    380             WorldEntity* myPlayer = new Player();
    381             myPlayer->setName ("player");
    382             this->spawn(myPlayer);
    383             this->localPlayer = myPlayer;           
     568        /*
     569          Vector* es = new Vector (10, 5, 0);
     570          Quaternion* qs = new Quaternion ();
     571          WorldEntity* pr = new Primitive(P_CYLINDER);
     572          pr->setName("primitive");
     573          this->spawn(pr, this->localPlayer, es, qs, PNODE_MOVEMENT);
     574        */
     575
     576        /*monitor progress*/
     577        this->glmis->step();
     578
     579        //          trackManager->setBindSlave(env);
     580        PNode* tn = trackManager->getTrackNode();
     581        tn->addChild(this->localPlayer);
     582        this->localCamera->lookAt(tn);
     583
     584        //localCamera->setParent(TrackNode::getInstance());
     585        tn->addChild(this->localCamera);
     586        //          localCamera->lookAt(tn);
     587        this->localPlayer->setMode(PNODE_ALL);
     588        //Vector* cameraOffset = new Vector (0, 5, -10);
     589        trackManager->condition(2, LEFTRIGHT, this->localPlayer);
     590        this->glmis->step();
     591        break;
     592      }
     593    case DEBUG_WORLD_1:
     594      {
     595        lightMan->setPosition(.0, .0, .0);
     596        lightMan->setAttenuation(1.0, .01, 0.0);
     597        lightMan->setSpecularColor(1,0,0);
     598        this->nullParent = NullParent::getInstance ();
     599        this->nullParent->setName ("NullParent");
     600
     601        // create a player
     602        WorldEntity* myPlayer = new Player();
     603        myPlayer->setName ("player");
     604        this->spawn(myPlayer);
     605        this->localPlayer = myPlayer;       
    384606           
    385             // bind input
    386             Orxonox *orx = Orxonox::getInstance();
    387             orx->getLocalInput()->bind (myPlayer);
     607        // bind input
     608        Orxonox *orx = Orxonox::getInstance();
     609        orx->getLocalInput()->bind (myPlayer);
    388610           
    389             // bind camera
    390             this->localCamera = new Camera ();
    391             this->localCamera->setName ("camera");
    392             this->localCamera->lookAt(LightManager::getInstance()->getLight(0));
    393             this->localCamera->setParent(this->localPlayer);
    394 
    395             // Create SkySphere
    396             skySphere = new Skysphere("../data/pictures/sky-replace.jpg");
    397             this->localPlayer->addChild(this->skySphere);
    398             this->spawn(this->skySphere);
    399             Vector* es = new Vector (20, 0, 0);
    400             Quaternion* qs = new Quaternion ();
    401 
    402             lightMan->getLight(0)->setParent(trackManager->getTrackNode());
    403             break;
    404           }
    405         case DEBUG_WORLD_2:
    406           {
    407             lightMan->setAmbientColor(.1,.1,.1);
    408             lightMan->addLight();
    409             lightMan->setPosition(-5.0, 10.0, -40.0);
    410             this->nullParent = NullParent::getInstance ();
    411             this->nullParent->setName ("NullParent");
    412 
    413             // !\todo old track-system has to be removed
    414 
    415             //create helper for player
    416             //HelperParent* hp = new HelperParent ();
    417             /* the player has to be added to this helper */
    418 
    419             // create a player
    420             this->localPlayer = new Player ();
    421             this->localPlayer->setName ("player");
    422             this->spawn (this->localPlayer);
    423             /*monitor progress*/
    424             //this->glmis->step();         
    425             this->glmis->step();
    426 
    427             // bind input
    428             Orxonox *orx = Orxonox::getInstance ();
    429             orx->getLocalInput()->bind (this->localPlayer);
     611        // bind camera
     612        this->localCamera = new Camera ();
     613        this->localCamera->setName ("camera");
     614        this->localCamera->lookAt(LightManager::getInstance()->getLight(0));
     615        this->localCamera->setParent(this->localPlayer);
     616
     617        // Create SkySphere
     618        sky = new Skysphere("pictures/sky-replace.jpg");
     619        this->localPlayer->addChild(this->sky);
     620        this->spawn(this->sky);
     621        Vector* es = new Vector (20, 0, 0);
     622        Quaternion* qs = new Quaternion ();
     623
     624        lightMan->getLight(0)->setParent(trackManager->getTrackNode());
     625        break;
     626      }
     627    case DEBUG_WORLD_2:
     628      {
     629        lightMan->setAmbientColor(.1,.1,.1);
     630        lightMan->addLight();
     631        lightMan->setPosition(-5.0, 10.0, -40.0);
     632        this->nullParent = NullParent::getInstance ();
     633        this->nullParent->setName ("NullParent");
     634
     635        // !\todo old track-system has to be removed
     636
     637        //create helper for player
     638        //HelperParent* hp = new HelperParent ();
     639        /* the player has to be added to this helper */
     640
     641        // create a player
     642        this->localPlayer = new Player ();
     643        this->localPlayer->setName ("player");
     644        this->spawn (this->localPlayer);
     645        /*monitor progress*/
     646        //this->glmis->step();     
     647        this->glmis->step();
     648
     649        // bind input
     650        Orxonox *orx = Orxonox::getInstance ();
     651        orx->getLocalInput()->bind (this->localPlayer);
    430652           
    431             // bind camera
    432             this->localCamera = new Camera();
    433             this->localCamera->setName ("camera");
    434             this->localCamera->lookAt(this->localPlayer);
    435             this->localCamera->setParent(this->localPlayer);
     653        // bind camera
     654        this->localCamera = new Camera();
     655        this->localCamera->setName ("camera");
     656        this->localCamera->lookAt(this->localPlayer);
     657        this->localCamera->setParent(this->localPlayer);
    436658           
    437             /*monitor progress*/
    438             this->glmis->step();
    439 
    440             // Create SkySphere
    441             this->skySphere = new Skysphere("../data/pictures/sky-replace.jpg");
    442             this->skySphere->setName("SkySphere");
    443             this->spawn(this->skySphere);
    444             this->localCamera->addChild(this->skySphere);
    445             this->skySphere->setMode(PNODE_MOVEMENT);
    446             /*monitor progress*/
    447             this->glmis->step();
    448 
    449 
    450             WorldEntity* baseNode = new Satellite(Vector(1,0,1), 1.2);
    451             this->localPlayer->addChild(baseNode);
    452             baseNode->setRelCoor(Vector(10.0, 2.0, 1.0));
    453             this->spawn(baseNode);
    454 
    455             WorldEntity* secondNode = new Satellite(Vector(0,0,1), 2.0);
    456             baseNode->addChild(secondNode);
    457             secondNode->setRelCoor(Vector(0.0, 0.0, 3.0));
    458             this->spawn(secondNode);
    459 
    460 
    461             WorldEntity* thirdNode = new Satellite(Vector(0,0,1), 1.0);
    462             secondNode->addChild(thirdNode);
    463             thirdNode->setRelCoor(Vector(2.0, 0.0, 0.0));
    464             this->spawn(thirdNode);
     659        /*monitor progress*/
     660        this->glmis->step();
     661
     662        // Create SkySphere
     663        this->sky = new Skysphere("pictures/sky-replace.jpg");
     664        this->sky->setName("SkySphere");
     665        this->spawn(this->sky);
     666        this->localCamera->addChild(this->sky);
     667        this->sky->setMode(PNODE_MOVEMENT);
     668        /*monitor progress*/
     669        this->glmis->step();
     670
     671
     672        WorldEntity* baseNode = new Satellite(Vector(1,0,1), 1.2);
     673        this->localPlayer->addChild(baseNode);
     674        baseNode->setRelCoor(Vector(10.0, 2.0, 1.0));
     675        this->spawn(baseNode);
     676
     677        WorldEntity* secondNode = new Satellite(Vector(0,0,1), 2.0);
     678        baseNode->addChild(secondNode);
     679        secondNode->setRelCoor(Vector(0.0, 0.0, 3.0));
     680        this->spawn(secondNode);
     681
     682
     683        WorldEntity* thirdNode = new Satellite(Vector(0,0,1), 1.0);
     684        secondNode->addChild(thirdNode);
     685        thirdNode->setRelCoor(Vector(2.0, 0.0, 0.0));
     686        this->spawn(thirdNode);
    465687
    466688           
     689   
     690        WorldEntity* c = new Environment();
     691        this->localPlayer->addChild(c);
     692        c->setRelCoor(Vector(10.0, 2.0, -1.0));
     693        this->spawn(c);
     694
     695
    467696           
    468 
    469             WorldEntity* b = new Environment();
    470             this->localPlayer->addChild(b);
    471             b->setRelCoor(Vector(10.0, 1.0, 1.0));
    472             this->spawn(b);
    473 
    474            
    475             WorldEntity* c = new Environment();
    476             this->localPlayer->addChild(c);
    477             c->setRelCoor(Vector(10.0, 2.0, -1.0));
    478             this->spawn(c);
    479            
    480             /*     
    481                   KeyFrame* f1 = new KeyFrame;
    482                   f1->position = new Vector(-1.1, 0.0, 2.6);
    483                   f1->direction = new Quaternion();
    484                   f1->time = 1.0;
    485                   f1->mode = NEG_EXP;
     697        Animation3D* animation = new Animation3D(c);
     698        animation->setInfinity(ANIM_INF_REPLAY);
     699
     700
     701        animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR);
     702        animation->addKeyFrame(Vector(0, 2, 0), Quaternion(M_PI, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR);
     703        animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR);
     704
     705
     706
     707
     708
     709
     710        /*         
     711          KeyFrame* f1 = new KeyFrame;
     712          f1->position = new Vector(-1.1, 0.0, 2.6);
     713          f1->direction = new Quaternion();
     714          f1->time = 1.0;
     715          f1->mode = NEG_EXP;
    486716                 
    487717                 
    488                   KeyFrame* f2 = new KeyFrame;
    489                   f2->position = new Vector(-2.1, 0.0, 2.6);
    490                   f2->direction = new Quaternion();
    491                   f2->time = 0.1;
    492                   f2->mode = NEG_EXP;
     718          KeyFrame* f2 = new KeyFrame;
     719          f2->position = new Vector(-2.1, 0.0, 2.6);
     720          f2->direction = new Quaternion();
     721          f2->time = 0.1;
     722          f2->mode = NEG_EXP;
    493723                 
    494                   KeyFrame* f3 = new KeyFrame;
    495                   f3->position = new Vector(10.0, 2.0, -1.0);
    496                   f3->direction = new Quaternion();
    497                   f3->time = 0.2;
    498                   f3->mode = NEG_EXP;
     724          KeyFrame* f3 = new KeyFrame;
     725          f3->position = new Vector(10.0, 2.0, -1.0);
     726          f3->direction = new Quaternion();
     727          f3->time = 0.2;
     728          f3->mode = NEG_EXP;
    499729                 
    500                   KeyFrame* f4 = new KeyFrame;
    501                   f4->position = new Vector(10.0, 5.0, -1.0);
    502                   f4->direction = new Quaternion();
    503                   f4->time = 1.0;
    504                   f4->mode = NEG_EXP;
     730          KeyFrame* f4 = new KeyFrame;
     731          f4->position = new Vector(10.0, 5.0, -1.0);
     732          f4->direction = new Quaternion();
     733          f4->time = 1.0;
     734          f4->mode = NEG_EXP;
    505735                 
    506736                 
    507737                 
    508                   this->simpleAnimation->animatorBegin();
    509                   this->simpleAnimation->selectObject(b);
    510                   this->simpleAnimation->setAnimationMode(SINGLE);
    511                   this->simpleAnimation->addKeyFrame(f1);
    512                   this->simpleAnimation->addKeyFrame(f2);
    513                   this->simpleAnimation->start();
    514                   this->simpleAnimation->selectObject(c);
    515                   this->simpleAnimation->addKeyFrame(f3);
    516                   this->simpleAnimation->addKeyFrame(f4);
    517                   this->simpleAnimation->start();
    518                   this->simpleAnimation->animatorEnd();
    519             */
    520 
    521             /*
    522             Vector* es = new Vector (10, 5, 0);
    523             Quaternion* qs = new Quaternion ();
    524             WorldEntity* pr = new Primitive(P_CYLINDER);
    525             pr->setName("primitive");
    526             this->spawn(pr, this->localPlayer, es, qs, PNODE_MOVEMENT);
    527             */
    528 
    529             /*monitor progress*/
    530             this->glmis->step();
    531 
    532             //      trackManager->setBindSlave(env);
    533             PNode* tn = trackManager->getTrackNode();
    534             tn->addChild(this->localPlayer);
    535 
    536             //localCamera->setParent(TrackNode::getInstance());
    537             tn->addChild(this->localCamera);
    538             //      localCamera->lookAt(tn);
    539             this->localPlayer->setMode(PNODE_ALL);
    540             //Vector* cameraOffset = new Vector (0, 5, -10);
    541             trackManager->condition(2, LEFTRIGHT, this->localPlayer);
    542             this->glmis->step();
    543 
    544             break;
    545           }
    546         default:
    547           printf("World::load() - no world with ID %i found", this->debugWorldNr );
    548         }
    549     }
    550   else if(this->worldName != NULL)
    551     {
    552 
    553     }
    554 
    555   // initialize debug coord system
    556   objectList = glGenLists(1);
    557   glNewList (objectList, GL_COMPILE);
    558  
    559   //  trackManager->drawGraph(.01);
    560   trackManager->debug(2);
    561   glEndList();
    562 
    563   terrain = new Terrain("../data/worlds/newGround.obj");
    564   terrain->setRelCoor(Vector(0,-10,0));
    565   this->spawn(terrain);
    566 
    567 }
     738          this->simpleAnimation->animatorBegin();
     739          this->simpleAnimation->selectObject(b);
     740          this->simpleAnimation->setAnimationMode(SINGLE);
     741          this->simpleAnimation->addKeyFrame(f1);
     742          this->simpleAnimation->addKeyFrame(f2);
     743          this->simpleAnimation->start();
     744          this->simpleAnimation->selectObject(c);
     745          this->simpleAnimation->addKeyFrame(f3);
     746          this->simpleAnimation->addKeyFrame(f4);
     747          this->simpleAnimation->start();
     748          this->simpleAnimation->animatorEnd();
     749        */
     750
     751        /*
     752          Vector* es = new Vector (10, 5, 0);
     753          Quaternion* qs = new Quaternion ();
     754          WorldEntity* pr = new Primitive(P_CYLINDER);
     755          pr->setName("primitive");
     756          this->spawn(pr, this->localPlayer, es, qs, PNODE_MOVEMENT);
     757        */
     758
     759        /*monitor progress*/
     760        this->glmis->step();
     761
     762        //          trackManager->setBindSlave(env);
     763        PNode* tn = trackManager->getTrackNode();
     764        tn->addChild(this->localPlayer);
     765
     766        //localCamera->setParent(TrackNode::getInstance());
     767        tn->addChild(this->localCamera);
     768        //          localCamera->lookAt(tn);
     769        this->localPlayer->setMode(PNODE_ALL);
     770        //Vector* cameraOffset = new Vector (0, 5, -10);
     771        trackManager->condition(2, LEFTRIGHT, this->localPlayer);
     772        this->glmis->step();
     773
     774        break;
     775      }
     776    default:
     777      printf("World::load() - no world with ID %i found", this->debugWorldNr );
     778    }
     779}
     780
    568781
    569782
     
    637850 
    638851  //GLMenuImageScreen*
    639   this->glmis = GLMenuImageScreen::getInstance();
     852  this->glmis = new GLMenuImageScreen();
    640853  this->glmis->init();
    641854  this->glmis->setMaximum(8);
    642   this->glmis->draw();
     855  //  this->glmis->draw();
    643856 
    644857  PRINTF(3)("World::displayLoadScreen - end\n");
     
    654867  PRINTF(3)("World::releaseLoadScreen - start\n");
    655868  this->glmis->setValue(this->glmis->getMaximum());
    656   //SDL_Delay(500);
    657869  PRINTF(3)("World::releaseLoadScreen - end\n");
     870  delete this->glmis;
    658871}
    659872
     
    745958
    746959  TextEngine::getInstance()->draw();
     960  particleEngine->draw(this->dtS); //!< \todo should be dts like in the Trunk;
     961
    747962  lightMan->draw(); // must be at the end of the drawing procedure, otherwise Light cannot be handled as PNodes //
    748963}
     
    8401055      this->tick ();
    8411056      // Update the state
    842       this->update ();      
     1057      this->update ();     
    8431058      // Process collision
    8441059      this->collide ();
     
    9121127     
    9131128      /* function to let all entities tick (iterate through list) */
    914       float seconds = this->dt / 1000.0;     
    915       this->gameTime += seconds;
     1129      this->dtS = (float)this->dt / 1000.0;     
     1130      this->gameTime += this->dtS;
    9161131      //entity = entities->enumerate();
    9171132      tIterator<WorldEntity>* iterator = this->entities->getIterator();
     
    9191134      while( entity != NULL)
    9201135        {
    921           entity->tick (seconds);
     1136          entity->tick (this->dtS);
    9221137          entity = iterator->nextElement();
    9231138        }
    9241139      delete iterator;
    925       //skySphere->updatePosition(localCamera->absCoordinate);
    926      
     1140
    9271141      /* update tick the rest */
    9281142      this->trackManager->tick(this->dt);
    9291143      this->localCamera->tick(this->dt);
    930       this->garbageCollector->tick(seconds);
    931 
    932       AnimationPlayer::getInstance()->tick(seconds);
     1144      this->garbageCollector->tick(this->dtS);
     1145
     1146      AnimationPlayer::getInstance()->tick(this->dtS);
     1147      particleEngine->tick(this->dtS);
    9331148    }
    9341149  this->lastFrame = currentFrame;
     
    9451160{
    9461161  this->garbageCollector->update();
    947   this->nullParent->update (dt);
     1162  this->nullParent->update (this->dtS);
    9481163}
    9491164
     
    10331248bool World::command(Command* cmd)
    10341249{
    1035   if( !strcmp( cmd->cmd, "view0")) this->localCamera->setViewMode(VIEW_NORMAL);
    1036   else if( !strcmp( cmd->cmd, "view1")) this->localCamera->setViewMode(VIEW_BEHIND);
    1037   else if( !strcmp( cmd->cmd, "view2")) this->localCamera->setViewMode(VIEW_FRONT);
    1038   else if( !strcmp( cmd->cmd, "view3")) this->localCamera->setViewMode(VIEW_LEFT);
    1039   else if( !strcmp( cmd->cmd, "view4")) this->localCamera->setViewMode(VIEW_RIGHT);
    1040   else if( !strcmp( cmd->cmd, "view5")) this->localCamera->setViewMode(VIEW_TOP);
     1250  if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW0)) this->localCamera->setViewMode(VIEW_NORMAL);
     1251  else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW1)) this->localCamera->setViewMode(VIEW_BEHIND);
     1252  else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW2)) this->localCamera->setViewMode(VIEW_FRONT);
     1253  else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW3)) this->localCamera->setViewMode(VIEW_LEFT);
     1254  else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW4)) this->localCamera->setViewMode(VIEW_RIGHT);
     1255  else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW5)) this->localCamera->setViewMode(VIEW_TOP);
    10411256
    10421257  return false;
    10431258}
    10441259
     1260void World::setPath( const char* name)
     1261{
     1262  if (this->path)
     1263    delete this->path;
     1264  if (ResourceManager::isFile(name))
     1265  {
     1266    this->path = new char[strlen(name)+1];
     1267    strcpy(this->path, name);
     1268  }
     1269  else
     1270    {
     1271      this->path = new char[strlen(ResourceManager::getInstance()->getDataDir()) + strlen(name) +1];
     1272      sprintf(this->path, "%s%s", ResourceManager::getInstance()->getDataDir(), name);
     1273    }
     1274}
     1275
     1276const char* World::getPath( void)
     1277{
     1278  return path;
     1279}
  • orxonox/branches/physics/src/story_entities/world.h

    r3851 r4178  
    1111#include "story_entity.h"
    1212#include "p_node.h"
    13 
     13#include "xmlparser/tinyxml.h"
    1414
    1515class World;
     
    1919class PNode;
    2020class GLMenuImageScreen;
    21 class Skysphere;
    22 class SkyBox;
    2321class LightManager;
     22class ParticleEngine;
    2423class Terrain;
    2524class GarbageCollector;
     
    5756  World (char* name);
    5857  World (int worldID);
     58  World (TiXmlElement* root);
    5959  virtual ~World ();
    6060
     
    7070  virtual ErrorMessage resume ();
    7171  virtual ErrorMessage destroy ();
     72
     73  void loadDebugWorld(int worldID);
    7274
    7375  virtual void displayLoadScreen();
     
    8587             int parentingMode);
    8688
     89  const char* getPath();
     90  void setPath( const char* name);
    8791
    8892 private:
    89   void init(char* name, int worldID);
     93  void constuctorInit(char* name, int worldID);
    9094
    9195  Uint32 lastFrame;                   //!< last time of frame
    9296  Uint32 dt;                          //!< time needed to calculate this frame
     97  float dtS;                          //!< The time needed for caluculations in seconds
    9398  double gameTime;                    //!< this is where the game time is saved
    9499  bool bQuitOrxonox;                  //!< quit this application
     
    100105  char* worldName;                    //!< The name of this World
    101106  int debugWorldNr;                   //!< The Debug Nr. needed, if something goes wrong
     107  char* path;                         //!< The file from which this world is loaded
    102108
    103109  PNode* nullParent;                  //!< The zero-point, that everything has as its parent.
    104110  TrackManager* trackManager;         //!< The reference of the TrackManager that handles the course through the Level.
     111  ParticleEngine* particleEngine;     //!< The ParticleEngine of the World.
    105112  Camera* localCamera;                //!< The current Camera
    106   Skysphere* skySphere;               //!< The Environmental Heaven of orxonox \todo insert this to environment insted
    107   SkyBox* skyBox;
     113  WorldEntity* sky;                   //!< The Environmental Heaven of orxonox \todo insert this to environment insted
    108114  LightManager* lightMan;             //!< The Lights of the Level
    109115  Terrain* terrain;                   //!< The Terrain of the World.
  • orxonox/branches/physics/src/subprojects/Makefile.in

    r3789 r4178  
    8989EXEEXT = @EXEEXT@
    9090GPROF = @GPROF@
    91 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
    92 GTHREAD_LIBS = @GTHREAD_LIBS@
    9391GTK2_CFLAGS = @GTK2_CFLAGS@
    9492GTK2_LIBS = @GTK2_LIBS@
    9593HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
    9694HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
    97 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
    98 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    9995HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    10096HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
     
    117113PACKAGE_VERSION = @PACKAGE_VERSION@
    118114PATH_SEPARATOR = @PATH_SEPARATOR@
     115PKG_CONFIG = @PKG_CONFIG@
     116RANLIB = @RANLIB@
    119117SET_MAKE = @SET_MAKE@
    120118SHELL = @SHELL@
     
    125123ac_ct_CC = @ac_ct_CC@
    126124ac_ct_CXX = @ac_ct_CXX@
     125ac_ct_RANLIB = @ac_ct_RANLIB@
    127126ac_ct_STRIP = @ac_ct_STRIP@
    128127am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
  • orxonox/branches/physics/src/subprojects/testmain/Makefile.in

    r3789 r4178  
    104104EXEEXT = @EXEEXT@
    105105GPROF = @GPROF@
    106 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
    107 GTHREAD_LIBS = @GTHREAD_LIBS@
    108106GTK2_CFLAGS = @GTK2_CFLAGS@
    109107GTK2_LIBS = @GTK2_LIBS@
    110108HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
    111109HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
    112 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
    113 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    114110HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    115111HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
     
    132128PACKAGE_VERSION = @PACKAGE_VERSION@
    133129PATH_SEPARATOR = @PATH_SEPARATOR@
     130PKG_CONFIG = @PKG_CONFIG@
     131RANLIB = @RANLIB@
    134132SET_MAKE = @SET_MAKE@
    135133SHELL = @SHELL@
     
    140138ac_ct_CC = @ac_ct_CC@
    141139ac_ct_CXX = @ac_ct_CXX@
     140ac_ct_RANLIB = @ac_ct_RANLIB@
    142141ac_ct_STRIP = @ac_ct_STRIP@
    143142am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
  • orxonox/branches/physics/src/track_manager.cc

    r3953 r4178  
    312312  PNode* tmpNode = (PNode*)node;
    313313
    314   if (tmpNode->getRelCoor()->z < 0)
     314  if (tmpNode->getRelCoor().z < 0)
    315315    return 0;
    316316  else
     
    333333  PNode* tmpNode = (PNode*)node;
    334334
    335   Vector nodeRelCoord = *tmpNode->getRelCoor();
     335  Vector nodeRelCoord = tmpNode->getRelCoor();
    336336  float minDist = 100000000;
    337337  int childNumber = 0;
     
    396396  this->textAnimation->setInfinity(ANIM_INF_CONSTANT);
    397397}
     398
     399
     400/**
     401   \brief loads a trackElement from a TiXmlElement
     402   \param root the TiXmlElement to load the Data from
     403
     404*/
     405bool TrackManager::load( TiXmlElement* root)
     406{
     407
     408}
     409
     410
    398411
    399412/**
  • orxonox/branches/physics/src/track_manager.h

    r3847 r4178  
    153153  static TrackManager* getInstance(void);
    154154
     155  bool load(TiXmlElement* root);
     156
    155157  // Methods to change the Path (initialisation)
    156158  void workOn(unsigned int trackID);
  • orxonox/branches/physics/src/track_node.cc

    r3607 r4178  
    4141
    4242
    43 TrackNode::TrackNode (Vector* absCoordinate)
     43TrackNode::TrackNode (const Vector& absCoordinate)
    4444{
    4545  this->parent = NullParent::getInstance();
    4646  this->trackManager = TrackManager::getInstance();
    4747  this->setMode(PNODE_ALL);
    48   this->absCoordinate = absCoordinate;
     48  this->setAbsCoor(absCoordinate);
    4949}
    5050
  • orxonox/branches/physics/src/track_node.h

    r3836 r4178  
    2222 public:
    2323  TrackNode ();
    24   TrackNode (Vector* absCoordinate);
     24  TrackNode (const Vector& absCoordinate);
    2525
    2626  virtual ~TrackNode ();
  • orxonox/branches/physics/src/util/animation/animation.cc

    r3953 r4178  
    3434
    3535  // setting default values
     36  this->keyFramesToPlay = -1;
    3637  this->localTime = 0.0;
    37   this->bRunning = true;
     38  this->bRunning = false;
    3839
    3940  AnimationPlayer::getInstance()->addAnimation(this);
     
    8384      break;
    8485    case ANIM_INF_REPLAY:
    85       this->replay();
     86      this->rewind();
     87      this->bRunning = true;
    8688      break;
    8789    case ANIM_INF_REWIND:
     
    99101void Animation::play()
    100102{
     103  this->keyFramesToPlay = -1;
     104  this->bRunning = true;
     105}
     106
     107/**
     108   \brief plays the Next n keyframes
     109   \param n the Count of keyFrames to play.
     110*/
     111void Animation::playNextKeyframes(int n)
     112{
     113  this->keyFramesToPlay = n-1;
    101114  this->bRunning = true;
    102115}
     
    107120void Animation::stop()
    108121{
     122  this->keyFramesToPlay = -1;
    109123  this->rewind();
    110124  this->bRunning = true;
     
    127141{
    128142  this->rewind();
    129   this->bRunning = true;
     143  this->play();
    130144}
  • orxonox/branches/physics/src/util/animation/animation.h

    r3953 r4178  
    2525   ANIM_NEG_EXP: fast, slow
    2626   ANIM_RANDOM: eratic
    27    
     27
     28   ANIM_NULL: !!DO NOT USE THIS!! only for internal handling
     29
    2830   deprecated QUADRATIC
    2931*/
     
    3537                            ANIM_NEG_EXP,
    3638                            ANIM_QUADRATIC,
    37                             ANIM_RANDOM};
     39                            ANIM_RANDOM,
     40                            ANIM_NULL};
     41#define ANIM_DEFAULT_FUNCTION ANIM_LINEAR      //!< A default function to choose from the above set
    3842
    3943//! An enumerator describing what the animation should do after the last keyframe.
     
    6973
    7074  void play(); // equals resume();
     75  void playNextKeyframes(int n = 1);
    7176  void stop();
    7277  void pause();
     
    95100  BaseObject* baseObject;         //!< The same as object in the derived classes, but with reference to BaseObject
    96101  unsigned int keyFrameCount;     //!< The Count of KeyFrames.
     102  int keyFramesToPlay;            //!< How many more Keyframes to play. if negative it will be ignored if 0 stop.
    97103  bool bHandled;                  //!< If this Animation is handled by the AnimationPlayer.
    98104  bool bRunning;                  //!< If the animation is running
  • orxonox/branches/physics/src/util/animation/animation3d.cc

    r3953 r4178  
    1515   2005-04-17: Benjamin Grauer
    1616          Rewritte all functions, so it will fit into the Animation-class
     17   2005-04-25: Patrick Boenzli
     18          Extended the framework to support quatSlerp rotations. Each frame now supports diff mov/rot types. Implemented mov/rot functions
    1719*/
    1820
     
    4244  this->nextKeyFrame = tmpKeyFrame;
    4345
    44   this->animFunc = &Animation3D::linear;
     46  this->animFuncMov = &Animation3D::mLinear;
     47  this->animFuncRot = &Animation3D::rLinear;
     48
    4549}
    4650
     
    7276  this->nextKeyFrame = keyFrameList->nextElement(keyFrameList->firstElement());
    7377  this->localTime = 0.0;
    74   this->setAnimFunc(this->currentKeyFrame->animFunc);
     78  this->setAnimFuncMov(this->currentKeyFrame->animFuncMov);
     79  this->setAnimFuncRot(this->currentKeyFrame->animFuncRot);
    7580}
    7681
     
    8085   \param direction The direction of the new Keyframe.
    8186   \param duration The duration from the new KeyFrame to the next one
    82    \param animFunc The function to animate between this keyFrame and the next one
    83 */
    84 void Animation3D::addKeyFrame(Vector position, Quaternion direction, float duration, ANIM_FUNCTION animFunc)
     87   \param animFuncMov The function to animate position between this keyFrame and the next one
     88   \param animFuncMov The function to animate rotation between this keyFrame and the next one
     89*/
     90void Animation3D::addKeyFrame(Vector position, Quaternion direction, float duration, ANIM_FUNCTION animFuncMov, ANIM_FUNCTION animFuncRot)
    8591{
    8692  // some small check
    8793  if (duration <= 0.0)
    8894    duration = 1.0;
     95  // if the Rotation-Animation-function is set ANIM_NULL, animFuncRot will match animFuncRot
     96  if (animFuncMov == ANIM_NULL)
     97    animFuncMov = ANIM_DEFAULT_FUNCTION;
     98  if (animFuncRot == ANIM_NULL)
     99    animFuncRot = animFuncMov;
    89100
    90101  KeyFrame3D* tmpKeyFrame;
     
    94105    {
    95106      tmpKeyFrame = this->keyFrameList->firstElement();
    96       this->setAnimFunc(animFunc);
     107      //this->setAnimFuncMov(animFuncMov);
     108      //this->setAnimFuncRot(animFuncRot);
    97109    }
    98110  else
     
    106118
    107119  tmpKeyFrame->position = position;
     120  //tmpKeyFrame->lastPosition = position;
    108121  tmpKeyFrame->direction = direction;
    109122  tmpKeyFrame->duration = duration;
    110   tmpKeyFrame->animFunc = animFunc;
     123  tmpKeyFrame->animFuncMov = animFuncMov;
     124  tmpKeyFrame->animFuncRot = animFuncRot;
    111125  this->keyFrameCount++;
    112126}
     127
     128
    113129
    114130/**
     
    123139      if (localTime >= this->currentKeyFrame->duration)
    124140        {
    125           // switching to the next Key-Frame
    126           this->localTime -= this->currentKeyFrame->duration;
    127           this->currentKeyFrame = this->nextKeyFrame;
    128           // checking, if we should still Play the animation
    129           if (this->currentKeyFrame == this->keyFrameList->lastElement())
    130             this->handleInfinity();
    131           this->nextKeyFrame = this->keyFrameList->nextElement(this->currentKeyFrame);
    132           this->setAnimFunc(this->currentKeyFrame->animFunc);     
    133          
    134           if( this->currentKeyFrame->animFunc == ANIM_NEG_EXP)
     141          if (likely(this->keyFramesToPlay != 0))
    135142            {
    136               this->tmpVect = this->nextKeyFrame->position - this->currentKeyFrame->position;
    137               this->deltaT = 1/this->currentKeyFrame->duration * logf(1.0 + 600.0/this->tmpVect.len());
     143              if (unlikely(this->keyFramesToPlay > 0))
     144                --this->keyFramesToPlay;
     145              // switching to the next Key-Frame
     146              this->localTime -= this->currentKeyFrame->duration;
     147              this->currentKeyFrame = this->nextKeyFrame;
     148              // checking, if we should still Play the animation
     149              if (this->currentKeyFrame == this->keyFrameList->lastElement())
     150                this->handleInfinity();
     151              this->nextKeyFrame = this->keyFrameList->nextElement(this->currentKeyFrame);
     152              this->setAnimFuncMov(this->currentKeyFrame->animFuncMov);
     153              this->setAnimFuncRot(this->currentKeyFrame->animFuncRot);
    138154            }
    139         }
    140 
     155          else
     156            this->pause();
     157        }     
    141158      /* now animate it */
    142       (this->*animFunc)(this->localTime);
    143       /*
    144       switch( this->movMode)
    145         {
    146         case LINEAR:
    147           *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position;
    148           *this->tmpVect = *this->tmpVect * this->localTime / this->currentFrame->time;
    149           this->currentFrame->object->setRelCoor(*this->lastFrame->position + *this->tmpVect);
    150           *this->lastPosition = *this->tmpVect;
    151           break;
    152         case EXP:
    153              
    154           break;
    155         case NEG_EXP:
    156           *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position;
    157           *this->tmpVect = *this->tmpVect * (1 - expf(- this->localTime * this->deltaT));     
    158           this->currentFrame->object->setRelCoor(*this->lastFrame->position + *this->tmpVect);
    159           *this->lastPosition = *this->tmpVect;
    160           break;
    161         case SIN:
    162           *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position;
    163           *this->tmpVect = *this->tmpVect * 0.5*(1 - cos(M_PI * this->localTime / this->currentFrame->time));     
    164           this->currentFrame->object->setRelCoor(*this->lastFrame->position + *this->tmpVect);
    165           *this->lastPosition = *this->tmpVect;
    166           break;
    167         case COS:
    168              
    169           break;
    170         case QUADRATIC:
    171           *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position;
    172           *this->tmpVect = *this->tmpVect * 1/3 * ldexpf(this->localTime, 3);
    173           break;
    174         default:
    175           break;
    176         }
    177       */
    178     }
    179 }
    180 
    181 
    182 /**
    183    \brief Sets The kind of Animation between this keyframe and the next one
     159      (this->*animFuncMov)(this->localTime);
     160      (this->*animFuncRot)(this->localTime);
     161    }
     162}
     163
     164
     165/*==Movement Section==========================================================*/
     166
     167/**
     168   \brief Sets The kind of movment Animation between this keyframe and the next one
    184169   \param animFunc The Type of Animation to set
    185170*/
    186 void Animation3D::setAnimFunc(ANIM_FUNCTION animFunc)
    187 {
    188   switch (animFunc)
     171void Animation3D::setAnimFuncMov(ANIM_FUNCTION animFuncMov)
     172{
     173  switch (animFuncMov)
    189174    {
     175    case ANIM_CONSTANT:
     176      this->animFuncMov = &Animation3D::mConstant;
     177      break;
     178    case ANIM_LINEAR:
     179      this->animFuncMov = &Animation3D::mLinear;
     180      this->object->setRelCoor(this->currentKeyFrame->position);
     181      this->currentKeyFrame->lastPosition = Vector();
     182      break;
     183    case ANIM_SINE:
     184      this->animFuncMov = &Animation3D::mSine;
     185      this->object->setRelCoor(this->currentKeyFrame->position);
     186      this->currentKeyFrame->lastPosition = Vector();
     187      break;
     188    case ANIM_COSINE:
     189      this->animFuncMov = &Animation3D::mCosine;
     190      this->object->setRelCoor(this->currentKeyFrame->position);
     191      this->currentKeyFrame->lastPosition = Vector();
     192      break;
     193    case ANIM_EXP:
     194      this->object->setRelCoor(this->currentKeyFrame->position);
     195      this->animFuncMov = &Animation3D::mExp;
     196      break;
     197    case ANIM_NEG_EXP:
     198      this->animFuncMov = &Animation3D::mNegExp;
     199      this->object->setRelCoor(this->currentKeyFrame->position);
     200      this->expFactorMov = -1.0 / this->currentKeyFrame->duration * logf(DELTA_X_3D);
     201      this->currentKeyFrame->lastPosition = Vector();
     202      break;
     203    case ANIM_QUADRATIC:
     204      this->object->setRelCoor(this->currentKeyFrame->position);
     205      this->animFuncMov = &Animation3D::mQuadratic;
     206      break;
     207    case ANIM_RANDOM:
     208      this->object->setRelCoor(this->currentKeyFrame->position);
     209      this->animFuncMov = &Animation3D::mRandom;
     210      break;
    190211    default:
    191     case ANIM_CONSTANT:
    192       this->animFunc = &Animation3D::constant;
    193       break;
    194     case ANIM_LINEAR:
    195       this->animFunc = &Animation3D::linear;
    196       break;
    197     case ANIM_SINE:
    198       this->animFunc = &Animation3D::sine;
    199       break;
    200     case ANIM_COSINE:
    201       this->animFunc = &Animation3D::cosine;
    202       break;
    203     case ANIM_EXP:
    204       this->animFunc = &Animation3D::exp;
    205       break;
    206     case ANIM_NEG_EXP:
    207       this->animFunc = &Animation3D::negExp;
    208       break;
    209     case ANIM_QUADRATIC:
    210       this->animFunc = &Animation3D::quadratic;
    211       break;
    212     case ANIM_RANDOM:
    213       this->animFunc = &Animation3D::random;
    214       break;
    215     }
    216 }
     212      break;
     213    }
     214}
     215
     216
    217217
    218218/**
     
    220220   \param timePassed The time passed since this Keyframe began
    221221*/
    222 void Animation3D::constant(float timePassed) const
    223 {
    224   this->object->setRelCoor(this->currentKeyFrame->position);
     222void Animation3D::mConstant(float timePassed) const
     223{
     224  //this->object->setRelCoor(this->currentKeyFrame->position);
    225225
    226226  /*
     
    238238   \todo implement also do this for direction
    239239*/
    240 void Animation3D::linear(float timePassed) const
    241 {
    242   this->object->setRelCoor(this->currentKeyFrame->position +
    243                           (this->nextKeyFrame->position - this->currentKeyFrame->position) *
    244                           (timePassed/this->currentKeyFrame->duration));
     240void Animation3D::mLinear(float timePassed) const
     241{
     242  Vector v = (this->nextKeyFrame->position - this->currentKeyFrame->position) * (timePassed/this->currentKeyFrame->duration);
     243  this->object->shiftCoor(v - this->currentKeyFrame->lastPosition);
     244  this->currentKeyFrame->lastPosition = v;
    245245}
    246246
     
    251251   \todo implement
    252252*/
    253 void Animation3D::sine(float timePassed) const
    254 {
    255   this->linear(timePassed);
    256 }
     253void Animation3D::mSine(float timePassed) const
     254{
     255  Vector v;
     256  if( timePassed  < this->currentKeyFrame->duration/2.0)
     257    v = (this->nextKeyFrame->position - this->currentKeyFrame->position) * sin( M_PI * timePassed /this->currentKeyFrame->duration) / 2.0;
     258  else
     259    v = (this->nextKeyFrame->position - this->currentKeyFrame->position) * (2.0 + sin( M_PI * (- timePassed /this->currentKeyFrame->duration)) )/ 2.0;
     260 
     261  this->object->shiftCoor(v - this->currentKeyFrame->lastPosition);
     262  this->currentKeyFrame->lastPosition = v;
     263}
     264
    257265
    258266/**
     
    262270   \todo implement
    263271*/
    264 void Animation3D::cosine(float timePassed) const
    265 {
    266   this->linear(timePassed);
    267 }
     272void Animation3D::mCosine(float timePassed) const
     273{
     274  Vector v;
     275  v = (this->nextKeyFrame->position - this->currentKeyFrame->position) * (1.0 + cos( M_PI * timePassed / this->currentKeyFrame->duration))/2.0;
     276  this->object->shiftCoor(v - this->currentKeyFrame->lastPosition);
     277  this->currentKeyFrame->lastPosition = v;
     278
     279
     280  /*
     281  this->object->setRelCoor( this->nextKeyFrame->position -
     282                            (this->nextKeyFrame->position - this->currentKeyFrame->position) *
     283                            (1.0 + cos( M_PI * timePassed / this->currentKeyFrame->duration))/2.0);
     284  */
     285}
     286
     287
    268288
    269289/**
     
    271291   \param timePassed The time passed since this Keyframe began
    272292*/
    273 void Animation3D::exp(float timePassed) const
    274 {
    275   this->linear(timePassed);
     293void Animation3D::mExp(float timePassed) const
     294{
     295  PRINTF(0)("no exp animation3d defined\n");
     296  this->mLinear(timePassed);
    276297}
    277298
     
    279300   \brief a negative exponential interpolation between this keyframe and the next one
    280301   \param timePassed The time passed since this Keyframe began
    281 
    282    \todo implement
    283 */
    284 void Animation3D::negExp(float timePassed) const
    285 {
    286   this->linear(timePassed);
    287 }
     302*/
     303void Animation3D::mNegExp(float timePassed) const
     304{
     305  Vector v;
     306  v = (this->nextKeyFrame->position - this->currentKeyFrame->position) * (1.0 - expf(- timePassed * expFactorMov));
     307  this->object->shiftCoor(v - this->currentKeyFrame->lastPosition);
     308  this->currentKeyFrame->lastPosition = v;
     309
     310  /*
     311  this->object->setRelCoor( this->currentKeyFrame->position +
     312                            (this->nextKeyFrame->position - this->currentKeyFrame->position) *
     313                            (1.0 - expf(- timePassed * expFactorMov)) );
     314  */
     315}
     316
    288317
    289318/**
     
    293322   \todo implement
    294323*/
    295 void Animation3D::quadratic(float timePassed) const
    296 {
    297   this->linear(timePassed);
     324void Animation3D::mQuadratic(float timePassed) const
     325{
     326  PRINTF(0)("no quadratic animation3d defined\n");
     327  this->mLinear(timePassed);
    298328}
    299329
     
    302332   \param timePassed The time passed since this Keyframe began
    303333*/
    304 void Animation3D::random(float timePassed) const
    305 {
     334void Animation3D::mRandom(float timePassed) const
     335{
     336  /*
    306337  this->object->setRelCoor(this->currentKeyFrame->position +
    307338                           (this->nextKeyFrame->position - this->currentKeyFrame->position) * (float)rand()/(float)RAND_MAX);
    308339  this->object->setRelDir(this->currentKeyFrame->direction +
    309340                          (this->nextKeyFrame->direction - this->currentKeyFrame->direction)* (float)rand()/(float)RAND_MAX);
    310 }
     341  */
     342}
     343
     344
     345/*==Rotation Section==========================================================*/
     346
     347
     348/**
     349   \brief Sets The kind of rotation Animation between this keyframe and the next one
     350   \param animFunc The Type of Animation to set
     351*/
     352void Animation3D::setAnimFuncRot(ANIM_FUNCTION animFuncRot)
     353{
     354  switch (animFuncRot)
     355    {
     356    default:
     357    case ANIM_CONSTANT:
     358      this->animFuncRot = &Animation3D::rConstant;
     359      break;
     360    case ANIM_LINEAR:
     361      this->animFuncRot = &Animation3D::rLinear;
     362      break;
     363    case ANIM_SINE:
     364      this->animFuncRot = &Animation3D::rSine;
     365      break;
     366    case ANIM_COSINE:
     367      this->animFuncRot = &Animation3D::rCosine;
     368      break;
     369    case ANIM_EXP:
     370      this->animFuncRot = &Animation3D::rExp;
     371      break;
     372    case ANIM_NEG_EXP:
     373      this->animFuncRot = &Animation3D::rNegExp;
     374      this->expFactorRot = -1.0 / this->currentKeyFrame->duration * logf(DELTA_X_3D);
     375      break;
     376    case ANIM_QUADRATIC:
     377      this->animFuncRot = &Animation3D::rQuadratic;
     378      break;
     379    case ANIM_RANDOM:
     380      this->animFuncRot = &Animation3D::rRandom;
     381      break;
     382
     383    }
     384}
     385
     386
     387/**
     388   \brief stays at the value of the currentKeyFrame
     389   \param timePassed The time passed since this Keyframe began
     390*/
     391void Animation3D::rConstant(float timePassed) const
     392{
     393  this->object->setRelDir(this->currentKeyFrame->direction);
     394}
     395
     396/**
     397   \brief linear interpolation between this keyframe and the next one
     398   \param timePassed The time passed since this Keyframe began
     399
     400   \todo implement also do this for direction
     401*/
     402void Animation3D::rLinear(float timePassed) const
     403{
     404  this->object->setRelDir(quatSlerp( this->nextKeyFrame->direction,
     405                                     this->currentKeyFrame->direction,
     406                                     timePassed/this->currentKeyFrame->duration) );
     407}
     408
     409/**
     410   \brief a Sinusodial Interpolation between this keyframe and the next one
     411   \param timePassed The time passed since this Keyframe began
     412
     413   \todo implement
     414*/
     415void Animation3D::rSine(float timePassed) const
     416{
     417  float scale;
     418  if( timePassed < this->currentKeyFrame->duration / 2.0)
     419    scale = sin( M_PI * timePassed / this->currentKeyFrame->duration);
     420  else
     421    scale = 1.0 - sin( M_PI * timePassed / this->currentKeyFrame->duration);
     422
     423  this->object->setRelDir(quatSlerp( this->nextKeyFrame->direction,
     424                                     this->currentKeyFrame->direction,
     425                                     scale) );
     426}
     427
     428
     429/**
     430   \brief a cosine interpolation between this keyframe and the next one
     431   \param timePassed The time passed since this Keyframe began
     432
     433   \todo implement
     434*/
     435void Animation3D::rCosine(float timePassed) const
     436{
     437  float scale = cos(M_PI * timePassed / this->currentKeyFrame->duration);
     438  this->object->setRelDir(quatSlerp( this->nextKeyFrame->direction,
     439                                     this->currentKeyFrame->direction,
     440                                     scale) );
     441}
     442
     443
     444
     445/**
     446   \brief an exponential interpolation between this keyframe and the next one
     447   \param timePassed The time passed since this Keyframe began
     448*/
     449void Animation3D::rExp(float timePassed) const
     450{
     451  PRINTF(0)("exp rotation function not implemented\n");
     452}
     453
     454/**
     455   \brief a negative exponential interpolation between this keyframe and the next one
     456   \param timePassed The time passed since this Keyframe began
     457*/
     458void Animation3D::rNegExp(float timePassed) const
     459{
     460  float scale = (1.0 - expf(- timePassed * expFactorRot));
     461  this->object->setRelDir(quatSlerp( this->nextKeyFrame->direction,
     462                                     this->currentKeyFrame->direction,
     463                                     scale) );
     464}
     465
     466
     467/**
     468   \brief a quadratic interpolation between this keyframe and the next one
     469   \param timePassed The time passed since this Keyframe began
     470
     471   \todo implement
     472*/
     473void Animation3D::rQuadratic(float timePassed) const
     474{
     475  PRINTF(0)("quadratic rotation alg not implemented\n");
     476}
     477
     478/**
     479   \brief some random animation (fluctuating)
     480   \param timePassed The time passed since this Keyframe began
     481*/
     482void Animation3D::rRandom(float timePassed) const
     483{
     484  PRINTF(0)("random rotation alg not implemented\n");
     485}
  • orxonox/branches/physics/src/util/animation/animation3d.h

    r3953 r4178  
    99class PNode;
    1010
     11#define DELTA_X_3D 0.05  //!< the percentag of the distance that doesnt have to be done by neg_exp (asymptotical) ~ maschinendelta
     12
    1113//! KeyFrame3D Struct
    1214/**
     
    1618  float duration;                   //!< The duration of this KeyFrame
    1719  Vector position;                  //!< The position of this KeyFrame
     20  Vector lastPosition;
    1821  Quaternion direction;             //!< The direction of this KeyFrame
    19   ANIM_FUNCTION animFunc;           //!< with whitch function to iterate to the next KeyFrame3D
     22  ANIM_FUNCTION animFuncMov;        //!< with whitch function to iterate movement to the next KeyFrame3D
     23  ANIM_FUNCTION animFuncRot;        //!< with whitch function to iterate rotation to the next KeyFrame3D
    2024};
    2125
     
    3236  virtual void rewind(void);
    3337
    34   void addKeyFrame(Vector position, Quaternion direction, float time, ANIM_FUNCTION animFunc = ANIM_LINEAR);
     38  void addKeyFrame(Vector position, Quaternion direction, float time, ANIM_FUNCTION animFuncMov = ANIM_DEFAULT_FUNCTION, ANIM_FUNCTION animFuncRot = ANIM_NULL);
    3539  //  void addKeyFrame(KeyFrame3D* frame);
    3640
    3741  virtual void tick(float dt);
    38 
     42 
    3943 private:
    4044  // animation functions
    41   void setAnimFunc(ANIM_FUNCTION animFunc);
    42   void constant(float timePassed) const;
    43   void linear(float timePassed) const;
    44   void sine(float timePassed) const;
    45   void cosine(float timePassed) const;
    46   void exp(float timePassed) const;
    47   void negExp(float timePassed) const;
    48   void quadratic(float timePassed) const;
    49   void random(float timePassed) const;
     45  void setAnimFuncMov(ANIM_FUNCTION animFunc);
     46  void setAnimFuncRot(ANIM_FUNCTION animFunc);
     47  void mConstant(float timePassed) const;
     48  void mLinear(float timePassed) const;
     49  void mSine(float timePassed) const;
     50  void mCosine(float timePassed) const;
     51  void mExp(float timePassed) const;
     52  void mNegExp(float timePassed) const;
     53  void mQuadratic(float timePassed) const;
     54  void mRandom(float timePassed) const;
     55  void rConstant(float timePassed) const;
     56  void rLinear(float timePassed) const;
     57  void rSine(float timePassed) const;
     58  void rCosine(float timePassed) const;
     59  void rExp(float timePassed) const;
     60  void rNegExp(float timePassed) const;
     61  void rQuadratic(float timePassed) const;
     62  void rRandom(float timePassed) const;
    5063  //  ANIM_FUNCTION animFunc;
    51   void (Animation3D::*animFunc)(float) const;      //!< A Function for the AnimationType
     64  void (Animation3D::*animFuncMov)(float) const;      //!< A Function for the AnimationType
     65  void (Animation3D::*animFuncRot)(float) const;      //!< A Function for the AnimationType
    5266
    5367  KeyFrame3D* currentKeyFrame;                     //!< The current KeyFrame
     
    6074  Vector tmpVect;        //!< what for??
    6175  float deltaT;          //!< ??
     76  float expFactorMov;
     77  float expFactorRot;
    6278};
  • orxonox/branches/physics/src/util/animation/t_animation.h

    r3953 r4178  
    4343  void setFuncToAnim(T* object, void (T::*funcToAnim)(float));
    4444
    45   void addKeyFrame(float value, float duration, ANIM_FUNCTION animFunc = ANIM_LINEAR);
     45  void addKeyFrame(float value, float duration, ANIM_FUNCTION animFunc = ANIM_DEFAULT_FUNCTION);
    4646
    4747  virtual void rewind();
     
    154154  if (duration <= 0.0)
    155155    duration = 1.0;
     156  if (animFunc == ANIM_NULL)
     157    animFunc = ANIM_DEFAULT_FUNCTION;
    156158
    157159  KeyFrameF* tmpKeyFrame;
     
    190192      if (localTime >= this->currentKeyFrame->duration)
    191193        {
    192           // switching to the next Key-Frame
    193           this->localTime -= this->currentKeyFrame->duration;
    194 
    195           this->currentKeyFrame = this->nextKeyFrame;
    196           // checking, if we should still Play the animation
    197           if (this->currentKeyFrame == this->keyFrameList->lastElement())
    198             this->handleInfinity();
    199           this->nextKeyFrame = this->keyFrameList->nextElement(this->currentKeyFrame);
    200 
    201           printf("%p from:%f to:%f\n", this->currentKeyFrame,this->currentKeyFrame->value, this->nextKeyFrame->value);
    202           this->setAnimFunc(this->currentKeyFrame->animFunc);     
     194          if (likely(this->keyFramesToPlay != 0))
     195            {
     196              if (unlikely(this->keyFramesToPlay > 0))
     197                --this->keyFramesToPlay;
     198              // switching to the next Key-Frame
     199              this->localTime -= this->currentKeyFrame->duration;
     200             
     201              this->currentKeyFrame = this->nextKeyFrame;
     202              // checking, if we should still Play the animation
     203              if (this->currentKeyFrame == this->keyFrameList->lastElement())
     204                this->handleInfinity();
     205              this->nextKeyFrame = this->keyFrameList->nextElement(this->currentKeyFrame);
     206             
     207              printf("%p from:%f to:%f\n", this->currentKeyFrame,this->currentKeyFrame->value, this->nextKeyFrame->value);
     208              this->setAnimFunc(this->currentKeyFrame->animFunc);         
     209            }
     210          else
     211            this->pause();
    203212        }
    204213     
     
    235244      {
    236245        this->animFunc = &tAnimation<T>::negExp;
    237         float d = fabs(this->currentKeyFrame->value - this->nextKeyFrame->value);
    238246        expFactor =  - 1.0 / this->currentKeyFrame->duration * logf(DELTA_X);
    239247        break;
  • orxonox/branches/physics/src/util/resource_manager.cc

    r3953 r4178  
    9292      this->dataDir = new char[strlen(dataDir)+1];
    9393      strcpy(this->dataDir, dataDir);
     94      return true;
    9495    }
    9596  else
    9697    {
    9798      PRINTF(1)("%s is not a Directory, and can not be the Data Directory, leaving as %s \n", dataDir, this->dataDir);
    98     }
     99      return false;
     100    }
     101}
     102
     103/**
     104   \brief checks for the DataDirectory, by looking if
     105   \param fileInside is inisde??
     106*/
     107bool ResourceManager::checkDataDir(const char* fileInside)
     108{
     109  bool retVal;
     110  if (!isDir(this->dataDir))
     111    {
     112      PRINTF(1)("%s is not a directory\n", this->dataDir);
     113      return false;
     114    }
     115 
     116  char* testFile = new char[strlen(this->dataDir)+strlen(fileInside)+1];
     117  sprintf(testFile, "%s%s", this->dataDir, fileInside);
     118  retVal = isFile(testFile);
     119  delete testFile;
     120  return retVal;
    99121}
    100122
     
    180202  // searching if the resource was loaded before.
    181203  Resource* tmpResource = this->locateResourceByInfo(fileName, type, param1, param2,param3);
    182   if (tmpResource) // if the resource was not loaded before.
     204  if (tmpResource) // if the resource was loaded before.
    183205    {
    184206      PRINTF(4)("not loading cached resource %s\n", tmpResource->name);
     
    199221
    200222      // creating the full name. (directoryName + FileName)
    201       char* fullName = new char[strlen(dataDir)+strlen(fileName)+1];
    202       sprintf(fullName, "%s%s", this->dataDir, fileName);
    203      
     223      char* fullName = new char[strlen(this->getDataDir())+strlen(fileName)+1];
     224      sprintf(fullName, "%s%s", this->getDataDir(), fileName);
    204225      // Checking for the type of resource \see ResourceType
    205226      switch(type)
     
    211232            tmpResource->modelSize = 1.0;
    212233
    213           if(isFile(fullName))
     234          if(ResourceManager::isFile(fullName))
    214235            tmpResource->pointer = new OBJModel(fullName, tmpResource->modelSize);
    215236          else
     
    508529    }
    509530
    510   stat(tmpDirName, &status);
    511   if (status.st_mode & (S_IFDIR
     531  if(!stat(tmpDirName, &status))
     532    {
     533      if (status.st_mode & (S_IFDIR
    512534#ifndef __WIN32__
    513                         | S_IFLNK
     535                            | S_IFLNK
    514536#endif
    515                         ))
    516     {
    517       delete tmpDirName;
    518       return true;
    519     }
    520   else
    521     {
    522       delete tmpDirName;
    523       return false;
    524     }
     537                            ))
     538        {
     539          delete tmpDirName;
     540          return true;
     541        }
     542      else
     543        {
     544          delete tmpDirName;
     545          return false;
     546        }
     547    }
     548  else
     549    return false;
    525550}
    526551
     
    532557bool ResourceManager::isFile(const char* fileName)
    533558{
     559  char* tmpFileName = ResourceManager::homeDirCheck(fileName);
     560  // actually checks the File
    534561  struct stat status;
    535   stat(fileName, &status);
    536   if (status.st_mode & (S_IFREG
     562  if (!stat(tmpFileName, &status))
     563    {
     564      if (status.st_mode & (S_IFREG
    537565#ifndef __WIN32__
    538                         | S_IFLNK
     566                            | S_IFLNK
    539567#endif
    540                         ))
    541     return true;
    542   else
    543     return false;
    544 }
     568                            ))
     569        {
     570          delete tmpFileName;
     571          return true;
     572        }
     573      else
     574        {
     575          delete tmpFileName;
     576          return false;
     577        }
     578    }
     579  else
     580    {
     581      delete tmpFileName;
     582      return false;
     583    }
     584}
     585
     586/**
     587   \brief touches a File on the disk (thereby creating it)
     588   \param fileName The file to touch
     589*/
     590bool ResourceManager::touchFile(const char* fileName)
     591{
     592  char* tmpName = ResourceManager::homeDirCheck(fileName);
     593
     594  FILE* stream;
     595  if( (stream = fopen (tmpName, "w")) == NULL)
     596    {
     597      PRINTF(1)("could not open %s fro writing\n", fileName);
     598      return false;
     599    }
     600  fclose(stream);
     601   
     602  delete tmpName;
     603}
     604
     605/**
     606   \brief deletes a File from disk
     607   \param fileName the File to delete
     608*/
     609bool ResourceManager::deleteFile(const char* fileName)
     610{
     611  char* tmpName = ResourceManager::homeDirCheck(fileName);
     612  unlink(tmpName);
     613  delete tmpName;
     614}
     615
     616/**
     617    \param fileName the Name of the file to check
     618    \returns The name of the file, including the HomeDir
     619    IMPORTANT: this has to be deleted from the outside
     620*/
     621char* ResourceManager::homeDirCheck(const char* name)
     622{
     623  char* retName;
     624  if (!strncmp(name, "~/", 2))
     625    {
     626      char tmpFileName[500];
     627#ifdef __WIN32__
     628      strcpy(tmpFileName, getenv("USERPROFILE"));
     629#else
     630      strcpy(tmpFileName, getenv("HOME"));
     631#endif
     632      retName = new char[strlen(tmpFileName)+strlen(name)];
     633      sprintf(retName, "%s%s", tmpFileName, name+1);
     634    }
     635  else
     636    {
     637      retName = new char[strlen(name)+1];
     638      strcpy(retName, name);
     639    }
     640  return retName;
     641}
     642
     643/**
     644    \param fileName the Name of the File to check
     645    \returns The full name of the file, including the DataDir, and NULL if the file does not exist
     646    IMPORTANT: this has to be deleted from the outside
     647*/
     648char* ResourceManager::getFullName(const char* fileName)
     649{
     650  char* retName = new char[strlen(ResourceManager::getInstance()->getDataDir()) + strlen(fileName)+1];
     651  sprintf(retName, "%s%s", ResourceManager::getInstance()->getDataDir(), fileName);
     652  if (ResourceManager::isFile(retName))
     653    return retName;
     654  else
     655    {
     656      delete retName;
     657      return NULL;
     658    }
     659}
     660
    545661
    546662/**
  • orxonox/branches/physics/src/util/resource_manager.h

    r3953 r4178  
    1818
    1919//! An eumerator for different fileTypes the resourceManager supports \todo WAV, MP3, OGG support
    20 enum ResourceType {OBJ, PRIM, WAV, MP3, OGG, TTF, IMAGE};
     20enum ResourceType {OBJ,
     21                   PRIM,
     22                   WAV,
     23                   MP3,
     24                   OGG,
     25                   TTF,
     26                   IMAGE};
    2127//! An enumerator for different UNLOAD-types.
    2228/**
     
    2632   RP_GAME: will be unloaded at the end of the whole Game (when closing orxonox)
    2733*/
    28 enum ResourcePriority {RP_NO = 0, RP_LEVEL = 1, RP_CAMPAIGN = 2, RP_GAME = 3};
     34enum ResourcePriority {RP_NO = 0,
     35                       RP_LEVEL = 1,
     36                       RP_CAMPAIGN = 2,
     37                       RP_GAME = 3};
    2938
    3039//! A Struct that keeps track about A resource its name its Type, and so on
     
    6574
    6675  bool setDataDir(const char* dataDir);
     76  /** \returns the Name of the data directory */
     77  inline const char* getDataDir(void) const {return this->dataDir;}
     78
     79  bool checkDataDir(const char* fileInside);
    6780  bool addImageDir(char* imageDir);
    6881  void* load(const char* fileName, ResourcePriority prio = RP_NO,
     
    7386  bool unload(Resource* resource, ResourcePriority = RP_NO);
    7487  bool unloadAllByPriority(ResourcePriority prio);
     88
    7589  void debug(void);
     90
     91  // utility functions of this class
     92  static bool isDir(const char* directory);
     93  static bool isFile(const char* fileName);
     94  static bool touchFile(const char* fileName);
     95  static bool deleteFile(const char* fileName);
     96  static char* homeDirCheck(const char* fileName);
     97  static char* getFullName(const char* fileName);
    7698
    7799 private:
     
    87109  Resource* locateResourceByPointer(const void* pointer);
    88110 
    89   bool isDir(const char* directory);
    90   bool isFile(const char* directory);
    91 
    92111};
    93112
  • orxonox/branches/physics/src/world_entities/camera.cc

    r3953 r4178  
    139139  if (tmpFovy > .001)
    140140    this->fovy += (this->toFovy - this->fovy) * dt;
    141   Vector tmpPos = (this->toRelCoor - *this->getRelCoor()) * dt;
     141  Vector tmpPos = (this->toRelCoor - this->getRelCoor()) * dt;
    142142  if (tmpPos.len() >= .001)
    143143    {
    144       tmpPos = tmpPos + *this->getRelCoor();
     144      tmpPos = tmpPos + this->getRelCoor();
    145145      this->setRelCoor(tmpPos);
    146146    }
  • orxonox/branches/physics/src/world_entities/environment.cc

    r3739 r4178  
    3030{
    3131  this->model = (Model*) ResourceManager::getInstance()->load("cube", RP_LEVEL);
    32   //  this->model = new OBJModel("../data/models/fighter.obj");
    3332}
    3433
     
    5049void Environment::draw ()
    5150{
     51  //this->getRelCoor().debug();
     52
    5253  glMatrixMode(GL_MODELVIEW);
    5354  glPushMatrix();
  • orxonox/branches/physics/src/world_entities/player.cc

    r3953 r4178  
    1 
    2 
    31/*
    42   orxonox - the future of 3D-vertical-scrollers
     
    3129
    3230using namespace std;
     31
     32CREATE_FACTORY(Player);
    3333
    3434/**
     
    5252  //weapons:
    5353  this->weaponMan = new WeaponManager();
    54   Weapon* wpRight = new TestGun(this,Vector(-2.6, 0.1, 3.0), Quaternion(), 0);
     54  Weapon* wpRight = new TestGun(this, Vector(-2.6, 0.1, 3.0), Quaternion(), 0);
    5555  Weapon* wpLeft = new TestGun(this, Vector(-2.6, 0.1, -3.0), Quaternion(), 1);
    5656 
    57   this->weaponMan->addWeapon(wpRight, W_CONFIG0);
    58   this->weaponMan->addWeapon(wpLeft, W_CONFIG1);
     57  this->weaponMan->addWeapon(wpRight, W_CONFIG0, W_SLOT0);
     58  this->weaponMan->addWeapon(wpLeft, W_CONFIG1, W_SLOT1);
    5959  this->weaponMan->addWeapon(wpRight, W_CONFIG2);
    6060  this->weaponMan->addWeapon(wpLeft, W_CONFIG2);
     
    7474}
    7575
     76/**
     77   \brief creates a new Player from Xml Data
     78   \param root the xml element containing player data
     79   
     80   \todo add more parameters to load
     81*/
     82Player::Player(TiXmlElement* root) : WorldEntity(root)
     83{
     84  this->weapons = new tList<Weapon>();
     85  this->activeWeapon = NULL;
     86  /*
     87    this is the debug player - actualy we would have to make a new
     88     class derivated from Player for each player. for now, we just use
     89     the player.cc for debug also
     90  */
     91  travelSpeed = 15.0;
     92  velocity = new Vector();
     93  bUp = bDown = bLeft = bRight = bAscend = bDescend = false;
     94  bFire = false;
     95  this->bWeaponChange = false;
     96  acceleration = 10.0;
     97  //weapons:
     98  this->weaponMan = new WeaponManager();
     99  Weapon* wpRight = new TestGun(this, Vector(-2.6, 0.1, 3.0), Quaternion(), 0);
     100  Weapon* wpLeft = new TestGun(this, Vector(-2.6, 0.1, -3.0), Quaternion(), 1);
     101 
     102  this->weaponMan->addWeapon(wpRight, W_CONFIG0, W_SLOT0);
     103  this->weaponMan->addWeapon(wpLeft, W_CONFIG1, W_SLOT1);
     104  this->weaponMan->addWeapon(wpRight, W_CONFIG2);
     105  this->weaponMan->addWeapon(wpLeft, W_CONFIG2);
     106}
    76107
    77108/**
     
    188219  //orthDirection = orthDirection.cross (direction);
    189220
    190   if( this->bUp && this->getRelCoor()->x < 20)
     221  if( this->bUp && this->getRelCoor().x < 20)
    191222    accel = accel+(direction*acceleration);
    192   if( this->bDown && this->getRelCoor()->x > -5)
     223  if( this->bDown && this->getRelCoor().x > -5)
    193224    accel = accel-(direction*acceleration);
    194   if( this->bLeft &&  TrackManager::getInstance()->getWidth() > -this->getRelCoor()->z*2)
     225  if( this->bLeft &&  TrackManager::getInstance()->getWidth() > -this->getRelCoor().z*2)
    195226    accel = accel - (orthDirection*acceleration);
    196   if( this->bRight &&  TrackManager::getInstance()->getWidth() > this->getRelCoor()->z*2)
     227  if( this->bRight &&  TrackManager::getInstance()->getWidth() > this->getRelCoor().z*2)
    197228    accel = accel + (orthDirection*acceleration);
    198229  if( this->bAscend )
     
    230261{
    231262  PRINTF(3)("recieved command [%s]\n", cmd->cmd);
    232   if( !strcmp( cmd->cmd, "up")) this->bUp = !cmd->bUp;
    233   if( !strcmp( cmd->cmd, "down")) this->bDown = !cmd->bUp;
    234   if( !strcmp( cmd->cmd, "left")) this->bLeft = !cmd->bUp;
    235   if( !strcmp( cmd->cmd, "right")) this->bRight = !cmd->bUp;
    236   if( !strcmp( cmd->cmd, "fire")) this->bFire = !cmd->bUp;
    237   if( !strcmp( cmd->cmd, "mode")) if(cmd->bUp) this->bWeaponChange = !this->bWeaponChange;
    238 }
     263  if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_UP)) this->bUp = !cmd->bUp;
     264  if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_DOWN)) this->bDown = !cmd->bUp;
     265  if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_LEFT)) this->bLeft = !cmd->bUp;
     266  if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_RIGHT)) this->bRight = !cmd->bUp;
     267  if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_FIRE)) this->bFire = !cmd->bUp;
     268  if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_NEXT_WEAPON)) if(cmd->bUp) this->bWeaponChange = !this->bWeaponChange;
     269}
  • orxonox/branches/physics/src/world_entities/player.h

    r3953 r4178  
    2222 public:
    2323  Player();
     24  Player(TiXmlElement* root);
    2425  virtual ~Player();
    2526
  • orxonox/branches/physics/src/world_entities/skybox.cc

    r3953 r4178  
    2828
    2929#include "skybox.h"
     30
    3031#include "stdincl.h"
     32#include "factory.h"
    3133
    3234#include "material.h"
     
    3638//#include "world_entity.h"
    3739
     40CREATE_FACTORY(SkyBox);
    3841
    3942using namespace std;
     
    4548SkyBox::SkyBox(char* fileName)
    4649{
     50  this->preInit();
     51  this->postInit();
     52}
     53
     54SkyBox::SkyBox(TiXmlElement* root) : WorldEntity(root)
     55{
     56  this->preInit();
     57
     58  const char* string;
     59
     60  // Model Loading     
     61  string = grabParameter( root, "materialset");
     62  if( string != NULL)
     63    this->setTexture(string, "jpg");
     64  else
     65    {
     66      PRINTF(0)("SkyBox is missing a proper 'MaterialSet'\n");
     67    }
     68  if( this->skyModel == NULL)
     69    {
     70      PRINTF(0)("SkyBox model '%s' could not be loaded\n", string);
     71    }
     72  this->postInit();
     73}
     74
     75void SkyBox::preInit(void)
     76{
    4777  this->setClassName("SkyBox");
     78  this->skyModel = NULL;
    4879  this->material = new Material*[6];
    49   for (int i = 0; i <6; i++)
     80  for (int i = 0; i < 6; i++)
    5081    {
    5182      this->material[i] = new Material();
     
    5687    }
    5788  this->setMode(PNODE_MOVEMENT);
    58 
     89}
     90
     91void SkyBox::postInit(void)
     92{
    5993  this->setSize(1900.0);
     94  this->rebuild();
    6095}
    6196
     
    66101SkyBox::~SkyBox()
    67102{
    68   PRINTF(5)("Deleting the SkyBox\n");
    69  
     103  PRINTF(5)("Deleting SkyBox\n");
    70104  for (int i = 0; i < 6; i++)
    71105    delete this->material[i];
     
    84118void SkyBox::setTexture(const char* name, const char* extension)
    85119{
    86   char* top    = new char[strlen(name)+strlen(extension)+ 6];
    87   char* bottom = new char[strlen(name)+strlen(extension)+ 9];
    88   char* left   = new char[strlen(name)+strlen(extension)+ 7];
    89   char* right  = new char[strlen(name)+strlen(extension)+ 8];
    90   char* front  = new char[strlen(name)+strlen(extension)+ 8];
    91   char* back   = new char[strlen(name)+strlen(extension)+ 7];
     120  char* top    = new char[strlen(name)+strlen(extension)+ 10];
     121  char* bottom = new char[strlen(name)+strlen(extension)+ 10];
     122  char* left   = new char[strlen(name)+strlen(extension)+ 10];
     123  char* right  = new char[strlen(name)+strlen(extension)+ 10];
     124  char* front  = new char[strlen(name)+strlen(extension)+ 10];
     125  char* back   = new char[strlen(name)+strlen(extension)+ 10];
    92126
    93127  sprintf(top, "%s_top.%s", name, extension);
     
    100134  this->setTextures(top, bottom, left, right, front, back);
    101135
     136  // deleted alocated memory of this function
    102137  delete []top;
    103138  delete []bottom;
     
    125160  this->material[4]->setDiffuseMap(front);
    126161  this->material[5]->setDiffuseMap(back);
    127 
    128   this->rebuild();
    129162}
    130163
     
    135168{
    136169  this->size = size;
    137 
    138   this->rebuild();
    139170}
    140171
     
    149180  glTranslatef(r.x, r.y, r.z);
    150181
    151   this->model->draw();
     182  this->skyModel->draw();
    152183
    153184  glPopMatrix();
     
    162193void SkyBox::rebuild()
    163194{
    164   if (this->model)
    165     delete model;
    166   model = new Model();
    167 
    168   model->addVertex (-0.5*size, -0.5*size, 0.5*size); 
    169   model->addVertex (0.5*size, -0.5*size, 0.5*size);
    170   model->addVertex (-0.5*size, 0.5*size, 0.5*size);
    171   model->addVertex (0.5*size, 0.5*size, 0.5*size);
    172   model->addVertex (-0.5*size, 0.5*size, -0.5*size);
    173   model->addVertex (0.5*size, 0.5*size, -0.5*size);
    174   model->addVertex (-0.5*size, -0.5*size, -0.5*size);
    175   model->addVertex (0.5*size, -0.5*size, -0.5*size);
    176 
    177   model->addVertexTexture (0.0, 0.0);
    178   model->addVertexTexture (1.0, 0.0);
    179   model->addVertexTexture (1.0, 1.0);
    180   model->addVertexTexture (0.0, 1.0);
    181 
    182   model->addVertexNormal (0.0, 0.0, 1.0);
    183   model->addVertexNormal (0.0, 1.0, 0.0);
    184   model->addVertexNormal (0.0, 0.0, -1.0);
    185   model->addVertexNormal (0.0, -1.0, 0.0);
    186   model->addVertexNormal (1.0, 0.0, 0.0);
    187   model->addVertexNormal (-1.0, 0.0, 0.0);
    188 
    189   model->setMaterial(material[0]);
    190   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 3,2,4, 4,3,4, 6,4,4, 5,1,4); // top
    191   model->setMaterial(material[1]);
    192   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 7,4,2, 8,1,2, 2,2,2, 1,3,2); // bottom
    193   model->setMaterial(material[2]);
    194   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,1,3, 2,2,3, 4,3,3, 3,4,3); // left
    195   model->setMaterial(material[3]);
    196   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 5,3,1, 6,4,1, 8,1,1, 7,2,1); // right
    197   model->setMaterial(material[4]);
    198   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,1,6, 8,2,6, 6,3,6, 4,4,6); // front
    199   model->setMaterial(material[5]);
    200   model->addFace (4, VERTEX_TEXCOORD_NORMAL, 7,1,5, 1,2,5, 3,3,5, 5,4,5); // back
     195  if (this->skyModel)
     196    delete skyModel;
     197  skyModel = new Model();
     198
     199  this->skyModel->addVertex (-0.5*size, -0.5*size, 0.5*size); 
     200  this->skyModel->addVertex (0.5*size, -0.5*size, 0.5*size);
     201  this->skyModel->addVertex (-0.5*size, 0.5*size, 0.5*size);
     202  this->skyModel->addVertex (0.5*size, 0.5*size, 0.5*size);
     203  this->skyModel->addVertex (-0.5*size, 0.5*size, -0.5*size);
     204  this->skyModel->addVertex (0.5*size, 0.5*size, -0.5*size);
     205  this->skyModel->addVertex (-0.5*size, -0.5*size, -0.5*size);
     206  this->skyModel->addVertex (0.5*size, -0.5*size, -0.5*size);
     207
     208  this->skyModel->addVertexTexture (0.0, 0.0);
     209  this->skyModel->addVertexTexture (1.0, 0.0);
     210  this->skyModel->addVertexTexture (1.0, 1.0);
     211  this->skyModel->addVertexTexture (0.0, 1.0);
     212
     213  this->skyModel->addVertexNormal (0.0, 0.0, 1.0);
     214  this->skyModel->addVertexNormal (0.0, 1.0, 0.0);
     215  this->skyModel->addVertexNormal (0.0, 0.0, -1.0);
     216  this->skyModel->addVertexNormal (0.0, -1.0, 0.0);
     217  this->skyModel->addVertexNormal (1.0, 0.0, 0.0);
     218  this->skyModel->addVertexNormal (-1.0, 0.0, 0.0);
     219
     220  this->skyModel->setMaterial(material[0]);
     221  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,1,3, 3,2,3, 5,3,3, 4,0,3); // top
     222  this->skyModel->setMaterial(material[1]);
     223  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,3,1, 7,0,1, 1,1,1, 0,2,1); // bottom
     224  this->skyModel->setMaterial(material[2]);
     225  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 0,0,2, 1,1,2, 3,2,2, 2,3,2); // left
     226  this->skyModel->setMaterial(material[3]);
     227  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 4,2,0, 5,3,0, 7,0,0, 6,1,0); // right
     228  this->skyModel->setMaterial(material[4]);
     229  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,0,5, 7,1,5, 5,2,5, 3,3,6); // front
     230  this->skyModel->setMaterial(material[5]);
     231  this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,0,4, 0,1,4, 2,2,4, 4,3,4); // back
    201232 
    202   model->finalize();
    203 }
     233  this->skyModel->finalize();
     234}
  • orxonox/branches/physics/src/world_entities/skybox.h

    r3807 r4178  
    2222 public:
    2323  SkyBox(char* fileName = NULL);
     24  SkyBox(TiXmlElement* root);
     25
    2426  virtual ~SkyBox();
     27
     28  void preInit(void);
     29  void postInit(void);
     30
    2531
    2632  void setSize(float size);
     
    3339  void rebuild();
    3440
     41  Model* skyModel;        //!< A Model for the Sky. This must not be the same as the Model from WorldEntity, because it is not alocated through the ResourceManager.
    3542  Material **material;    //!< Materials for the SkyBox. sorted by number (0-5) top, bottom, left, right, front, back
    3643  float size;             //!< Size of the SkyBox. This should match the frustum maximum range.
  • orxonox/branches/physics/src/world_entities/skysphere.cc

    r3763 r4178  
    4444{
    4545  if (fileName == NULL)
    46     this->initialize("../data/pictures/sky-replace.jpg");
     46    this->initialize("pictures/sky-replace.jpg");
    4747  else
    4848    this->initialize(fileName);
  • orxonox/branches/physics/src/world_entities/terrain.cc

    r3677 r4178  
    7777void Terrain::init(void)
    7878{
    79    this->setClassName ("Terrain");
    80 
    81    this->objectList = 0;
     79  this->setClassName ("Terrain");
     80 
     81  this->objectList = 0;
    8282}
    8383
     
    9898  glMultMatrixf((float*)matrix);
    9999
    100   if (objectList)
    101     glCallList(objectList);
    102   else if (model)
    103     model->draw();
    104   //  this->model->draw();
     100  if (this->objectList)
     101    glCallList(this->objectList);
     102  else if (this->model)
     103    this->model->draw();
    105104  glPopMatrix();
    106105}
  • orxonox/branches/physics/src/world_entities/test_gun.cc

    r3953 r4178  
    4949  this->objectComponent1 = new PNode();
    5050  this->animation1 = new Animation3D(this->objectComponent1);
    51   parent->addChild(this->objectComponent1, PNODE_ALL);
     51  this->animation2 = new Animation3D(this);
     52  this->animation3 = new Animation3D(this);
     53  //parent->addChild(this->objectComponent1, PNODE_ALL);
     54  this->addChild(this->objectComponent1, PNODE_ALL);
    5255
    5356  this->animation1->setInfinity(ANIM_INF_CONSTANT);
    54   // ANIM_LINEAR was ANIM_NEG_EXP
     57  this->animation2->setInfinity(ANIM_INF_CONSTANT);
     58  this->animation3->setInfinity(ANIM_INF_CONSTANT);
    5559  if( this->leftRight == W_LEFT)
    5660    {
    5761      this->projectileOffset = Vector(1.0, 0.0, -0.35);
    5862
    59       this->animation1->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.1, ANIM_LINEAR);
    60       this->animation1->addKeyFrame(Vector(-3.0, 0.1, 3.0), Quaternion(), 0.5, ANIM_LINEAR);
    61       this->animation1->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.1, ANIM_LINEAR);
     63      this->animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);
     64      this->animation1->addKeyFrame(Vector(-0.4, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);
     65      this->animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.0, ANIM_LINEAR, ANIM_CONSTANT);
     66
     67      this->animation2->addKeyFrame(Vector(-2.6, 0.1, 2.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);
     68      this->animation2->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);
     69
     70      this->animation3->addKeyFrame(Vector(-2.6, 0.1, 3.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);
     71      this->animation3->addKeyFrame(Vector(-2.6, 0.1, 2.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);
    6272    }
    6373  else if( this->leftRight == W_RIGHT)
     
    6575      this->projectileOffset = Vector(1.0, 0.0, 0.5);
    6676
    67       this->animation1->addKeyFrame(Vector(-2.6, 0.1, -2.5), Quaternion(), 0.1, ANIM_LINEAR);
    68       this->animation1->addKeyFrame(Vector(-3.0, 0.1, -2.5), Quaternion(), 0.5, ANIM_LINEAR);
    69       this->animation1->addKeyFrame(Vector(-2.6, 0.1, -2.5), Quaternion(), 0.1, ANIM_LINEAR);
     77      this->objectComponent1->setRelCoor(Vector(0,0,0.35));
     78      this->animation1->addKeyFrame(Vector(0, 0, .5), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);
     79      this->animation1->addKeyFrame(Vector(-0.4, 0, .5), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);
     80      this->animation1->addKeyFrame(Vector(0, 0, .5), Quaternion(), 0.0, ANIM_LINEAR, ANIM_CONSTANT);
     81
     82      this->animation2->addKeyFrame(Vector(-2.6, 0.1, -2.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);
     83      this->animation2->addKeyFrame(Vector(-2.6, 0.1, -3.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);
     84
     85      this->animation3->addKeyFrame(Vector(-2.6, 0.1, -3.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);
     86      this->animation3->addKeyFrame(Vector(-2.6, 0.1, -2.0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT);
    7087    }
     88
    7189}
    7290
     
    89107*/
    90108void TestGun::activate()
    91 {}
     109{
     110  this->animation2->replay();
     111}
    92112
    93113
     
    100120*/
    101121void TestGun::deactivate()
    102 {}
     122{
     123  this->animation3->replay();
     124}
    103125
    104126
  • orxonox/branches/physics/src/world_entities/weapon.cc

    r3953 r4178  
    110110void WeaponManager::nextWeaponConf()
    111111{
    112   PRINTF(4)("Changing weapon configuration: from %i\n", this->currConfID);
    113 
    114   Weapon* w;
    115   for(int i = 0; i < W_MAX_SLOTS; ++i)
    116     {
    117       w = this->configs[this->currConfID].slots[i];
    118       if( w != NULL) w->deactivate();
    119     }
    120   int i;
     112  PRINTF(4)("Changing weapon configuration: from %i to next\n", this->currConfID);
     113
     114  int i, lastConfID;
     115  lastConfID = this->currConfID;
    121116  for(i = this->currConfID + 1; i < W_MAX_CONFIGS && !this->configs[i].bUsed; ++i);
    122117  if( i == W_MAX_CONFIGS) this->currConfID = W_CONFIG0;
    123118  else this->currConfID = i; 
    124   PRINTF(4)("\tto %i\n", this->currConfID);
    125 
    126   for(int i = 0; i < W_MAX_SLOTS; ++i)
    127     {
    128       w = this->configs[this->currConfID].slots[i];
    129       if( w != NULL) w->activate();
     119
     120 
     121  Weapon *w1, *w2;
     122  for(int j = 0; j < W_MAX_SLOTS; ++j)
     123    {
     124      w1 = this->configs[lastConfID].slots[j];
     125      w2 = this->configs[this->currConfID].slots[j];
     126     
     127      if( w1 == w2)
     128        {
     129          printf("no need for change\n");
     130        }
     131      else
     132        {
     133        if( w1 != NULL )
     134          {
     135            w1->deactivate();
     136            printf("deactivating %i,%i\n", j,lastConfID);
     137          }
     138        if( w2 != NULL)
     139          {
     140            w2->activate();
     141            printf("activating %i,%i\n", j, this->currConfID);
     142          }
     143        }
    130144    }
    131145}
  • orxonox/branches/physics/src/world_entities/world_entity.cc

    r3832 r4178  
    3030/**
    3131   \brief standard constructor
    32    
    33    Every derived contructor HAS to call the previous one supplying the isFree parameter. This is necessary to distunguish
    34    between free and bound entities. The difference between them is simply the fact that the movement of a free entity is
    35    not bound to the track of a world. Use this to implement projectile or effect classes that do not have to travel along the track.
    36    To specify an entity to be free or bound set the default parameter in the declaration of the constructor.
    37    Theoretically you should never have to call the constructor of an Entity directly, for it is called by the spawn() function of the World
    38    class. So if you want to create a new entity at any time, call World::spawn(). It will handle everything that is necessary.
    39 */
    40 WorldEntity::WorldEntity (bool isFree) : bFree(isFree)
     32*/
     33WorldEntity::WorldEntity ()
    4134{
    4235  this->setClassName ("WorldEntity");
     
    4740
    4841/**
     42   \brief Loads the WordEntity-specific Part of any derived Class
     43*/
     44WorldEntity::WorldEntity(TiXmlElement* root)
     45{
     46  // Name Setup
     47  char* temp;
     48  const char* string;
     49  string = grabParameter( root, "name");
     50  if( string == NULL)
     51    {
     52      PRINTF(2)("WorldEntity is missing a proper 'name'\n");
     53      string = "Unknown";
     54      temp = new char[strlen(string + 2)];
     55      strcpy( temp, string);
     56      this->setName( temp);
     57    }
     58  else
     59    {
     60      temp = new char[strlen(string + 2)];
     61      strcpy( temp, string);
     62      this->setName( temp);
     63    }
     64  // Model Loading     
     65  this->model = NULL;
     66  string = grabParameter( root, "model");
     67  if( string != NULL)
     68    this->model = (Model*)ResourceManager::getInstance()->load(string, OBJ, RP_CAMPAIGN);
     69  else
     70    {
     71      PRINTF(2)("WorldEntity is missing a proper 'model'\n");
     72      this->model = NULL;
     73    }
     74  if( this->model == NULL)
     75    {
     76      PRINTF(2)("WorldEntity model '%s' could not be loaded\n", string);
     77    }
     78  this->bDraw = true;
     79}
     80
     81/**
    4982   \brief standard destructor
    5083*/
     
    73106{}
    74107
    75 
    76 /**
    77    \brief query whether the WorldEntity in question is free
    78    \return true if the WorldEntity is free or false if it isn't
    79 */
    80 bool WorldEntity::isFree ()
    81 {
    82   return bFree;
    83 }
    84108
    85109/**
  • orxonox/branches/physics/src/world_entities/world_entity.h

    r3799 r4178  
    2323
    2424 public:
    25   WorldEntity (bool isFree = false);
     25  WorldEntity (void);
     26  WorldEntity(TiXmlElement* root);
    2627  virtual ~WorldEntity ();
    2728
     
    3233  //void removeAbility(Ability* ability);
    3334  void setDrawable (bool bDraw); 
    34   bool isFree ();
    3535  void setCharacterAttributes(CharacterAttributes* charAttr);
    3636  CharacterAttributes* getCharacterAttributes();
     
    5252 
    5353 private:
    54   const bool bFree;                   //!< If the entity is free.
    5554  bool bCollide;                      //!< If it should be considered for the collisiontest.
    5655  bool bDraw;                         //!< If it should be visible.
Note: See TracChangeset for help on using the changeset viewer.