Răsfoiți Sursa

float consts

cxgeorge 24 ani în urmă
părinte
comite
4a1632d011

+ 1 - 1
panda/src/gobj/geomLine.h

@@ -28,7 +28,7 @@
 class EXPCL_PANDA GeomLine : public Geom
 {
 public:
-  GeomLine( void ) : Geom() { _width = 1.0; }
+  GeomLine( void ) : Geom() { _width = 1.0f; }
   virtual Geom *make_copy() const;
   virtual void print_draw_immediate( void ) const { }
   virtual void draw_immediate(GraphicsStateGuardianBase *gsg, GeomContext *gc);

+ 1 - 1
panda/src/gobj/geomLinestrip.h

@@ -28,7 +28,7 @@
 class EXPCL_PANDA GeomLinestrip : public Geom
 {
 public:
-  GeomLinestrip(void) : Geom() { _width = 1.0; }
+  GeomLinestrip(void) : Geom() { _width = 1.0f; }
   virtual Geom *make_copy() const;
   virtual void print_draw_immediate( void ) const { }
   virtual void draw_immediate(GraphicsStateGuardianBase *gsg, GeomContext *gc);

+ 1 - 1
panda/src/gobj/geomPoint.h

@@ -27,7 +27,7 @@
 ////////////////////////////////////////////////////////////////////
 class EXPCL_PANDA GeomPoint : public Geom {
 public:
-  GeomPoint() : Geom() { _size = 1.0; }
+  GeomPoint() : Geom() { _size = 1.0f; }
   virtual Geom *make_copy() const;
 
   virtual void print_draw_immediate() const;

+ 2 - 2
panda/src/gobj/geomSprite.cxx

@@ -39,8 +39,8 @@ GeomSprite::
 GeomSprite(Texture *tex, bool alpha_disable) :
   _texture(tex), _alpha_disable(alpha_disable) 
 {
-  _ll_uv.set(0.0, 0.0);
-  _ur_uv.set(1.0, 1.0);
+  _ll_uv.set(0.0f, 0.0f);
+  _ur_uv.set(1.0f, 1.0f);
   _x_texel_ratio.clear();
   _y_texel_ratio.clear();
 

+ 1 - 1
panda/src/gobj/orthoProjection.h

@@ -37,7 +37,7 @@ public:
   virtual Projection *make_copy() const;
   virtual LMatrix4f get_projection_mat(CoordinateSystem cs = CS_default) const;
 
-  virtual Geom* make_geometry(const Colorf &color = Colorf(0.0, 1.0, 0.0, 1.0),
+  virtual Geom* make_geometry(const Colorf &color = Colorf(0.0f, 1.0f, 0.0f, 1.0f),
                               CoordinateSystem cs = CS_default) const;
 
   virtual BoundingVolume *make_bounds(CoordinateSystem cs = CS_default) const;

+ 6 - 6
panda/src/gobj/perspectiveProjection.cxx

@@ -165,9 +165,9 @@ extrude(const LPoint2f &point2d, LPoint3f &origin, LVector3f &direction,
 
   // Scale the point from (-1,1) to the range of the frustum.
 
-  LPoint2f scaled(_frustum._l + 0.5 * (point2d[0] + 1.0) *
+  LPoint2f scaled(_frustum._l + 0.5f * (point2d[0] + 1.0f) *
                   (_frustum._r - _frustum._l),
-                  _frustum._b + 0.5 * (point2d[1] + 1.0) *
+                  _frustum._b + 0.5f * (point2d[1] + 1.0f) *
                   (_frustum._t - _frustum._b));
 
   LVector3f near_vector =
@@ -211,9 +211,9 @@ project(const LPoint3f &point3d, LPoint2f &point2d,
     return false;
   }
 
-  point2d.set((scaled[0] - _frustum._l) * 2.0 /
-              (_frustum._r - _frustum._l) - 1.0,
-              (scaled[1] - _frustum._b) * 2.0 /
-              (_frustum._t - _frustum._b) - 1.0);
+  point2d.set((scaled[0] - _frustum._l) * 2.0f /
+              (_frustum._r - _frustum._l) - 1.0f,
+              (scaled[1] - _frustum._b) * 2.0f /
+              (_frustum._t - _frustum._b) - 1.0f);
   return true;
 }

+ 1 - 1
panda/src/gobj/perspectiveProjection.h

@@ -37,7 +37,7 @@ public:
   virtual Projection *make_copy() const;
   virtual LMatrix4f get_projection_mat(CoordinateSystem cs = CS_default) const;
 
-  virtual Geom* make_geometry(const Colorf &color = Colorf(0.0, 1.0, 0.0, 1.0),
+  virtual Geom* make_geometry(const Colorf &color = Colorf(0.0f, 1.0f, 0.0f, 1.0f),
                               CoordinateSystem cs = CS_default) const;
 
   virtual BoundingVolume *make_bounds(CoordinateSystem cs = CS_default) const;