GetEmissionVolume
This function returns the emitter's emission volume, the area in which a particle may spawn.
Syntax
Returns
This function returns a Vec3 containing the emitter's emission volume.
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 sz = 1
emitter:SetEmissionVolume(sz,sz,sz)
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
sz = sz + 0.05
emitter:SetEmissionVolume(sz,sz,sz)
elseif (window:KeyDown(Key.Down)) then
sz = sz - 0.05
sz = math.max(sz,0)
emitter:SetEmissionVolume(sz,sz,sz)
end
context:SetBlendMode(Blend.Alpha)
context:DrawText("Emission volume: "..emitter:GetEmissionVolume():ToString(),0,0)
context:Sync()
end