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

--Create a window
window = Window:Create()
context = Context:Create(window)
world = World:Create()
camera = Camera:Create()
camera:Move(0,0,-3)
local light = DirectionalLight:Create()
light:SetRotation(35,35,0)

--Create an self.self.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 do
if window:Closed() or window:KeyHit(Key.Escape) then return false end

Time:Update()
world:Update()
world:Render()

context:SetBlendMode(Blend.Alpha)
context:DrawText("facing direction: " .. (emitter:GetFacingDirection()):ToString() ,2,2)

context:Sync()
end