by anne10 » 30 Jul 2017, 08:09
i'm trying to add "m_sky_particles" (i.e ParticleSystem) in cutscene_world.cpp (as they are in local_player_controller.cpp), now to setup this particle system i need a camera instance to get current scene node, and a current particle kind which i have manually set to rain for now.
Here is constructor signature of "ParticleEmitter":
new ParticleEmitter (const ParticleKind* type, const Vec3 &position, scene::ISceneNode* parent = NULL, bool randomize_initial_y = false, bool important = false);
And here how i'm calling it (from CutsceneWorld::init() in cutscene_world.cpp):
Camera* stk_cam = Camera::createCamera(NULL);
m_sky_particles_emitter = new ParticleEmitter(ParticleKindManager::get()->getParticles("rain"),
core::vector3df(0.0f, 30.0f, 100.0f),
stk_cam->getCameraSceneNode(),
true);
So basically i think i need to setup this stk_cam first, based on camera of CutsceneWorld.
can anyone help to figure out how i can get the current camera over here ? and also let me know my approach is correct or not ?