2016-01-29 15:15:00 +00:00
|
|
|
/************************TRICK HEADER*************************
|
|
|
|
PURPOSE:
|
|
|
|
(blah blah blah)
|
|
|
|
LIBRARY DEPENDENCIES:
|
|
|
|
(
|
|
|
|
)
|
|
|
|
*************************************************************/
|
|
|
|
|
|
|
|
#define DRAW_THREAD C1
|
|
|
|
|
|
|
|
#include "sim_objects/default_trick_sys.sm"
|
|
|
|
|
2016-02-25 22:04:27 +00:00
|
|
|
##include "Ball/Ball.hh"
|
|
|
|
##include "DrawStuff/DrawStuff.hh"
|
2016-01-29 15:15:00 +00:00
|
|
|
|
|
|
|
%{
|
2016-02-02 17:19:25 +00:00
|
|
|
const double OdeBallSimObject::time_step = 0.01 ;
|
2016-01-29 15:15:00 +00:00
|
|
|
%}
|
|
|
|
|
|
|
|
/**
|
|
|
|
This class is the base ball class
|
|
|
|
*/
|
2016-02-02 17:19:25 +00:00
|
|
|
class OdeBallSimObject : public Trick::SimObject {
|
2016-01-29 15:15:00 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2016-02-02 17:19:25 +00:00
|
|
|
Ball ball ;
|
2016-01-29 15:15:00 +00:00
|
|
|
DrawStuff drawstuff ;
|
|
|
|
|
|
|
|
static const double time_step ;
|
|
|
|
|
|
|
|
/** Constructor to add the jobs */
|
2016-02-02 17:19:25 +00:00
|
|
|
OdeBallSimObject() {
|
|
|
|
("initialization") ball.init() ;
|
|
|
|
(time_step, "scheduled") ball.step(time_step) ;
|
2016-01-29 15:15:00 +00:00
|
|
|
DRAW_THREAD (1000000.0, "scheduled") drawstuff.draw() ;
|
|
|
|
("shutdown") drawstuff.shutdown() ;
|
2016-02-02 17:19:25 +00:00
|
|
|
("shutdown") ball.shutdown() ;
|
2016-01-29 15:15:00 +00:00
|
|
|
}
|
|
|
|
} ;
|
|
|
|
|
|
|
|
// Instantiations
|
2016-02-02 17:19:25 +00:00
|
|
|
OdeBallSimObject ball_so ;
|
2016-01-29 15:15:00 +00:00
|
|
|
|
|
|
|
// Connect objects
|
|
|
|
void create_connections() {
|
|
|
|
// Set the default termination time
|
|
|
|
exec_set_terminate_time(300.0) ;
|
|
|
|
}
|
|
|
|
|