mirror of
https://github.com/nasa/trick.git
synced 2024-12-30 09:58:53 +00:00
b9c871328b
Added a 3 wheeled car example from the ODE demos. I collapsed all of the separate classes handling the world, objects, and drawings into a single class. Each world is different and just including that with the objects for these simple examples is easier. Same goes for the drawing. refs #172
51 lines
1.1 KiB
Plaintext
51 lines
1.1 KiB
Plaintext
/************************TRICK HEADER*************************
|
|
PURPOSE:
|
|
(blah blah blah)
|
|
LIBRARY DEPENDENCIES:
|
|
(
|
|
)
|
|
*************************************************************/
|
|
|
|
#define DRAW_THREAD C1
|
|
|
|
#include "sim_objects/default_trick_sys.sm"
|
|
|
|
##include "ODE/Buggy/Buggy.hh"
|
|
##include "ODE/DrawStuff/DrawStuff.hh"
|
|
|
|
%{
|
|
const double BuggySimObject::time_step = 0.05 ;
|
|
%}
|
|
|
|
/**
|
|
This class is the base ball class
|
|
*/
|
|
class BuggySimObject : public Trick::SimObject {
|
|
|
|
public:
|
|
|
|
Buggy buggy ;
|
|
DrawStuff drawstuff ;
|
|
|
|
static const double time_step ;
|
|
|
|
/** Constructor to add the jobs */
|
|
BuggySimObject() {
|
|
("initialization") buggy.init() ;
|
|
(time_step, "scheduled") buggy.step(time_step) ;
|
|
DRAW_THREAD (1000000.0, "scheduled") drawstuff.draw() ;
|
|
("shutdown") drawstuff.shutdown() ;
|
|
("shutdown") buggy.shutdown() ;
|
|
}
|
|
} ;
|
|
|
|
// Instantiations
|
|
BuggySimObject buggy_so ;
|
|
|
|
// Connect objects
|
|
void create_connections() {
|
|
// Set the default termination time
|
|
//exec_set_terminate_time(300.0) ;
|
|
}
|
|
|