mirror of
https://github.com/nasa/trick.git
synced 2025-02-11 21:15:32 +00:00
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
42 lines
833 B
C++
42 lines
833 B
C++
|
|
/*
|
|
PURPOSE:
|
|
(Bouncing ball)
|
|
LIBRARY DEPENDENCY:
|
|
((Ball.cpp))
|
|
*/
|
|
|
|
#ifndef ODEBALL_HH
|
|
#define ODEBALL_HH
|
|
|
|
#include <ode/common.h>
|
|
#include <ode/src/objects.h>
|
|
#include "ODE/DrawStuff/DrawStuffObject.hh"
|
|
|
|
class Ball : public DrawStuffObject {
|
|
public:
|
|
|
|
dWorldID world; // ** world
|
|
dSpaceID space; // ** space
|
|
dJointGroupID contactgroup; // ** contact
|
|
|
|
dBodyID body; // ** the ball body
|
|
dGeomID geom; // ** contact geometry
|
|
dMass m; // ** the mass of the ball
|
|
|
|
dReal * pos ;
|
|
|
|
Ball() ;
|
|
|
|
int init() ;
|
|
int step(double time_step) ;
|
|
int shutdown() ;
|
|
|
|
virtual int draw() ;
|
|
|
|
static void nearCallback(void *data, dGeomID o1, dGeomID o2) ;
|
|
|
|
} ;
|
|
|
|
#endif
|