[*] Set float type for constants: less warnings, less type truncations.
authorAlexandr Arutjunov <smal.root@gmail.com>
Sun, 2 Oct 2016 17:00:57 +0000 (20:00 +0300)
committerAlexandr Arutjunov <smal.root@gmail.com>
Sun, 2 Oct 2016 17:00:57 +0000 (20:00 +0300)
code/X3DImporter_Light.cpp
code/X3DImporter_Postprocess.cpp
code/X3DImporter_Shape.cpp

index c297d1b..b6f1eca 100644 (file)
@@ -174,9 +174,9 @@ void X3DImporter::ParseNode_Lighting_SpotLight()
 std::string def, use;
 float ambientIntensity = 0;
 aiVector3D attenuation(1, 0, 0);
-float beamWidth = 0.7854;
+float beamWidth = 0.7854f;
 aiColor3D color(1, 1, 1);
-float cutOffAngle = 1.570796;
+float cutOffAngle = 1.570796f;
 aiVector3D direction(0, 0, -1);
 bool global = true;
 float intensity = 1;
index ba946b9..ddc5aa9 100644 (file)
@@ -167,7 +167,7 @@ void X3DImporter::Postprocess_BuildMaterial(const CX3DImporter_NodeElement& pNod
                        tvalf = 1;
                        taimat.AddProperty(&tvalf, 1, AI_MATKEY_SHININESS_STRENGTH);
                        taimat.AddProperty(&tnemat.Shininess, 1, AI_MATKEY_SHININESS);
-                       tvalf = 1.0 - tnemat.Transparency;
+                       tvalf = 1.0f - tnemat.Transparency;
                        taimat.AddProperty(&tvalf, 1, AI_MATKEY_OPACITY);
                }// if((*el_it)->Type == CX3DImporter_NodeElement::ENET_Material)
                else if((*el_it)->Type == CX3DImporter_NodeElement::ENET_ImageTexture)
index d697f91..c974f70 100644 (file)
@@ -159,10 +159,10 @@ CX3DImporter_NodeElement* ne;
 void X3DImporter::ParseNode_Shape_Material()
 {
 std::string use, def;
-float ambientIntensity = 0.2;
-float shininess = 0.2;
+float ambientIntensity = 0.2f;
+float shininess = 0.2f;
 float transparency = 0;
-aiColor3D diffuseColor(0.8, 0.8, 0.8);
+aiColor3D diffuseColor(0.8f, 0.8f, 0.8f);
 aiColor3D emissiveColor(0, 0, 0);
 aiColor3D specularColor(0, 0, 0);
 CX3DImporter_NodeElement* ne;