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
--Create a window
window = Window:Create()
context = Context:Create(window)
world = World:Create()
camera = Camera:Create()
camera:Move(0,0,-3)
--Create an emitter
emitter = Emitter:Create(500)
local material = Material:Load("Materials/Effects/spark.mat")
if (material) then
emitter:SetMaterial(material)
material:Release()
end
emitter:SetVelocity(0,0,0,0) --set base velocity to 0
emitter:SetVelocity(8,8,0,1) --set a random velocity of .1 in the x and y directions
emitter:SetRotationByVelocityMode(true)
emitter:SetEmissionVolume(0,0,0)
while true do
if window:Closed() or window:KeyHit(Key.Escape) then return false end
Time:Update()
world:Update()
world:Render()
--Press space to toggle mode
if window:KeyHit(Key.Space) then
emitter:SetRotationByVelocityMode(not emitter:GetRotationByVelocityMode())
end
context:Sync()
end