59 int num = 30,
int seed = 1,
63 num(num), boxsizemean(boxsizemean), boxsizevar(boxsizevar)
67 this->dimension.z()=1;
88 double size=dimension.length();
89 for(
int i=0; i< num; i++){
92 Pos s = boxsizemean + ((rand*2) & boxsizevar);
93 Pos pos = (dimension &
Pos(randGen.
rand()-0.5,randGen.
rand()-0.5,0));
94 double angle = randGen.
rand()*M_PI;
101 s.z()*=fabs((size-pos.length())/size);
#define TRANSM
Definition: amos4legs.cpp:53
double rand()
returns a value in [0,1)
Definition: randomgenerator.h:42
Data structure for accessing the ODE.
Definition: odehandle.h:44
OsgHandle osgHandle
Definition: abstractobstacle.h:174
virtual std::vector< TextureDescr > getTextures(int primitive) const
returns the textures of the given primitive
Definition: abstractobstacle.cpp:147
virtual void setTexture(const std::string &texturefilename)
assigns a texture to the all primitives of this obstactle with repeat -1,-1
Definition: abstractobstacle.cpp:107
Abstract class (interface) for obstacles.
Definition: abstractobstacle.h:46
Matrixd Matrix
Definition: osgforwarddecl.h:47
bool obstacle_exists
Definition: abstractobstacle.h:171
OdeHandle odeHandle
Definition: abstractobstacle.h:173
random generator with 48bit integer arithmentic
Definition: randomgenerator.h:34
Data structure for accessing the OpenSceneGraph.
Definition: osghandle.h:79
Definition: primitive.h:89
Boxpile(const OdeHandle &odeHandle, const OsgHandle &osgHandle, const osg::Vec3 &dimension=osg::Vec3(5.0, 5.0, 1.0), int num=30, int seed=1, const osg::Vec3 &boxsizemean=osg::Vec3(1.0, 1.0, 0.2), const osg::Vec3 &boxsizevar=osg::Vec3(0.5, 0.5, 0.1))
Constructor a random boxpile is fixed to the world.
Definition: boxpile.h:57
void init(long int seedval)
Definition: randomgenerator.h:38
Vec3f Vec3
Definition: osgforwarddecl.h:42
Definition: primitive.h:89
void createNewSimpleSpace(dSpaceID parentspace, bool ignore_inside_collisions)
use this function to create a new space with optional ignored collisions, use deleteSpace to destroy ...
Definition: odehandle.cpp:85
Interface class for primitives represented in the physical and graphical world.
Definition: primitive.h:80
std::vector< Primitive * > obst
primitives which belong to this obstacle
Definition: abstractobstacle.h:166
Box primitive.
Definition: primitive.h:267
virtual void setTextures(const std::vector< TextureDescr > &textures)
assign a set of texture to the surfaces of the primitive
Definition: primitive.cpp:142
osg::Matrix pose
Definition: abstractobstacle.h:170
virtual void create()
overload this function to create the obstactle. All primitives should go into the list "obst" ...
Definition: boxpile.h:85
virtual void setPose(const osg::Matrix &pose)
sets position of the obstacle and creates/recreates obstacle if necessary
Definition: boxpile.h:72
virtual void setPose(const Pose &pose)
set the pose of the primitive
Definition: primitive.cpp:156
dSpaceID space
Definition: odehandle.h:51
Boxpile.
Definition: boxpile.h:39
#define ROTM
Definition: amos4legs.cpp:52
virtual Primitive * getMainPrimitive() const
return the "main" primitive of the obtactle. The meaning of "main" is arbitrary
Definition: boxpile.h:79
virtual void init(const OdeHandle &odeHandle, double mass, const OsgHandle &osgHandle, char mode=Body|Geom|Draw)
registers primitive in ODE and OSG.
Definition: primitive.cpp:417