| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228 |
- class "ParticleEmitter"
- CONTINUOUS_EMITTER = 0
- TRIGGERED_EMITTER = 1
- function ParticleEmitter:__index__(name)
- if name == "particleSpeedMod" then
- return Polycore.ParticleEmitter_get_particleSpeedMod(self.__ptr)
- elseif name == "brightnessDeviation" then
- return Polycore.ParticleEmitter_get_brightnessDeviation(self.__ptr)
- elseif name == "deviation" then
- retVal = Polycore.ParticleEmitter_get_deviation(self.__ptr)
- if Polycore.__ptr_lookup[retVal] ~= nil then
- return Polycore.__ptr_lookup[retVal]
- else
- Polycore.__ptr_lookup[retVal] = Vector3("__skip_ptr__")
- Polycore.__ptr_lookup[retVal].__ptr = retVal
- return Polycore.__ptr_lookup[retVal]
- end
- elseif name == "dirVector" then
- retVal = Polycore.ParticleEmitter_get_dirVector(self.__ptr)
- if Polycore.__ptr_lookup[retVal] ~= nil then
- return Polycore.__ptr_lookup[retVal]
- else
- Polycore.__ptr_lookup[retVal] = Vector3("__skip_ptr__")
- Polycore.__ptr_lookup[retVal].__ptr = retVal
- return Polycore.__ptr_lookup[retVal]
- end
- elseif name == "gravVector" then
- retVal = Polycore.ParticleEmitter_get_gravVector(self.__ptr)
- if Polycore.__ptr_lookup[retVal] ~= nil then
- return Polycore.__ptr_lookup[retVal]
- else
- Polycore.__ptr_lookup[retVal] = Vector3("__skip_ptr__")
- Polycore.__ptr_lookup[retVal].__ptr = retVal
- return Polycore.__ptr_lookup[retVal]
- end
- elseif name == "lifespan" then
- return Polycore.ParticleEmitter_get_lifespan(self.__ptr)
- elseif name == "rotationFollowsPath" then
- return Polycore.ParticleEmitter_get_rotationFollowsPath(self.__ptr)
- elseif name == "scaleCurve" then
- retVal = Polycore.ParticleEmitter_get_scaleCurve(self.__ptr)
- if Polycore.__ptr_lookup[retVal] ~= nil then
- return Polycore.__ptr_lookup[retVal]
- else
- Polycore.__ptr_lookup[retVal] = BezierCurve("__skip_ptr__")
- Polycore.__ptr_lookup[retVal].__ptr = retVal
- return Polycore.__ptr_lookup[retVal]
- end
- elseif name == "colorCurveR" then
- retVal = Polycore.ParticleEmitter_get_colorCurveR(self.__ptr)
- if Polycore.__ptr_lookup[retVal] ~= nil then
- return Polycore.__ptr_lookup[retVal]
- else
- Polycore.__ptr_lookup[retVal] = BezierCurve("__skip_ptr__")
- Polycore.__ptr_lookup[retVal].__ptr = retVal
- return Polycore.__ptr_lookup[retVal]
- end
- elseif name == "colorCurveG" then
- retVal = Polycore.ParticleEmitter_get_colorCurveG(self.__ptr)
- if Polycore.__ptr_lookup[retVal] ~= nil then
- return Polycore.__ptr_lookup[retVal]
- else
- Polycore.__ptr_lookup[retVal] = BezierCurve("__skip_ptr__")
- Polycore.__ptr_lookup[retVal].__ptr = retVal
- return Polycore.__ptr_lookup[retVal]
- end
- elseif name == "colorCurveB" then
- retVal = Polycore.ParticleEmitter_get_colorCurveB(self.__ptr)
- if Polycore.__ptr_lookup[retVal] ~= nil then
- return Polycore.__ptr_lookup[retVal]
- else
- Polycore.__ptr_lookup[retVal] = BezierCurve("__skip_ptr__")
- Polycore.__ptr_lookup[retVal].__ptr = retVal
- return Polycore.__ptr_lookup[retVal]
- end
- elseif name == "colorCurveA" then
- retVal = Polycore.ParticleEmitter_get_colorCurveA(self.__ptr)
- if Polycore.__ptr_lookup[retVal] ~= nil then
- return Polycore.__ptr_lookup[retVal]
- else
- Polycore.__ptr_lookup[retVal] = BezierCurve("__skip_ptr__")
- Polycore.__ptr_lookup[retVal].__ptr = retVal
- return Polycore.__ptr_lookup[retVal]
- end
- elseif name == "useColorCurves" then
- return Polycore.ParticleEmitter_get_useColorCurves(self.__ptr)
- elseif name == "useScaleCurves" then
- return Polycore.ParticleEmitter_get_useScaleCurves(self.__ptr)
- end
- end
- function ParticleEmitter:__set_callback(name,value)
- if name == "particleSpeedMod" then
- Polycore.ParticleEmitter_set_particleSpeedMod(self.__ptr, value)
- return true
- elseif name == "brightnessDeviation" then
- Polycore.ParticleEmitter_set_brightnessDeviation(self.__ptr, value)
- return true
- elseif name == "lifespan" then
- Polycore.ParticleEmitter_set_lifespan(self.__ptr, value)
- return true
- elseif name == "rotationFollowsPath" then
- Polycore.ParticleEmitter_set_rotationFollowsPath(self.__ptr, value)
- return true
- elseif name == "useColorCurves" then
- Polycore.ParticleEmitter_set_useColorCurves(self.__ptr, value)
- return true
- elseif name == "useScaleCurves" then
- Polycore.ParticleEmitter_set_useScaleCurves(self.__ptr, value)
- return true
- end
- return false
- end
- function ParticleEmitter:ParticleEmitter(...)
- for k,v in pairs(arg) do
- if type(v) == "table" then
- if v.__ptr ~= nil then
- arg[k] = v.__ptr
- end
- end
- end
- if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
- self.__ptr = Polycore.ParticleEmitter(unpack(arg))
- Polycore.__ptr_lookup[self.__ptr] = self
- end
- end
- function ParticleEmitter:createParticles()
- local retVal = Polycore.ParticleEmitter_createParticles(self.__ptr)
- end
- function ParticleEmitter:setRotationSpeed(speed)
- local retVal = Polycore.ParticleEmitter_setRotationSpeed(self.__ptr, speed)
- end
- function ParticleEmitter:setParticleBlendingMode(mode)
- local retVal = Polycore.ParticleEmitter_setParticleBlendingMode(self.__ptr, mode)
- end
- function ParticleEmitter:setDepthWrite(val)
- local retVal = Polycore.ParticleEmitter_setDepthWrite(self.__ptr, val)
- end
- function ParticleEmitter:setDepthTest(val)
- local retVal = Polycore.ParticleEmitter_setDepthTest(self.__ptr, val)
- end
- function ParticleEmitter:setAlphaTest(val)
- local retVal = Polycore.ParticleEmitter_setAlphaTest(self.__ptr, val)
- end
- function ParticleEmitter:enablePerlin(val)
- local retVal = Polycore.ParticleEmitter_enablePerlin(self.__ptr, val)
- end
- function ParticleEmitter:setParticleVisibility(val)
- local retVal = Polycore.ParticleEmitter_setParticleVisibility(self.__ptr, val)
- end
- function ParticleEmitter:setPerlinModSize(size)
- local retVal = Polycore.ParticleEmitter_setPerlinModSize(self.__ptr, size)
- end
- function ParticleEmitter:setBillboardMode(mode)
- local retVal = Polycore.ParticleEmitter_setBillboardMode(self.__ptr, mode)
- end
- function ParticleEmitter:enableEmitter(val)
- local retVal = Polycore.ParticleEmitter_enableEmitter(self.__ptr, val)
- end
- function ParticleEmitter:emitterEnabled()
- local retVal = Polycore.ParticleEmitter_emitterEnabled(self.__ptr)
- return retVal
- end
- function ParticleEmitter:setEmitterRadius(rad)
- local retVal = Polycore.ParticleEmitter_setEmitterRadius(self.__ptr, rad.__ptr)
- end
- function ParticleEmitter:setAllAtOnce(val)
- local retVal = Polycore.ParticleEmitter_setAllAtOnce(self.__ptr, val)
- end
- function ParticleEmitter:Trigger()
- local retVal = Polycore.ParticleEmitter_Trigger(self.__ptr)
- end
- function ParticleEmitter:resetParticle(particle)
- local retVal = Polycore.ParticleEmitter_resetParticle(self.__ptr, particle.__ptr)
- end
- function ParticleEmitter:setParticleCount(count)
- local retVal = Polycore.ParticleEmitter_setParticleCount(self.__ptr, count)
- end
- function ParticleEmitter:addParticleBody(particleBody)
- local retVal = Polycore.ParticleEmitter_addParticleBody(self.__ptr, particleBody.__ptr)
- end
- function ParticleEmitter:getBaseMatrix()
- local retVal = Polycore.ParticleEmitter_getBaseMatrix(self.__ptr)
- if retVal == nil then return nil end
- if Polycore.__ptr_lookup[retVal] ~= nil then
- return Polycore.__ptr_lookup[retVal]
- else
- Polycore.__ptr_lookup[retVal] = Matrix4("__skip_ptr__")
- Polycore.__ptr_lookup[retVal].__ptr = retVal
- return Polycore.__ptr_lookup[retVal]
- end
- end
- function ParticleEmitter:updateEmitter()
- local retVal = Polycore.ParticleEmitter_updateEmitter(self.__ptr)
- end
- function ParticleEmitter:__delete()
- Polycore.__ptr_lookup[self.__ptr] = nil
- Polycore.delete_ParticleEmitter(self.__ptr)
- end
|