GetInterval
This function returns the current time interval, in milliseconds, between particle releases.
Syntax
Returns
This function returns a float containing the current release interval.
Remarks
This function is meant to be used in conjunction with SetFacingDirection, if the particle facing mode is set to billboarded then GetFacingDirection will be of no use. Remember that the view mode must be set to manual direction, see SetViewMode.
Example
#include "Leadwerks.h"
using namespace Leadwerks;
int main(int argc, const char *argv[])
{
Leadwerks::Window* window = Leadwerks::Window::Create();
Context* context = Context::Create(window);
World* world = World::Create();
Camera* camera = Camera::Create();
camera->Move(0, 0, -3);
int interval = 1000;
//Create an emitter
Emitter* emitter = Emitter::Create(1000);
emitter->SetEmissionVolume(0, 0, 0);
emitter->SetInterval(interval);
while (true)
{
if (window->Closed() || window->KeyDown(Key::Escape)) return false;
Leadwerks::Leadwerks::Time::Update();
world->Update();
world->Render();
if (window->KeyDown(Key::Up))
{
interval += 1000;
emitter->SetInterval(interval);
}
else if (window->KeyDown(Key::Down) && interval > 0)
{
interval -= 1000;
emitter->SetInterval(interval);
}
context->SetBlendMode(Blend::Alpha);
context->DrawText("Interval: " + String(emitter->GetInterval() / 1000) + " seconds.", 2, 2);
context->SetBlendMode(Blend::Solid);
context->Sync();
}
}