Welcome to %s forums

BrainModular Users Forum

Login Register

using an external library

Create your own modules in C++
Post Reply
User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 04 Jan 2018, 21:35

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

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 04 Jan 2018, 21:49

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

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests