GetAcceleration

This function returns the acceleration value of released particles.

Syntax

Returns

Returns a Vec3 containing the set acceleration of released particles.

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 emitter
emitter = Emitter:Create(100)

local acceleration = -0.5
emitter:SetAcceleration(0,acceleration,0)

while true do

if window:Closed() or window:KeyHit(Key.Escape) then return false end

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

if (window:KeyDown(Key.Up)) then
acceleration = acceleration + .1
emitter:SetAcceleration(0,acceleration,0)
elseif (window:KeyDown(Key.Down)) then
acceleration = acceleration - .1
emitter:SetAcceleration(0,acceleration,0)
end

context:SetBlendMode(Blend.Alpha)
context:DrawText("Current Y-axis Acceleration: " ..emitter:GetAcceleration().y ,2,2)

context:Sync()
end