00001 /* 00002 * dsim_rigid_body.h 00003 * DSimEngine2 00004 * 00005 * Created by David Wilson on 5/19/09. 00006 * Copyright 2009 Princeton Satellite Systems. All rights reserved. 00007 * 00008 */ 00009 00016 #ifndef __DSIM_RIGID_BODY__ 00017 #define __DSIM_RIGID_BODY__ 00018 00019 #include "dsim_model.h" 00020 00027 class dsim_rigid_body : public dsim_model 00028 { 00029 public: 00030 dsim_rigid_body(dsim_model_setup *setup); 00031 ~dsim_rigid_body(); 00032 00033 void initialize_data(); 00034 void initialize_timestep(); 00035 void complete_timestep(); 00036 00037 void rhs(double t,double jd); 00038 00039 dsim_value handle_message(const std::string &sender_path,const std::string &message_name,const dsim_value &argument); 00040 00041 private: 00042 dsim_variable pos; 00043 dsim_variable vel; 00044 dsim_variable quat; 00045 dsim_variable rotv; 00046 dsim_variable mass; 00047 dsim_variable center_mass; 00048 dsim_variable inertia; 00049 00050 dsim_variable test; 00051 00052 ml_matrix force; 00053 ml_matrix torque; 00054 ml_matrix q_dot(const ml_matrix &quat, const ml_matrix &w); 00055 }; 00056 00057 #endif