Page 1 of 1

Posted: 04 Jan 2018, 21:35
by oli_lab
Hi !
I'm a little bit lost...
I'm trying to include a lib (swarmz.h) into the code of a new module.

did this in my .h file
#include "swarmz.h"
using namespace sw;
looks ok.

and then this in .cpp :
//---------------------------------------------------------------------------------
// define our swarm members
vector<Boid> boids;
boids.push_back(Boid(Vec3(1, 0, 0), Vec3(1, 0, 0)));
boids.push_back(Boid(Vec3(1.5, 0, 0), Vec3(1, 1, 0)));
boids.push_back(Boid(Vec3(1, 0.5, 0.5), Vec3(0, 1, 0)));
boids.push_back(Boid(Vec3(4, 4, -2), Vec3(1, 0, 0)));

//create the swarm!
Swarm swarm(&boids);
//---------------------------------------------------------------------------------

if I put the latter in void boidsOli::onInitModule
it compiles ok, but then when I put :

swarm.Update(deltaSeconds);
in onProcess()

it says class Swarm has no member swarm

hum ...

thanx for your help

Posted: 04 Jan 2018, 21:49
by 23fx23
note sure shouldn't the swarm object be created in the .h too?