GetRotationByVelocityMode
This function returns if the rotation mode is rotation by velocity.
Syntax
- bool GetRotationByVelocityMode()
Returns
This function returns true if rotating by velocity, false if rotating by rotation speed.
Remarks
Please note: Rotating by velocity takes precedence over rotating by rotation speed, if both are set rotating by velocity will be used.
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);
//Create an emitter
Emitter* emitter = Emitter::Create(500);
Material* material = Material::Load("Materials/Effects/spark.mat");
if (material)
{
emitter->SetMaterial(material);
material->Release();
}
emitter->SetVelocity(0, 0, 0, 0);
emitter->SetVelocity(8, 8, 0, 1);
emitter->SetRotationByVelocityMode(true);
emitter->SetEmissionVolume(0, 0, 0);
while (true)
{
if (window->Closed() || window->KeyDown(Key::Escape)) return false;
Leadwerks::Leadwerks::Time::Update();
world->Update();
world->Render();
//Press space to toggle mode
if (window->KeyHit(Key::Space))
{
emitter->SetRotationByVelocityMode(!emitter->GetRotationByVelocityMode());
}
context->Sync();
}
}