diff --git a/code/nel/include/nel/3d/stereo_display.h b/code/nel/include/nel/3d/stereo_display.h index 3b9c73b74..570a62739 100644 --- a/code/nel/include/nel/3d/stereo_display.h +++ b/code/nel/include/nel/3d/stereo_display.h @@ -60,6 +60,7 @@ public: { StereoDisplay, StereoHMD, + StereoNGHMD, }; enum TStereoDeviceLibrary diff --git a/code/nel/include/nel/3d/stereo_ng_hmd.h b/code/nel/include/nel/3d/stereo_ng_hmd.h new file mode 100644 index 000000000..1ab8ad144 --- /dev/null +++ b/code/nel/include/nel/3d/stereo_ng_hmd.h @@ -0,0 +1,62 @@ +/** + * \file stereo_ng_hmd.h + * \brief IStereoNGHMD + * \date 2014-04-01 10:53GMT + * \author Jan Boon (Kaetemi) + * IStereoNGHMD + */ + +/* + * Copyright (C) 2014 by authors + * + * This file is part of NL3D. + * NL3D is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * NL3D 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 Affero General + * Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with NL3D. If not, see + * . + */ + +#ifndef NL3D_STEREO_NG_HMD_H +#define NL3D_STEREO_NG_HMD_H +#include + +// STL includes + +// NeL includes + +// Project includes +#include + +namespace NL3D { + +/** + * \brief IStereoNGHMD + * \date 2014-04-01 10:53GMT + * \author Jan Boon (Kaetemi) + * IStereoNGHMD + */ +class IStereoNGHMD : public IStereoHMD +{ +public: + IStereoNGHMD(); + virtual ~IStereoNGHMD(); + + /// Kill the player + virtual void killUser() const = 0; + +}; /* class IStereoNGHMD */ + +} /* namespace NL3D */ + +#endif /* #ifndef NL3D_STEREO_NG_HMD_H */ + +/* end of file */ diff --git a/code/nel/src/3d/CMakeLists.txt b/code/nel/src/3d/CMakeLists.txt index fff343915..d614029f7 100644 --- a/code/nel/src/3d/CMakeLists.txt +++ b/code/nel/src/3d/CMakeLists.txt @@ -697,6 +697,8 @@ SOURCE_GROUP(Stereo FILES ../../include/nel/3d/stereo_display.h stereo_hmd.cpp ../../include/nel/3d/stereo_hmd.h + stereo_ng_hmd.cpp + ../../include/nel/3d/stereo_ng_hmd.h stereo_ovr.cpp stereo_ovr_fp.cpp ../../include/nel/3d/stereo_ovr.h diff --git a/code/nel/src/3d/stereo_ng_hmd.cpp b/code/nel/src/3d/stereo_ng_hmd.cpp new file mode 100644 index 000000000..1011b33e4 --- /dev/null +++ b/code/nel/src/3d/stereo_ng_hmd.cpp @@ -0,0 +1,55 @@ +/** + * \file stereo_hmd.cpp + * \brief IStereoNGHMD + * \date 2014-04-01 10:53GMT + * \author Jan Boon (Kaetemi) + * IStereoNGHMD + */ + +/* + * Copyright (C) 2014 by authors + * + * This file is part of NL3D. + * NL3D is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * NL3D 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 Affero General + * Public License for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with NL3D. If not, see + * . + */ + +#include +#include + +// STL includes + +// NeL includes +// #include + +// Project includes + +using namespace std; +// using namespace NLMISC; + +namespace NL3D { + +IStereoNGHMD::IStereoNGHMD() +{ + +} + +IStereoNGHMD::~IStereoNGHMD() +{ + +} + +} /* namespace NL3D */ + +/* end of file */ diff --git a/code/ryzom/client/src/global.cpp b/code/ryzom/client/src/global.cpp index c965db43f..ac15aafbc 100644 --- a/code/ryzom/client/src/global.cpp +++ b/code/ryzom/client/src/global.cpp @@ -28,6 +28,7 @@ using namespace NLMISC; NL3D::UDriver *Driver = 0; // The main 3D Driver NL3D::IStereoDisplay *StereoDisplay = NULL; // Stereo display NL3D::IStereoHMD *StereoHMD = NULL; // Head mount display +NL3D::IStereoNGHMD *StereoNGHMD = NULL; // HMD with player death support CSoundManager *SoundMngr = 0; // the sound manager NL3D::UMaterial GenericMat; // Generic Material NL3D::UTextContext *TextContext = 0; // Context for all the text in the client. diff --git a/code/ryzom/client/src/global.h b/code/ryzom/client/src/global.h index 5879eeaec..28f98a3a9 100644 --- a/code/ryzom/client/src/global.h +++ b/code/ryzom/client/src/global.h @@ -42,6 +42,7 @@ namespace NL3D class UWaterEnvMap; class IStereoDisplay; class IStereoHMD; + class IStereoNGHMD; } class CEntityAnimationManager; @@ -81,6 +82,7 @@ const float ExtraZoneLoadingVision = 100.f; extern NL3D::UDriver *Driver; // The main 3D Driver extern NL3D::IStereoDisplay *StereoDisplay; // Stereo display extern NL3D::IStereoHMD *StereoHMD; // Head mount display +extern NL3D::IStereoNGHMD *StereoNGHMD; // HMD with player death support extern CSoundManager *SoundMngr; // the sound manager extern NL3D::UMaterial GenericMat; // Generic Material extern NL3D::UTextContext *TextContext; // Context for all the text in the client. diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index d603be4a3..d0a64b0a4 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -40,6 +40,7 @@ #include "nel/3d/u_text_context.h" #include "nel/3d/u_shape_bank.h" #include "nel/3d/stereo_hmd.h" +#include "nel/3d/stereo_ng_hmd.h" // Net. #include "nel/net/email.h" // Ligo. @@ -639,10 +640,15 @@ void initStereoDisplayDevice() StereoDisplay = IStereoDisplay::createDevice(*deviceInfo); if (StereoDisplay) { - if (deviceInfo->Class == CStereoDeviceInfo::StereoHMD) + if (deviceInfo->Class == CStereoDeviceInfo::StereoHMD + || deviceInfo->Class == CStereoDeviceInfo::StereoNGHMD) { nlinfo("VR [C]: Stereo display device is a HMD"); StereoHMD = static_cast(StereoDisplay); + if (deviceInfo->Class == CStereoDeviceInfo::StereoNGHMD) + { + StereoNGHMD = static_cast(StereoDisplay); + } } if (Driver) // VR_DRIVER { diff --git a/code/ryzom/client/src/motion/modes/death_mode.cpp b/code/ryzom/client/src/motion/modes/death_mode.cpp index cd987b635..4e39f394f 100644 --- a/code/ryzom/client/src/motion/modes/death_mode.cpp +++ b/code/ryzom/client/src/motion/modes/death_mode.cpp @@ -21,6 +21,9 @@ // INCLUDES // ////////////// #include "stdpch.h" + +#include "nel/3d/stereo_ng_hmd.h" + // Client. #include "../../input.h" #include "../user_controls.h" @@ -28,6 +31,7 @@ #include "../../view.h" #include "../../interface_v3/interface_manager.h" #include "../../entities.h" +#include "global.h" /////////// @@ -61,6 +65,9 @@ void CUserControls::deathModeStart() _InternalView = false; // Show/hide all or parts of the user body (after _InternaView is set). UserEntity->updateVisualDisplay(); + // Kill the player + if (StereoNGHMD) + StereoNGHMD->killUser(); }// deathModeStart // //----------------------------------------------- diff --git a/code/ryzom/client/src/release.cpp b/code/ryzom/client/src/release.cpp index b40d68b35..b8f34c277 100644 --- a/code/ryzom/client/src/release.cpp +++ b/code/ryzom/client/src/release.cpp @@ -519,6 +519,7 @@ void releaseStereoDisplayDevice() delete StereoDisplay; StereoDisplay = NULL; StereoHMD = NULL; + StereoNGHMD = NULL; } IStereoDisplay::releaseAllLibraries(); }