From: <spo...@us...> - 2009-01-19 23:13:46
|
Revision: 950 http://opengate.svn.sourceforge.net/opengate/?rev=950&view=rev Author: spom_spom Date: 2009-01-19 23:13:32 +0000 (Mon, 19 Jan 2009) Log Message: ----------- next steps of reorganization done. (mesh objects, collision, basic flight). Modified Paths: -------------- trunk/data/materials/simpleHUD.material trunk/data/misc/test.sector trunk/m4/libtool.m4 trunk/m4/ltoptions.m4 trunk/m4/ltsugar.m4 trunk/m4/ltversion.m4 trunk/src/Entity.cpp trunk/src/Entity.h trunk/src/Hud.cpp trunk/src/Makefile.am trunk/src/OpcodeWrapper.cpp trunk/src/OpcodeWrapper.h trunk/src/Opengate.h trunk/src/Sector.cpp trunk/src/Sector.h trunk/src/SectorAvatarObject.cpp trunk/src/SectorAvatarObject.h trunk/src/SectorCollisionObject.h trunk/src/SectorMeshObject.cpp trunk/src/SectorMeshObject.h trunk/src/SectorMovableObject.cpp trunk/src/SectorMovableObject.h trunk/src/SectorObjectVessel.cpp trunk/src/SectorVesselObject.cpp trunk/src/SectorVesselObject.h trunk/src/Station.cpp trunk/src/Station.h trunk/src/UnDockedState.cpp trunk/src/common.h trunk/src/commonWithOgre.cpp trunk/src/commonWithOgre.h Added Paths: ----------- trunk/src/SectorBeaconObject.cpp trunk/src/SectorBeaconObject.h trunk/src/SectorStationObject.cpp trunk/src/SectorStationObject.h Modified: trunk/data/materials/simpleHUD.material =================================================================== --- trunk/data/materials/simpleHUD.material 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/data/materials/simpleHUD.material 2009-01-19 23:13:32 UTC (rev 950) @@ -22,7 +22,9 @@ pass { depth_check off - lighting off + depth_write off + lighting on + scene_blend alpha_blend texture_unit @@ -40,6 +42,7 @@ pass { depth_check on + depth_write on lighting on } } @@ -52,6 +55,7 @@ pass { depth_check on + depth_write on lighting on } } Modified: trunk/data/misc/test.sector =================================================================== --- trunk/data/misc/test.sector 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/data/misc/test.sector 2009-01-19 23:13:32 UTC (rev 950) @@ -7,10 +7,20 @@ <position y="0" x="0" z="-1480"></position> </station> <sectorobject name="ring"> - <position y="100" x="-650" z="800"></position> + <position y="-100" x="0" z="-100"></position> <scale y="35" x="35" z="35"></scale> <entity meshFile="ring.mesh" material-0="ring/main" numSubEntities="1"></entity> </sectorobject> + <sectorobject name="ring1"> + <position y="0" x="0" z="-100"></position> + <scale y="35" x="35" z="35"></scale> + <entity meshFile="ring.mesh" material-0="ring/main" numSubEntities="1"></entity> + </sectorobject> + <sectorobject name="ring2"> + <position y="100" x="0" z="-100"></position> + <scale y="35" x="35" z="35"></scale> + <entity meshFile="ring.mesh" material-0="ring/main" numSubEntities="1"></entity> + </sectorobject> <beacon> <position y="0" x="-650" z="800"></position> </beacon> Modified: trunk/m4/libtool.m4 =================================================================== --- trunk/m4/libtool.m4 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/m4/libtool.m4 2009-01-19 23:13:32 UTC (rev 950) @@ -380,12 +380,12 @@ # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], -[m4_assert([$# <= 2])dnl -_$0(m4_quote(m4_default([$1], [[, ]])), - m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), - m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) -m4_define([_lt_decl_varnames_tagged], -[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_quote(m4_if([$2], [], + m4_quote(lt_decl_tag_varnames), + m4_quote(m4_shift($@)))), + m4_split(m4_normalize(m4_quote(_LT_TAGS))))]) +m4_define([_lt_decl_varnames_tagged], [lt_combine([$1], [$2], [_], $3)]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) @@ -945,10 +945,10 @@ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on + darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? + # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; @@ -990,11 +990,7 @@ _LT_TAGVAR(whole_archive_flag_spec, $1)='' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then + if test "$GCC" = "yes"; then output_verbose_link_cmd=echo _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" @@ -1516,7 +1512,7 @@ lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw* | cegcc*) + cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, @@ -1684,6 +1680,10 @@ # endif #endif +#ifdef __cplusplus +extern "C" void exit (int); +#endif + void fnord() { int i=42;} int main () { @@ -1699,7 +1699,7 @@ else puts (dlerror ()); - return status; + exit (status); }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then @@ -1738,7 +1738,7 @@ lt_cv_dlopen_self=yes ;; - mingw* | pw32* | cegcc*) + mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; @@ -2035,7 +2035,6 @@ [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], @@ -2200,14 +2199,14 @@ # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -2230,7 +2229,7 @@ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; - mingw* | cegcc*) + mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` @@ -2669,7 +2668,7 @@ version_type=linux need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes @@ -2693,7 +2692,7 @@ if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi - + if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi @@ -2970,7 +2969,6 @@ # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) -m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' @@ -3021,12 +3019,6 @@ fi ;; -cegcc) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; @@ -3338,7 +3330,7 @@ aix*) symcode='[[BCDT]]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) @@ -3584,7 +3576,7 @@ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) + mingw* | cygwin* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -3611,11 +3603,10 @@ fi ;; hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. case $host_cpu in - hppa*64*) + hppa*64*|ia64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' @@ -3713,19 +3704,12 @@ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; - ecpc* ) - # old Intel C++ for x86_64 which still supported -KPIC. + icpc* | ecpc* ) + # Intel C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; - icpc* ) - # Intel C++, used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' @@ -3891,7 +3875,7 @@ # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -3907,11 +3891,10 @@ ;; hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. case $host_cpu in - hppa*64*) + hppa*64*|ia64*) # +Z the default ;; *) @@ -3961,7 +3944,7 @@ fi ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], @@ -3992,25 +3975,11 @@ linux* | k*bsd*-gnu) case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) + icc* | ecc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' - _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' - ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) @@ -4192,7 +4161,7 @@ pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; - cygwin* | mingw* | cegcc*) + cygwin* | mingw*) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' ;; *) @@ -4244,7 +4213,7 @@ extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. @@ -4331,7 +4300,7 @@ fi ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | pw32*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' @@ -4397,9 +4366,6 @@ tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - _LT_TAGVAR(whole_archive_flag_spec, $1)= - tmp_sharedflag='--shared' ;; xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; @@ -4631,7 +4597,6 @@ fi fi - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes @@ -4686,7 +4651,7 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is @@ -4790,7 +4755,7 @@ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' @@ -5575,7 +5540,6 @@ fi fi - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. @@ -5634,7 +5598,7 @@ esac ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | pw32*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' @@ -7019,18 +6983,6 @@ ]) -# _LT_DECL_OBJDUMP -# -------------- -# If we don't have a new enough Autoconf to choose the best objdump -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_OBJDUMP], -[AC_CHECK_TOOL(OBJDUMP, objdump, false) -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) -AC_SUBST([OBJDUMP]) -]) - - # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates Modified: trunk/m4/ltoptions.m4 =================================================================== --- trunk/m4/ltoptions.m4 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/m4/ltoptions.m4 2009-01-19 23:13:32 UTC (rev 950) @@ -125,7 +125,7 @@ [enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) Modified: trunk/m4/ltsugar.m4 =================================================================== --- trunk/m4/ltsugar.m4 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/m4/ltsugar.m4 2009-01-19 23:13:32 UTC (rev 950) @@ -1,13 +1,13 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. -# Written by Gary V. Vaughan, 2004 +# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 6 ltsugar.m4 +# serial 5 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) @@ -63,14 +63,14 @@ # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. -# Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], -[m4_if(m4_eval([$# > 3]), [1], - [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl -[[m4_foreach([_Lt_prefix], [$2], - [m4_foreach([_Lt_suffix], - ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, - [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) +[m4_if([$2], [], [], + [m4_if([$4], [], [], + [lt_join(m4_quote(m4_default([$1], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_prefix, [$2], + [m4_foreach(_Lt_suffix, lt_car([m4_shiftn(3, $@)]), + [_Lt_prefix[]$3[]_Lt_suffix ])])))))])])dnl +]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) Modified: trunk/m4/ltversion.m4 =================================================================== --- trunk/m4/ltversion.m4 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/m4/ltversion.m4 2009-01-19 23:13:32 UTC (rev 950) @@ -9,15 +9,15 @@ # Generated from ltversion.in. -# serial 3012 ltversion.m4 +# serial 2976 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.2.6]) -m4_define([LT_PACKAGE_REVISION], [1.3012]) +m4_define([LT_PACKAGE_VERSION], [2.2.4]) +m4_define([LT_PACKAGE_REVISION], [1.2976]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.2.6' -macro_revision='1.3012' +[macro_version='2.2.4' +macro_revision='1.2976' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) Modified: trunk/src/Entity.cpp =================================================================== --- trunk/src/Entity.cpp 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/Entity.cpp 2009-01-19 23:13:32 UTC (rev 950) @@ -136,9 +136,9 @@ MeshEntity::MeshEntity(): Entity(){ baseSize_ = Ogre::Vector3::ZERO; - baseYaw_ = 0; - basePitch_ = 0; - baseRoll_ = 0; + baseYaw_ = 0.0; + basePitch_ = 0.0; + baseRoll_ = 0.0; } MeshEntity::~MeshEntity(){} @@ -146,19 +146,15 @@ void MeshEntity::readPropertiesFromXML( TiXmlHandle & hRoot ){ Entity::readPropertiesFromXML( hRoot ); - readXMLNode< float >( hRoot, "baseyaw", this, &OpenGate::MeshEntity::setBaseYaw, false ); - readXMLNode< float >( hRoot, "basepitch", this, &OpenGate::MeshEntity::setBasePitch, false ); - readXMLNode< float >( hRoot, "baseroll", this, &OpenGate::MeshEntity::setBaseRoll, false ); - + readXMLNode< float >( hRoot, "base_yaw", this, &OpenGate::MeshEntity::setBaseYaw, false ); + readXMLNode< float >( hRoot, "base_pitch", this, &OpenGate::MeshEntity::setBasePitch, false ); + readXMLNode< float >( hRoot, "base_roll", this, &OpenGate::MeshEntity::setBaseRoll, false ); + readXMLNode< float >( hRoot, "base_size", this, &OpenGate::MeshEntity::setBaseSize, false ); + + // readXMLNode< float >( hRoot, "basesize", this, &OpenGate::MeshEntity::setBaseSize, false ); TiXmlElement * pElem; Ogre::Real length = 0; - pElem = hRoot.ChildElement( "size", 0 ).Element(); - if ( pElem ) { - length = toDouble( pElem->FirstChild()->Value() ); - this->setBaseSize( length ); - } - pElem = hRoot.ChildElement( "length", 0 ).Element(); if ( pElem ) length = toDouble( pElem->FirstChild()->Value() ); @@ -170,7 +166,7 @@ pElem = hRoot.ChildElement( "height", 0 ).Element(); if ( pElem ) height = toDouble( pElem->FirstChild()->Value() ); - if ( length > 0 && width > 0 && height > 0 ) this->setBaseSize( width, height, length ); + if ( length > 0 && width > 0 && height > 0 ) this->setBaseSizeVector( width, height, length ); if ( !readXMLNode< std::string >( hRoot, "mesh", this, &OpenGate::MeshEntity::setMesh, false ) ){ @@ -182,17 +178,6 @@ } } -void MeshEntity::setBaseSize( float length, float width, float height ){ - baseSize_[ 0 ] = length; - baseSize_[ 1 ] = width; - baseSize_[ 2 ] = height; -} - - /*! If size is a scalar value, the length of the entity. */ -void MeshEntity::setBaseSize( float size ){ baseSize_[ 2 ] = size; } - -Ogre::Vector3 MeshEntity::baseSize( ) const { return baseSize_; } - std::string MeshEntity::createMeshName( const std::string & meshName ){ return strReplaceBlankWithUnderscore( strCopyToLowerCase( meshName ) ); } Modified: trunk/src/Entity.h =================================================================== --- trunk/src/Entity.h 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/Entity.h 2009-01-19 23:13:32 UTC (rev 950) @@ -78,16 +78,15 @@ virtual void readPropertiesFromXML( TiXmlHandle & hRoot ); - inline std::string factionName( ) const { return factionName_; } + inline void setName( const std::string & name ) { name_ = name; } + inline const std::string & name( ) const { return name_; } void setFactionID( int id ); inline int factionID( ) const { return factionID_; } + inline const std::string & factionName( ) const { return factionName_; } - inline void setName( const std::string & name ) { name_ = name; } - inline std::string name( ) const { return name_; } - inline void setCategoryName( const std::string & category ) { category_ = category; } - inline std::string categoryName( ) const { return category_; } + inline const std::string & categoryName( ) const { return category_; } inline void setID( int id ){ id_ = id; } inline int id( ) const { return id_; } @@ -102,10 +101,10 @@ inline int size( ) const { return size_; } inline void setDescription( const std::string & description ){ description_ = description; } - inline std::string description( ) const { return description_; } + inline const std::string & description( ) const { return description_; } inline void setImageName( const std::string & imageFileName ) { imageFileName_ = imageFileName; } - inline std::string imageName() const { return imageFileName_; } + inline const std::string & imageName() const { return imageFileName_; } inline std::string ceguiImageName() { if ( !imageInitialised_ ) loadImages_(); return ceguiImageName_; } inline std::string ceguiSmallImageName() { if ( !imageInitialised_ ) loadImages_(); return ceguiSmallImageName_; } @@ -114,11 +113,11 @@ inline void addProductionCenter( const std::string & productionCenter ) { productionCenters_.insert( productionCenter ); } - inline std::set < std::string > productionCenters( ) const { return productionCenters_; } + inline const std::set < std::string > & productionCenters( ) const { return productionCenters_; } inline void setRequieredComponents( const std::set < Entity * > & requieredComponents ) { requieredComponents_ = requieredComponents; } - inline std::set < Entity * > requieredComponents( ) const { return requieredComponents_; } + inline const std::set < Entity * > & requieredComponents( ) const { return requieredComponents_; } protected: inline void setFactionName_( const std::string & name ) { factionName_ = name; } @@ -168,11 +167,12 @@ void readPropertiesFromXML( TiXmlHandle & hRoot ); /*! Base sizes are necessary for resizing the ogremesh */ - void setBaseSize( float length, float width, float height ); - + inline void setBaseSizeVector( float length, float width, float height ){ + baseSize_[ 0 ] = length; baseSize_[ 1 ] = width; baseSize_[ 2 ] = height; } + /*! If size is a scalar value, the length of the entity.*/ - void setBaseSize( float size ); - Ogre::Vector3 baseSize( ) const; + inline void setBaseSize( float size ){ baseSize_[ 2 ] = size; } + inline const Ogre::Vector3 & baseSize( ) const { return baseSize_; } /*! Base sizes are necessary for resizing the ogremesh */ inline void setBaseYaw( Ogre::Real baseYaw ){ baseYaw_ = baseYaw; } @@ -187,7 +187,7 @@ inline Ogre::Real baseRoll( ) const { return baseRoll_; } void setMesh( const std::string & meshName ); - std::string meshName( ) const { return meshName_; } + inline const std::string & meshName( ) const { return meshName_; } virtual std::string createMeshName( const std::string & meshName ); Ogre::MeshPtr & meshPtr( ){ return pMesh_; } Modified: trunk/src/Hud.cpp =================================================================== --- trunk/src/Hud.cpp 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/Hud.cpp 2009-01-19 23:13:32 UTC (rev 950) @@ -289,14 +289,15 @@ // armorProgressLeftImg_->setYPosition( CEGUI::UDim( 0.5, -armorProgressHeight_/2.0 ) ); // armorProgressRightImg_->setYPosition( CEGUI::UDim( 0.5, -armorProgressHeight_/2.0 ) ); // -// if ( avatar_->breakPressed() ){ -// velocityText_->setProperty( "TextColours", "ffff0000" ); -// } else if (avatar_->afterburnerPressed()){ -// velocityText_->setProperty( "TextColours", "ff00ff00" ); -// } else { -// velocityText_->setProperty( "TextColours", "ffffffff" ); -// } - velocityText_->setText( "V" + Ogre::StringConverter::toString( round( (Ogre::Real)avatar_->speed(), 2 ), 4 ) ); + if ( avatar_->brakePressed() ){ + velocityText_->setProperty( "TextColours", "ffff0000" ); + } else if (avatar_->afterburnerPressed()){ + velocityText_->setProperty( "TextColours", "ff00ff00" ); + } else { + velocityText_->setProperty( "TextColours", "ffffffff" ); + } + velocityText_->setText( "V" + Ogre::StringConverter::toString( round( (Ogre::Real)avatar_->speed(), 2 ), 4 ) ); + // shieldText_->setText( "S" + Ogre::StringConverter::toString( avatar_->shieldRate() * 100.0f, 4 ) ); // armorText_->setText( "A" + Ogre::StringConverter::toString( avatar_->armorRate() * 100.0f, 4 ) ); Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/Makefile.am 2009-01-19 23:13:32 UTC (rev 950) @@ -82,12 +82,16 @@ SectorAvatarObject.cpp \ SectorBaseObject.h \ SectorBaseObject.cpp \ + SectorBeaconObject.h \ + SectorBeaconObject.cpp \ SectorCollisionObject.h \ SectorCollisionObject.cpp \ SectorMeshObject.h \ SectorMeshObject.cpp \ SectorMovableObject.h \ SectorMovableObject.cpp \ + SectorStationObject.h \ + SectorStationObject.cpp \ SectorVesselObject.h \ SectorVesselObject.cpp \ SectorObject.h \ Modified: trunk/src/OpcodeWrapper.cpp =================================================================== --- trunk/src/OpcodeWrapper.cpp 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/OpcodeWrapper.cpp 2009-01-19 23:13:32 UTC (rev 950) @@ -60,8 +60,7 @@ collisionManager_->addCollType( "Station", "Bullet", OgreOpcode::COLLTYPE_EXACT ); collisionManager_->addCollType( "DockPad", "SectorObject", OgreOpcode::COLLTYPE_EXACT ); - // collisionManager_->addCollType( "SectorObject", "SectorObject", OgreOpcode::COLLTYPE_CONTACT ); - // collisionManager_->addCollType( "SectorObject", "SectorObject", OgreOpcode::COLLTYPE_QUICK ); + //** possible contact types OgreOpcode::COLLTYPE_CONTACT || OgreOpcode::COLLTYPE_QUICK collideInSectorContext_ = collisionManager_->getDefaultContext(); } else { @@ -70,7 +69,6 @@ } void OpcodeCollisionDetection::free( ){ - if ( collisionManager_ ) delete collisionManager_; collisionManager_ = NULL; } @@ -81,22 +79,22 @@ OgreOpcode::CollisionReporter report( collideInSectorContext_->getCollisionReport() ); - int nCollids = report.getNumCollisions(); + uint nCollids = report.getNumCollisions(); if ( nCollids > 0 ){ // std::cout << "OpcodeCollisionDetection::update() " << nCollids << std::endl; OgreOpcode::CollisionPair **collisionReport; report.getAllCollisions( collisionReport ); - for ( int i = 0; i < nCollids; i ++ ){ - OgreOpcode::CollisionObject* col1 = collisionReport[ i ]->this_object; - OgreOpcode::CollisionObject* col2 = collisionReport[ i ]->other_object; + for ( uint i = 0; i < nCollids; i ++ ){ + OgreOpcode::CollisionObject * col1 = collisionReport[ i ]->this_object; + OgreOpcode::CollisionObject * col2 = collisionReport[ i ]->other_object; // std::cout << i << ": "<< col1->getName() << "<->" << col2->getName() << std::endl; - static_cast< BaseObject * >( col1->getClientData() )->collide( static_cast< BaseObject * >( + static_cast< SectorCollisionObject * >( col1->getClientData() )->collide( static_cast< SectorCollisionObject * >( col2->getClientData() ) ); - static_cast< BaseObject * >( col2->getClientData() )->collide( static_cast< BaseObject * >( + static_cast< SectorCollisionObject * >( col2->getClientData() )->collide( static_cast< SectorCollisionObject * >( col1->getClientData() ) ); } } // if ncols @@ -105,9 +103,9 @@ return true; } -void OpcodeCollisionDetection::createObject( SectorCollisionObject * obj ){ +void OpcodeCollisionDetection::create( SectorCollisionObject * obj ){ if ( obj && active_ ){ - OgreOpcode::CollisionObject * collObj = obj->pCollisionObject(); + OgreOpcode::CollisionObject * collObj = obj->collisionObject(); if ( !collObj ){ OgreOpcode::EntityCollisionShape * collShape = collisionManager_->createEntityCollisionShape( obj->name() + "/CollShape" ); @@ -129,33 +127,14 @@ } } -void OpcodeCollisionDetection::createObject( BaseObject * obj ){ - +void OpcodeCollisionDetection::destroy( SectorCollisionObject * obj ){ if ( obj && active_ ){ - OgreOpcode::CollisionObject * collObj = obj->collisionObject(); - - if ( !collObj ){ - - OgreOpcode::EntityCollisionShape * collShape = collisionManager_->createEntityCollisionShape( obj->name() + "/CollShape" ); - if ( obj->entity() ){ - collShape->load( obj->entity() ); - } else { - std::cout << "OpcodeCollisionDetection::createObject( BaseObject * obj ), no entity defined for obj: " << obj->name(); - } - - collObj = collideInSectorContext_->createObject( obj->name() + "/CollObj" ); - collObj->setCollClass( collisionManager_->queryCollClass( obj->collisionClass() ) ); - collObj->setShape( collShape ); - - collObj->setClientData( obj ); - collideInSectorContext_->addObject( collObj ); - - obj->setCollisionObject( collObj ); - } + destroy( obj->collisionObject() ); + obj->setCollisionObject( NULL ); } } -void OpcodeCollisionDetection::destroyObject( OgreOpcode::CollisionObject * obj ){ +void OpcodeCollisionDetection::destroy( OgreOpcode::CollisionObject * obj ){ if ( obj && active_ ){ OgreOpcode::ICollisionShape * shape = obj->getShape(); collideInSectorContext_->destroyObject( obj ); @@ -164,26 +143,6 @@ } } -void OpcodeCollisionDetection::destroyObject( BaseObject * obj ){ - - if ( obj && active_ ){ - destroyObject( obj->collisionObject() ); - obj->setCollisionObject( NULL ); - } -} - -void OpcodeCollisionDetection::detach( BaseObject * obj ){ - if ( obj && active_ ){ - destroyObject( obj ); - } -} - -void OpcodeCollisionDetection::attach( BaseObject * obj ){ - if ( obj && active_ ){ - createObject( obj ); - } -} - bool OpcodeCollisionDetection::checkCollideRay( SectorCollisionObject * obj, const Ogre::Ray & ray, double rayLength ){ if ( active_ ){ if ( !obj->destroyRequest() ){ @@ -222,6 +181,59 @@ return false; } + + + + + + + +void OpcodeCollisionDetection::createObject( BaseObject * obj ){ + + if ( obj && active_ ){ + OgreOpcode::CollisionObject * collObj = obj->collisionObject(); + + if ( !collObj ){ + + OgreOpcode::EntityCollisionShape * collShape = collisionManager_->createEntityCollisionShape( obj->name() + "/CollShape" ); + if ( obj->entity() ){ + collShape->load( obj->entity() ); + } else { + std::cout << "OpcodeCollisionDetection::createObject( BaseObject * obj ), no entity defined for obj: " << obj->name(); + } + + collObj = collideInSectorContext_->createObject( obj->name() + "/CollObj" ); + collObj->setCollClass( collisionManager_->queryCollClass( obj->collisionClass() ) ); + collObj->setShape( collShape ); + + collObj->setClientData( obj ); + collideInSectorContext_->addObject( collObj ); + + obj->setCollisionObject( collObj ); + } + } +} + +void OpcodeCollisionDetection::destroyObject( BaseObject * obj ){ + + if ( obj && active_ ){ + destroy( obj->collisionObject() ); + obj->setCollisionObject( NULL ); + } +} + +void OpcodeCollisionDetection::detach( BaseObject * obj ){ + if ( obj && active_ ){ + destroyObject( obj ); + } +} + +void OpcodeCollisionDetection::attach( BaseObject * obj ){ + if ( obj && active_ ){ + createObject( obj ); + } +} + bool OpcodeCollisionDetection::checkCollideRay( BaseObject * obj, const Ogre::Ray & ray, double rayLength){ if ( active_ ){ if ( !obj->isSetDestroyRequest() ){ Modified: trunk/src/OpcodeWrapper.h =================================================================== --- trunk/src/OpcodeWrapper.h 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/OpcodeWrapper.h 2009-01-19 23:13:32 UTC (rev 950) @@ -29,23 +29,33 @@ public: OpcodeCollisionDetection( ResourceManager * resources = NULL ); - ~OpcodeCollisionDetection(); + ~OpcodeCollisionDetection(); - void init( Ogre::SceneManager * sceneMgr ); + /*! Initialize resources for OpcodeCollisionDetection. opposite to free.*/ + void init( Ogre::SceneManager * sceneMgr ); - void free(); + /*! Free resources for OpcodeCollisionDetection. opposite to init.*/ + void free(); - bool update( Ogre::Real elapsedTime ); + /*! Update loop, check for collisions */ + bool update( Ogre::Real elapsedTime ); + + /*! Utility method to check if there is a collision of the object with a given ray */ + bool checkCollideRay( SectorCollisionObject * obj, const Ogre::Ray & ray, double rayLength ); - /*! Deregister and destroy CollisionObject */ - void destroyObject( OgreOpcode::CollisionObject * obj ); - /*! Create and register SectorCollisionObject */ - void createObject( SectorCollisionObject * obj ); - - /*! Check if there is a collision of the object with a given ray */ - bool checkCollideRay( SectorCollisionObject * obj, const Ogre::Ray & ray, double rayLength ); + void create( SectorCollisionObject * obj ); + /*! Create and register SectorCollisionObject */ + void destroy( SectorCollisionObject * obj ); + + /*! Deregister and destroy CollisionObject */ + void destroy( OgreOpcode::CollisionObject * obj ); + + /*! Write some debug infos about all collision objects to stdout*/ + void info( ); + + /*! DEPRECATED */ void createObject( BaseObject * obj ); @@ -61,14 +71,10 @@ /*! DEPRECATED */ bool checkCollideRay( BaseObject * obj, const Ogre::Ray & ray, double rayLength ); - /*! Write some debug infos about all collision objects to stdout*/ - void info( ); - protected: - OgreOpcode::CollisionContext * collideInSectorContext_; - OgreOpcode::CollisionManager * collisionManager_; - bool active_; - + OgreOpcode::CollisionContext * collideInSectorContext_; + OgreOpcode::CollisionManager * collisionManager_; + bool active_; }; Modified: trunk/src/Opengate.h =================================================================== --- trunk/src/Opengate.h 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/Opengate.h 2009-01-19 23:13:32 UTC (rev 950) @@ -35,12 +35,14 @@ namespace OpenGate{ -#define SECTORBASEOBJECT_RTTI 1 -#define SECTORCOLLISIONOBJECT_RTTI 3 -#define SECTORMESHOBJECT_RTTI 4 -#define SECTORMOVABLEOBJECT_RTTI 5 -#define SECTORVESSELOBJECT_RTTI 6 -#define SECTORAVATAROBJECT_RTTI 7 +#define SECTOR_AVATAR_OBJECT_RTTI 1 +#define SECTOR_BASE_OBJECT_RTTI 2 +#define SECTOR_BEACON_OBJECT_RTTI 3 +#define SECTOR_COLLISION_OBJECT_RTTI 4 +#define SECTOR_MESH_OBJECT_RTTI 5 +#define SECTOR_MOVABLE_OBJECT_RTTI 6 +#define SECTOR_STATION_OBJECT_RTTI 7 +#define SECTOR_VESSEL_OBJECT_RTTI 8 #define SECTOROBJECTENVIRONMENT_RTTI 1000010 #define PROJECTILE_RTTI 100001 @@ -74,9 +76,11 @@ class Sector; class SectorAvatarObject; class SectorBaseObject; +class SectorBeaconObject; class SectorCollisionObject; class SectorMeshObject; class SectorMovableObject; +class SectorStationObject; class SectorVesselObject; class SectorObject; Modified: trunk/src/Sector.cpp =================================================================== --- trunk/src/Sector.cpp 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/Sector.cpp 2009-01-19 23:13:32 UTC (rev 950) @@ -25,12 +25,15 @@ #include "commonWithOgre.h" #include "Avatar.h" +#include "EntityManager.h" #include "LogManager.h" #include "OpcodeWrapper.h" #include "ResourceManager.h" #include "SectorAvatarObject.h" +#include "SectorBeaconObject.h" #include "SectorCollisionObject.h" #include "SectorMeshObject.h" +#include "SectorStationObject.h" #include <OgreEntity.h> @@ -99,21 +102,23 @@ pElem = hRoot.ChildElement( "station", 0 ).Element(); if ( pElem ){ -// std::string name; readXMLAttribute < std::string >( pElem, "name", name ); -// Ogre::Vector3 pos( readXMLVec3Element( pElem, "position" ) ); -// Ogre::Quaternion rot( readXMLQuatElement( pElem, "orientation" ) ); -// SectorObject *obj = createStation( name, pos ); -// if ( rot != Ogre::Quaternion::ZERO ) obj->rotNode()->setOrientation( rot ); + std::string name; readXMLAttribute < std::string >( pElem, "name", name ); + Ogre::Vector3 pos( readXMLVec3Element( pElem, "position" ) ); + Ogre::Quaternion rot( readXMLQuatElement( pElem, "orientation" ) ); + SectorMeshObject *obj = createStation( name ); + if ( pos != Ogre::Vector3::ZERO ) obj->mainNode()->setPosition( pos ); + if ( rot != Ogre::Quaternion::ZERO ) obj->rotNode()->setOrientation( rot ); } pElem = hRoot.ChildElement( "beacon", 0 ).Element(); if ( pElem ){ - Ogre::Vector3 pos( readXMLVec3Element( pElem, "position" ) ); - Ogre::Vector3 dir( readXMLVec3Element( pElem, "direction" ) ); - Ogre::Quaternion rot( readXMLQuatElement( pElem, "orientation" ) ); -// SectorObject * obj = createBeacon( pos ); -// obj->mainNode()->setDirection( dir ); -// if ( rot != Ogre::Quaternion::ZERO ) obj->rotNode()->setOrientation( rot ); + Ogre::Vector3 pos( readXMLVec3Element( pElem, "position" ) ); + Ogre::Vector3 dir( readXMLVec3Element( pElem, "direction" ) ); + Ogre::Quaternion rot( readXMLQuatElement( pElem, "orientation" ) ); + SectorMeshObject * obj = createBeacon( ); + if ( pos != Ogre::Vector3::ZERO ) obj->mainNode()->setPosition( pos ); + if ( dir != Ogre::Vector3::ZERO ) obj->mainNode()->setDirection( dir ); + if ( rot != Ogre::Quaternion::ZERO ) obj->rotNode()->setOrientation( rot ); } for ( pElem = hRoot.FirstChild( "sectorobject" ).Element(); pElem != 0; pElem = pElem->NextSiblingElement("sectorobject") ) { @@ -127,9 +132,9 @@ if ( pElemChild ){ std::string mesh; readXMLAttribute < std::string >( pElemChild, "meshFile", mesh ); SectorMeshObject * obj = createMeshObject( name, mesh ); - if ( pos != Ogre::Vector3::ZERO ) obj->mainNode()->setPosition( pos ); - // if ( scale != Ogre::Vector3::ZERO ) obj->scale( scale ); - if ( rot != Ogre::Quaternion::ZERO ) obj->rotNode()->setOrientation( rot ); + if ( pos != Ogre::Vector3::ZERO ) obj->mainNode()->setPosition( pos ); + if ( scale != Ogre::Vector3::ZERO ) obj->scaleNode()->scale( scale ); + if ( rot != Ogre::Quaternion::ZERO ) obj->rotNode()->setOrientation( rot ); int nSubEnt = 0; readXMLAttribute < int >( pElemChild, "numSubEntities", nSubEnt ); for ( int i = 0; i < nSubEnt; i ++ ){ @@ -156,6 +161,24 @@ return obj; } +SectorMeshObject * Sector::createBeacon( ){ + SectorMeshObject * obj = new SectorBeaconObject( this->name() + "/Beacon", this ); + sectorObjects_.insert( obj ); + return obj; +} + +SectorMeshObject * Sector::createStation( const Ogre::String & stationName ){ + Station * station = ResourceManager::getSingleton().entityManager->station( stationName ); + SectorMeshObject * obj = NULL; + + if ( station ){ + obj = new SectorStationObject( station, this ); + sectorObjects_.insert( obj ); + sectorStations_.insert( dynamic_cast< SectorStationObject * >( obj ) ); + } + return obj; +} + void Sector::createAvatarObject( Avatar & avatar ){ log_->info( std::string( "Sector::createAvatarObject: " ) + avatar.name() ); avatar_ = new SectorAvatarObject( avatar.name(), this, avatar.vessel() ); Modified: trunk/src/Sector.h =================================================================== --- trunk/src/Sector.h 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/Sector.h 2009-01-19 23:13:32 UTC (rev 950) @@ -62,6 +62,12 @@ /*! Create a mesh within the sector, without any specialization */ SectorMeshObject * createMeshObject( const std::string & name, const std::string & meshname ); + /*! Create a beacon within the sector */ + SectorMeshObject * createBeacon( ); + + /*! Create a station within the sector */ + SectorMeshObject * createStation( const Ogre::String & stationName ); + /*! Return handle to the avatarObject */ inline SectorAvatarObject * avatarObject() { return avatar_; } @@ -81,6 +87,9 @@ /*! Hold all stuff that makes the sector looking nice */ //std::set< SectorEnvironmentObject * > sectorEnvironment_; + /*! Hold all stuff that makes the sector looking nice */ + std::set< SectorStationObject * > sectorStations_; + std::map< std::string, std::deque< SectorCollisionObject * > > objectHeap_; }; @@ -215,7 +224,7 @@ std::map< long, SectorObjectMovable * > movableObjects_; std::map< long, SectorObjectMissile * > localAiObjects_; - + float avatarDeathSequenceTime_; bool radar_ ; Modified: trunk/src/SectorAvatarObject.cpp =================================================================== --- trunk/src/SectorAvatarObject.cpp 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/SectorAvatarObject.cpp 2009-01-19 23:13:32 UTC (rev 950) @@ -47,8 +47,7 @@ } void SectorAvatarObject::collide( SectorCollisionObject * object ){ - std::cout << "SectorAvatarObject: " << this->name() << " collide with " - << object->rtti() << " " << object->name() << std::endl; + SectorMovableObject::collide( object ); } bool SectorAvatarObject::update( Ogre::Real elapsedTime ){ Modified: trunk/src/SectorAvatarObject.h =================================================================== --- trunk/src/SectorAvatarObject.h 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/SectorAvatarObject.h 2009-01-19 23:13:32 UTC (rev 950) @@ -36,7 +36,7 @@ virtual ~SectorAvatarObject( ); /*! Abstract method for runtime identification */ - virtual int rtti( ) const { return SECTORAVATAROBJECT_RTTI; } + virtual int rtti( ) const { return SECTOR_AVATAR_OBJECT_RTTI; } virtual bool update( Ogre::Real elapsedTime ); Added: trunk/src/SectorBeaconObject.cpp =================================================================== --- trunk/src/SectorBeaconObject.cpp (rev 0) +++ trunk/src/SectorBeaconObject.cpp 2009-01-19 23:13:32 UTC (rev 950) @@ -0,0 +1,72 @@ +/*************************************************************************** + * Copyright (C) 2009 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "SectorBeaconObject.h" + +#include "LogManager.h" +#include "ResourceManager.h" +#include "Sector.h" + +#include <OgreEntity.h> +#include <OgreSceneManager.h> +#include <OgreSceneNode.h> +#include <OgreSubEntity.h> + +namespace OpenGate{ + +SectorBeaconObject::SectorBeaconObject( const std::string & name, Sector * sector, Ogre::SceneNode * parentNode ) + : SectorMeshObject( name, sector, parentNode ) { + this->setMesh( "beacon.mesh" ); + + entityScaleNode_->scale( 20.0, 20.0, 20.0 ); + + for ( uint i = 0; i < entity()->getNumSubEntities(); i ++ ){ + std::cout << entity()->getSubEntity( i )->getMaterialName() << " Techniques: " + << entity()->getSubEntity( i )->getMaterial()->getNumTechniques() << " used: " + << entity()->getSubEntity( i )->getTechnique()->getName() << std::endl; + + if ( entity()->getSubEntity( i )->getMaterialName() == "beacon/bg" ){ + entity()->getSubEntity( i )->setMaterialName( "Sta/TS/Background" ); + } + + if ( entity()->getSubEntity( i )->getMaterialName() == "beacon/pad_mount_0" ){ + entity()->getSubEntity( i )->setMaterialName( "singleColor" ); + entity()->getSubEntity( i )->setCustomParameter( 0, Ogre::Vector4( 0.5, 0.5, 0.5, 1.0 ) ); +// entryPad_ = new BeaconPad( "EntryPad", this, entity()->getSubEntity( i ) ); +// entryPad_->changeEntity( "beacon_pad.mesh" ); +// entryPad_->entity()->setMaterialName( "singleColor" ); +// entryPad_->entity()->getSubEntity( 0 )->setCustomParameter( 0, Ogre::Vector4( 0.8, 0.0, 0.0, 0.2 ) ); + } + if ( entity()->getSubEntity( i )->getMaterialName() == "beacon/pad_mount_1" ){ + entity()->getSubEntity( i )->setMaterialName( "singleColor" ); + entity()->getSubEntity( i )->setCustomParameter( 0, Ogre::Vector4( 0.5, 0.5, 0.5, 1.0 ) ); +// exitPad_ = new BeaconPad( "ExitPad", this, entity()->getSubEntity( i ) ); +// exitPad_->changeEntity( "beacon_pad.mesh" ); +// exitPad_->entity()->setMaterialName( "singleColor" ); +// exitPad_->entity()->getSubEntity( 0 )->setCustomParameter( 0, Ogre::Vector4( 0.8, 0.0, 0.0, 0.2 ) ); + } + } +} + +SectorBeaconObject::~SectorBeaconObject( ){ + +} + +} Added: trunk/src/SectorBeaconObject.h =================================================================== --- trunk/src/SectorBeaconObject.h (rev 0) +++ trunk/src/SectorBeaconObject.h 2009-01-19 23:13:32 UTC (rev 950) @@ -0,0 +1,51 @@ +/*************************************************************************** + * Copyright (C) 2009 by OpenGate development team * + * spo...@us... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef _OPENGATE_SECTORBEACONOBJECT__H +#define _OPENGATE_SECTORBEACONOBJECT__H + +#include "Opengate.h" + +#include "SectorMeshObject.h" + +namespace OpenGate{ + +/*! A Beacon object */ +class SectorBeaconObject : public SectorMeshObject { +public: + /*! Construct the Beacon */ + SectorBeaconObject( const std::string & name, Sector * sector, Ogre::SceneNode * parentNode = NULL ); + + /*! Default destructor */ + virtual ~SectorBeaconObject( ); + + /*! Abstract method for runtime identification */ + virtual int rtti( ) const { return SECTOR_BEACON_OBJECT_RTTI; } + + /*! Update function */ + virtual bool update( Ogre::Real elapsedTime ) { return true; } + +protected: + +}; + +} //namespace OpenGate + +#endif //_OPENGATE_SECTORBEACONOBJECT__H Modified: trunk/src/SectorCollisionObject.h =================================================================== --- trunk/src/SectorCollisionObject.h 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/SectorCollisionObject.h 2009-01-19 23:13:32 UTC (rev 950) @@ -36,7 +36,7 @@ virtual ~SectorCollisionObject( ); /*! Abstract method for runtime identification */ - virtual int rtti( ) const { return SECTORCOLLISIONOBJECT_RTTI; } + virtual int rtti( ) const { return SECTOR_COLLISION_OBJECT_RTTI; } /*! Abstract update function */ virtual bool update( Ogre::Real elapsedTime ) = 0; @@ -49,7 +49,7 @@ inline void setCollisionObject( OgreOpcode::CollisionObject * obj ){ collObj_ = obj; } /*! Return a ptr to the collisionObject.*/ - inline OgreOpcode::CollisionObject * pCollisionObject( ){ return collObj_; } + inline OgreOpcode::CollisionObject * collisionObject( ){ return collObj_; } /*! Return the type of the collisionObject, That determines the kind of collision detection.*/ inline virtual std::string collisionClass() const { return "SectorObject"; } Modified: trunk/src/SectorMeshObject.cpp =================================================================== --- trunk/src/SectorMeshObject.cpp 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/SectorMeshObject.cpp 2009-01-19 23:13:32 UTC (rev 950) @@ -41,7 +41,7 @@ SectorMeshObject::~SectorMeshObject( ){ if ( ResourceManager::getSingleton().collisionManager ){ - ResourceManager::getSingleton().collisionManager->destroyObject( collObj_ ); + ResourceManager::getSingleton().collisionManager->destroy( collObj_ ); } if ( entity_ ) sector_->sceneManager()->destroyEntity( entity_ ); entityRotNode_->detachAllObjects(); @@ -70,7 +70,7 @@ entityRotNode_->attachObject( entity_ ); if ( ResourceManager::getSingleton().collisionManager ){ - ResourceManager::getSingleton().collisionManager->createObject( this ); + ResourceManager::getSingleton().collisionManager->create( this ); } } Modified: trunk/src/SectorMeshObject.h =================================================================== --- trunk/src/SectorMeshObject.h 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/SectorMeshObject.h 2009-01-19 23:13:32 UTC (rev 950) @@ -36,7 +36,7 @@ virtual ~SectorMeshObject( ); /*! Abstract method for runtime identification */ - virtual int rtti( ) const { return SECTORMESHOBJECT_RTTI; } + virtual int rtti( ) const { return SECTOR_MESH_OBJECT_RTTI; } /*! Update function */ virtual bool update( Ogre::Real elapsedTime ) { return true; } @@ -64,10 +64,6 @@ Ogre::SceneNode * entityRotNode_; // Main character node for base rotation }; - class SectorStationObject : public SectorMeshObject{ - }; - class SectorBeaconObject : public SectorMeshObject{ - }; class SectorAsteroidObject : public SectorMeshObject{ }; class SectorAnomalieObject : public SectorMeshObject{ Modified: trunk/src/SectorMovableObject.cpp =================================================================== --- trunk/src/SectorMovableObject.cpp 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/SectorMovableObject.cpp 2009-01-19 23:13:32 UTC (rev 950) @@ -55,22 +55,40 @@ interpolateRot_ = Ogre::Quaternion::ZERO; interpolateVel_ = Ogre::Vector3::ZERO; - brakePressed_ = false;; + brakePressed_ = false; + afterburnerPressed_ = false; + lifeTime_ = 0.0; + speed_ = 0.0; + maxSpeed_ = movable_->maxSpeed(); + thrustRate_ = 0.0; - lifeTime_ = 0.0; - speed_ = 0.0; - maxSpeed_ = movable_->maxSpeed(); - thrustRate_ = 0.0; - - thrust_ = 0; - mass_ = movable_->mass(); - armor_ = movable_->armor(); - shield_ = 0; + thrust_ = 0; + mass_ = movable_->mass(); + armor_ = movable_->armor(); + shield_ = 0; } -void SectorMovableObject::collide( SectorCollisionObject * object ){ +void SectorMovableObject::collide( SectorCollisionObject * obj ){ std::cout << "SectorMovableObject: " << this->name() << " collide with " - << object->rtti() << " " << object->name() << std::endl; + << obj->rtti() << " " << obj->name() << std::endl; + + if ( this != obj ){ + switch( obj->rtti( ) ){ + case SECTOR_AVATAR_OBJECT_RTTI: + case SECTOR_BEACON_OBJECT_RTTI: + case SECTOR_MESH_OBJECT_RTTI: + case SECTOR_MOVABLE_OBJECT_RTTI: + case SECTOR_STATION_OBJECT_RTTI: + case SECTOR_VESSEL_OBJECT_RTTI: + vel_ *= -1.0; + mainNode_->translate( ( mainNode_->getPosition() - + obj->mainNode()->getPosition() ).normalisedCopy() * 3.0 ); + break; +// case SECTOROBJECTMISSILE_RTTI: +// hitByAmmo( dynamic_cast < SectorObjectMissile *>( obj )->missile()->damage() ); +// break; + } + } } bool SectorMovableObject::update( Ogre::Real elapsedTime ){ @@ -116,9 +134,10 @@ vel_ += acc_ * elapsedTime; speed_ = vel_.length(); - if ( speed_ > movable_->maxSpeed() ){ - vel_ *= movable_->maxSpeed() / speed_; - } else if ( speed_ < 0.01 ){ +// if ( speed_ > movable_->maxSpeed() && !afterburnerPressed_ ){ +// vel_ *= movable_->maxSpeed() / speed_; +// } else + if ( speed_ < 0.01 ){ vel_ *= 0.0; } Modified: trunk/src/SectorMovableObject.h =================================================================== --- trunk/src/SectorMovableObject.h 2009-01-19 21:37:39 UTC (rev 949) +++ trunk/src/SectorMovableObject.h 2009-01-19 23:13:32 UTC (rev 950) @@ -38,7 +38,7 @@ virtual ~SectorMovableObject( ); /*! Abstract method for runtime identification */ - virtual int rtti( ) const { return SECTORMOVABLEOBJECT_RTTI; } + virtual int rtti( ) const { return SECTOR_MOVABLE_OBJECT_RTTI; } virtual bool update( Ogre::Real elapsedTime ); @@ -94,11 +94,17 @@ inline Ogre::Real brakingAcc(){ return 5.0; } /*! Set the brake key top be pressed or released */ - void setBrakePressed( bool pressed ) { brakePressed_ = pressed; } + inline void setBrakePressed( bool pressed ) { if ( pressed ) thrustRate_ = 0.0; brakePressed_ = pressed; } /*! Return if brake key pressed */ - bool brakePressed( ) const { return brakePressed_; } - + inline bool brakePressed( ) const { return brakePressed_; } + + /*! Afterburner pressed */ + inline void setAfterburnerPressed( bool pressed ){ if ( pressed ) thrustRate_ = 1.0; afterburnerPressed_ = pressed; } + + /*! Return the afterburner key status */ + inline bool afterburnerPressed( ) const { return afterburnerPressed_; } + /*! Reset all values for this object. */ virtual void reset( ); @@ -122,6 +128,7 @@ Ogre::Vector3 interpolateVel_; bool brakePressed_; + bool ... [truncated message content] |