Add showcontrollers option (default: do not show controllers)

Fix atomcolour option
parent dcbe34b9
......@@ -47,6 +47,7 @@ Solid *solid;
bool saveStereo;
int screenshotdownscaling;
bool hapticFeedback;
bool showcontrollers;
//markers such as hole positions and electron positions
float ** markers;
......@@ -178,6 +179,7 @@ int loadConfigFile(const char * f)
saveStereo=false;
screenshotdownscaling=1;
hapticFeedback=false;
showcontrollers=false;
//
FILE *F = fopen(f, "r");
if (F == 0)
......@@ -452,7 +454,7 @@ int loadConfigFile(const char * f)
} else if (!strcmp (s, "atomcolour")) {
char atom [100];
float rgb[3];
r = fscanf(F, "%s %f", atom, rgb, rgb + 1, rgb + 2);
r = fscanf(F, "%s %f %f %f", atom, rgb, rgb + 1, rgb + 2);
if (r!=4) {
eprintf ("Error loading atom colour");
return -19;
......@@ -478,6 +480,8 @@ int loadConfigFile(const char * f)
hapticFeedback=true;
} else if (!strcmp (s, "supercell")) {
r=fscanf (F, "%f %f %f", supercell, supercell+1, supercell+2);
} else if (!strcmp (s, "showcontrollers")) {
showcontrollers=true;
} else if (!strcmp (s, "\x0d")) { //discard windows newline (problem in Sebastian Kokott's phone (?!)
continue;
} else {
......
......@@ -43,6 +43,7 @@ extern bool saveStereo;
extern int screenshotdownscaling;
extern bool hapticFeedback;
extern bool showcontrollers;
//markers such as hole positions and electron positions
extern float ** markers;
......
......@@ -23,6 +23,7 @@
<Keyword>Win32Proj</Keyword>
<RootNamespace>hellovr_opengl</RootNamespace>
<ProjectName>NOMADViveT</ProjectName>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
......@@ -49,7 +50,7 @@
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
......@@ -110,7 +111,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;_WINDOWS;INDICESGL32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..;../../headers;../thirdparty/glew/glew-1.11.0/include;../thirdparty/sdl2-2.0.3/include;Y:\v2t\software\rapidjson\include;Y:\v2t\software\curl\include;Y:\v2t\software\openvr\openvr-0.9.19\samples\TimestepData</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..;../../headers;../thirdparty/glew/glew-1.11.0/include;../thirdparty/sdl2-2.0.3/include;Y:\software\rapidjson\include;Y:\software\curl\include;Y:\software\openvr\openvr-0.9.19\samples\TimestepData</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<EnablePREfast>false</EnablePREfast>
</ClCompile>
......@@ -154,7 +155,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;INDICESGL32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<AdditionalIncludeDirectories>..;../../headers;../thirdparty/glew/glew-1.11.0/include;..\thirdparty\sdl2-2.0.3\include;Y:\v2t\software\rapidjson\include;Y:\v2t\software\openvr\openvr-0.9.19\samples\TimestepData</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..;../../headers;../thirdparty/glew/glew-1.11.0/include;..\thirdparty\sdl2-2.0.3\include;Y:\software\rapidjson\include;Y:\software\openvr\openvr-0.9.19\samples\TimestepData;Y:\v2t\software\rapidjson\include;Y:\v2t\software\openvr\openvr-0.9.19\samples\TimestepData</AdditionalIncludeDirectories>
<EnablePREfast>false</EnablePREfast>
</ClCompile>
<Link>
......
......@@ -2350,7 +2350,8 @@ void CMainApplication::RenderScene(vr::Hmd_Eye nEye)
if (ISOS==0) {
RenderAtoms(nEye);
RenderUnitCell(nEye);
RenderAllTrackedRenderModels(nEye);
if (showcontrollers)
RenderAllTrackedRenderModels(nEye);
return;
}
......@@ -2386,7 +2387,8 @@ void CMainApplication::RenderScene(vr::Hmd_Eye nEye)
RenderAtoms(nEye);
RenderUnitCell(nEye);
}
RenderAllTrackedRenderModels(nEye);
if (showcontrollers)
RenderAllTrackedRenderModels(nEye);
} // for zl
glBindFramebuffer(GL_FRAMEBUFFER, dfb);
......@@ -2481,7 +2483,8 @@ void CMainApplication::RenderScene(vr::Hmd_Eye nEye)
glBindTexture(GL_TEXTURE_2D, 0);
glUseProgram(m_unSceneProgramID);
PaintGrid(nEye, currentiso);
RenderAllTrackedRenderModels(nEye);
if (showcontrollers)
RenderAllTrackedRenderModels(nEye);
} //else currentiso =isos
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment