float consts

This commit is contained in:
cxgeorge 2001-11-05 21:54:43 +00:00
parent e85a9b00cc
commit 4a1632d011
7 changed files with 13 additions and 13 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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();

View File

@ -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;

View File

@ -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;
}

View File

@ -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;