View Issue Details

IDProjectCategoryView StatusLast Update
0001761NoesisGUIC++ SDKpublic2020-07-27 20:21
ReporternikobarliAssigned Tosfernandez 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.0.3 
Target Version3.0.4Fixed in Version3.0.4 
Summary0001761: Compile error due to 'double' to 'float' conversion in VS2019
DescriptionI am not sure if it happens in VS2015, but when building r9469 from branch 3.0 with VS2019, there are several build errors inside OcculusVR project. The errors are due to 'double' to 'float' conversion.

I attached a patch that fixes the errors in my environment.
TagsNo tags attached.
PlatformAny

Activities

nikobarli

nikobarli

2020-07-27 09:59

reporter  

Double2Float.patch (2,083 bytes)
Index: Src/Packages/Samples/OculusVR/Src/Main.cpp
===================================================================
--- Src/Packages/Samples/OculusVR/Src/Main.cpp	(revision 145739)
+++ Src/Packages/Samples/OculusVR/Src/Main.cpp	(working copy)
@@ -292,7 +292,7 @@
             // Animate the cube
             static float cubePositionClock = 0;
             if (sessionStatus.HasInputFocus) // Pause the application if we are not supposed to have input.
-                roomScene->Models[0]->Pos = XMFLOAT3(9 * sin(cubePositionClock), 3, 9 * cos(cubePositionClock += 0.015f));
+                roomScene->Models[0]->Pos = XMFLOAT3(9 * sinf(cubePositionClock), 3, 9 * cosf(cubePositionClock += 0.015f));
             
             // Call ovr_GetRenderDesc each frame to get the ovrEyeRenderDesc, as the returned values (e.g. HmdToEyePose) may change at runtime.
             ovrEyeRenderDesc eyeRenderDesc[2];
Index: Src/Packages/Samples/OculusVR/Src/Win32_DirectXAppUtil.h
===================================================================
--- Src/Packages/Samples/OculusVR/Src/Win32_DirectXAppUtil.h	(revision 145739)
+++ Src/Packages/Samples/OculusVR/Src/Win32_DirectXAppUtil.h	(working copy)
@@ -452,7 +452,7 @@
         for (int k = 0; k < 3; k++)
         {
             float rgb = ((float)((*linear >> (k * 8)) & 0xff)) / 255.0f;
-            rgb = pow(rgb, 2.2f);
+            rgb = powf(rgb, 2.2f);
             drgb[k] = (uint32_t)(rgb * 255.0f);
         }
         *linear = (*linear & 0xff000000) + (drgb[2] << 16) + (drgb[1] << 8) + (drgb[0] << 0);
@@ -658,7 +658,7 @@
 
     uint32_t ModifyColor(uint32_t c, XMFLOAT3 pos)
     {
-        #define GetLengthLocal(v)  (sqrt(v.x*v.x + v.y*v.y + v.z*v.z))
+        #define GetLengthLocal(v)  (sqrtf(v.x*v.x + v.y*v.y + v.z*v.z))
         float dist1 = GetLengthLocal(XMFLOAT3(pos.x - (-2), pos.y - (4), pos.z - (-2)));
         float dist2 = GetLengthLocal(XMFLOAT3(pos.x - (3),  pos.y - (4), pos.z - (-3)));
         float dist3 = GetLengthLocal(XMFLOAT3(pos.x - (-4), pos.y - (3), pos.z - (25)));
Double2Float.patch (2,083 bytes)

Issue History

Date Modified Username Field Change
2020-07-27 09:59 nikobarli New Issue
2020-07-27 09:59 nikobarli File Added: Double2Float.patch
2020-07-27 20:20 sfernandez Assigned To => sfernandez
2020-07-27 20:20 sfernandez Status new => assigned
2020-07-27 20:20 sfernandez Product Version 3.0.4 => 3.0.3
2020-07-27 20:20 sfernandez Target Version => 3.0.4
2020-07-27 20:20 sfernandez Description Updated View Revisions
2020-07-27 20:21 sfernandez Status assigned => resolved
2020-07-27 20:21 sfernandez Resolution open => fixed
2020-07-27 20:21 sfernandez Fixed in Version => 3.0.4