Sensomusic

#1 2018-01-04 20:35:01

oli_lab
Platinum Member

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


http://oli-lab.org

Win10 I7/16GB RAM  - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Facebook
http://www.facebook.com/pages/OLI_LAB/3 … 506?v=wall

Offline

 

#2 2018-01-04 20:49:41

23fx23
Community

note sure shouldn't the swarm object be created in the .h too?

Offline