00001 /**************************************************************************** 00002 * Copyright 2005 Evan Drumwright 00003 * This library is distributed under the terms of the GNU General Public 00004 * License (found in COPYING). 00005 ****************************************************************************/ 00006 00007 #ifndef _ARTICULATED_BODY_H 00008 #define _ARTICULATED_BODY_H 00009 00010 #include <vector> 00011 #include <boost/shared_ptr.hpp> 00012 #include <Physsim/sorted_pair> 00013 #include <Physsim/DynamicBody.h> 00014 #include <Physsim/Vector3.h> 00015 #include <Physsim/Matrix3.h> 00016 #include <Physsim/SMatrix6.h> 00017 00018 namespace Physsim { 00019 00020 class RigidBody; 00021 00023 class ArticulatedBody : public DynamicBody 00024 { 00025 public: 00026 virtual ~ArticulatedBody() {} 00027 Matrix3 det_collision_matrix(const Matrix3& collision_frame, const Vector3& contact_point, RigidBodyPtr colliding_link); 00028 static Matrix3 det_collision_matrix(const Matrix3& collision_frame, const Vector3& contact_point, RigidBodyPtr link1, boost::shared_ptr<RigidBody> link2); 00029 virtual void transform(const Matrix4& T); 00030 00032 virtual void correct_joint_limit_collisions(Real collision_tolerance) = 0; 00033 00035 virtual void correct_joint_limit_violations() = 0; 00036 00038 virtual bool joint_limit_collision(Real collision_tolerance) const = 0; 00039 00041 00047 virtual void apply_impulse(const Vector3& j, const Vector3& k, const Vector3& p, RigidBodyPtr link) = 0; 00048 00050 virtual VectorN get_state() = 0; 00051 00053 virtual VectorN get_state_deriv() = 0; 00054 00056 virtual void set_state(const VectorN& state) = 0; 00057 00059 virtual std::list<RigidBodyPtr> get_rigid_bodies() const = 0; 00060 00062 virtual std::list<sorted_pair<RigidBodyPtr> > get_adjacent_links() const = 0; 00063 00065 virtual void reset_accumulators() = 0; 00066 00068 virtual void compile() = 0; 00069 }; 00070 00071 } // end namespace Physsim 00072 00073 #endif
1.5.1