diff --git a/panda/src/collide/collisionHandlerFloor.cxx b/panda/src/collide/collisionHandlerFloor.cxx index 5fe7c4a055..257afe1b42 100644 --- a/panda/src/collide/collisionHandlerFloor.cxx +++ b/panda/src/collide/collisionHandlerFloor.cxx @@ -133,7 +133,6 @@ handle_entries() { LVecBase3f pos = trans->get_pos(); pos[2] += adjust; def._node->set_transform(trans->set_pos(pos)); - } else { // Otherwise, go ahead and do the matrix math to do things // the old and clumsy way. diff --git a/panda/src/express/clockObject.I b/panda/src/express/clockObject.I index 71289b93e0..0ff07b45ec 100644 --- a/panda/src/express/clockObject.I +++ b/panda/src/express/clockObject.I @@ -228,7 +228,7 @@ get_global_clock() { // Description: //////////////////////////////////////////////////////////////////// INLINE TimeVal:: -TimeVal(void) { +TimeVal() { } //////////////////////////////////////////////////////////////////// @@ -237,7 +237,7 @@ TimeVal(void) { // Description: //////////////////////////////////////////////////////////////////// INLINE ulong TimeVal:: -get_sec(void) const { +get_sec() const { return tv[0]; } @@ -247,6 +247,6 @@ get_sec(void) const { // Description: //////////////////////////////////////////////////////////////////// INLINE ulong TimeVal:: -get_usec(void) const { +get_usec() const { return tv[1]; } diff --git a/panda/src/express/clockObject.h b/panda/src/express/clockObject.h index 06a3e6534d..89f0d76b97 100644 --- a/panda/src/express/clockObject.h +++ b/panda/src/express/clockObject.h @@ -26,9 +26,9 @@ class EXPCL_PANDAEXPRESS TimeVal { PUBLISHED: - INLINE TimeVal(void); - INLINE ulong get_sec(void) const; - INLINE ulong get_usec(void) const; + INLINE TimeVal(); + INLINE ulong get_sec() const; + INLINE ulong get_usec() const; ulong tv[2]; }; diff --git a/panda/src/physics/linearFrictionForce.I b/panda/src/physics/linearFrictionForce.I index 8cf8b49f53..9ec8ba7087 100644 --- a/panda/src/physics/linearFrictionForce.I +++ b/panda/src/physics/linearFrictionForce.I @@ -22,6 +22,12 @@ //////////////////////////////////////////////////////////////////// INLINE void LinearFrictionForce:: set_coef(float coef) { + // friction shouldn't be outside of [0, 1] + if (coef < 0.0f) { + coef = 0.0f; + } else if (coef > 1.0f) { + coef = 1.0f; + } _coef = coef; } @@ -30,6 +36,6 @@ set_coef(float coef) { // Access : public //////////////////////////////////////////////////////////////////// INLINE float LinearFrictionForce:: -get_coef(void) const { +get_coef() const { return _coef; } diff --git a/panda/src/physics/linearFrictionForce.h b/panda/src/physics/linearFrictionForce.h index b2dd869743..a105264085 100644 --- a/panda/src/physics/linearFrictionForce.h +++ b/panda/src/physics/linearFrictionForce.h @@ -29,10 +29,10 @@ class EXPCL_PANDAPHYSICS LinearFrictionForce : public LinearForce { PUBLISHED: LinearFrictionForce(float coef = 1.0f, float a = 1.0f, bool m = false); LinearFrictionForce(const LinearFrictionForce ©); - virtual ~LinearFrictionForce(void); + virtual ~LinearFrictionForce(); INLINE void set_coef(float coef); - INLINE float get_coef(void) const; + INLINE float get_coef() const; virtual void output(ostream &out) const; virtual void write(ostream &out, unsigned int indent=0) const; @@ -40,19 +40,19 @@ PUBLISHED: private: float _coef; - virtual LinearForce *make_copy(void); + virtual LinearForce *make_copy(); virtual LVector3f get_child_vector(const PhysicsObject *); public: - static TypeHandle get_class_type(void) { + static TypeHandle get_class_type() { return _type_handle; } - static void init_type(void) { + static void init_type() { LinearForce::init_type(); register_type(_type_handle, "LinearFrictionForce", LinearForce::get_class_type()); } - virtual TypeHandle get_type(void) const { + virtual TypeHandle get_type() const { return get_class_type(); } virtual TypeHandle force_init_type() {init_type(); return get_class_type();} diff --git a/panda/src/physics/physicsObject.cxx b/panda/src/physics/physicsObject.cxx index dfaa24602d..65e0732546 100644 --- a/panda/src/physics/physicsObject.cxx +++ b/panda/src/physics/physicsObject.cxx @@ -97,7 +97,7 @@ make_copy() const { LMatrix4f PhysicsObject:: get_lcs() const { LMatrix4f m = LMatrix4f::translate_mat(_position); - if (_oriented == true) { + if (_oriented) { m=m*_orientation; } return m;