GetFacingDirection

This function returns the facing direction that is manually set using SetFacingDirection.

Syntax

Returns

This function returns a Vec3 containing the manually set particle facing direction.

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);

//Create an emitter
Emitter* emitter = Emitter::Create(1000);
emitter->SetViewMode(2); //set the view mode to manual facing direction
emitter->SetFacingDirection(0, 1, 0); //set particles to always face up

while (true)
{
if (window->Closed() || window->KeyDown(Key::Escape)) return false;

Leadwerks::Leadwerks::Time::Update();
world->Update();
world->Render();

context->SetBlendMode(Blend::Alpha);
context->DrawText("facing direction: " + (emitter->GetFacingDirection()).ToString(), 2, 2);
context->SetBlendMode(Blend::Solid);

context->Sync();
}
}