1
#ifndef DYNAMICBOXOBJECT_H
2
#define DYNAMICBOXOBJECT_H
9
#include "dynamicobject.h"
12
class DynamicBoxObject : public DynamicObject
15
DynamicBoxObject(ssgEntity *model, dWorldID world, dSpaceID bigspace, sgVec3 pos, sgVec3 scl) :
16
DynamicObject(model, world, bigspace)
18
body = dBodyCreate (world);
19
dBodySetPosition (body,pos[0],pos[1],pos[2]);
20
dim[0]=scl[0]; dim[1]=scl[1]; dim[2]=scl[2];
21
geom = dCreateBox (bigspace,scl[0],scl[1],scl[2]);
23
dGeomSetBody (geom,body);
24
dGeomSetData (geom,this);
26
void SetMass(float density=1000.0)
29
dMassSetBox (&m,density,dim[0],dim[1],dim[2]);
30
dBodySetMass (body,&m);
32
virtual ~DynamicBoxObject()
34
// geom and body are destroyed by parent's destructor