Have you tried IrrLua?
Yes, I looked at it a bit. However, using IrrLua is not quite what I wanted to do. Using IrrLua, I still ended up typing a lot of the actual Irrlicht commands and parameters... I didn't see any great benefit as it was a small step to just program the application in Irrlicht and native C++.
The Apocalyx Engine uses a Lua binding that greatly simplifies coding. Here's a snippet setting up a Quake model, a sky, lighting and an avatar:
Code: Select all
----BSP INITIALIZATION----
function BSP_init()
showLoadingScreen()
----CAMERA----
setAmbient(.2,.2,.2)
setPerspective(60,3,12000)
local camera = getCamera()
camera:reset()
empty()
----SKYBOX----
if not fileExists("DemoPack0.dat") then
showConsole()
error("\nERROR: File 'DemoPack0.dat' not found.")
end
local zip = Zip("DemoPack0.dat")
local skyTxt = {
zip:getTexture("skyboxTop2.jpg"),
zip:getTexture("skyboxLeft2.jpg"),
zip:getTexture("skyboxFront2.jpg"),
zip:getTexture("skyboxRight2.jpg"),
zip:getTexture("skyboxBack2.jpg")
}
local sky = MirroredSky(skyTxt)
setBackground(sky)
----SUN----
sun = Sun(
zip:getTexture("light.jpg"),0.25,
0.0, 0.2588, 0.9659,
zip:getTexture("lensflares.png"),
5, 0.2
)
sun:setColor(0.855,0.475,0.298);
setSun(sun)
----EMITTER----
local fireImage = zip:getImage("smoke.png")
fireImage:convertTo111A()
local fireTexture = Texture(fireImage)
fireImage:delete()
shotEmitter = Emitter(5,.1,3)
shotEmitter:setTexture(fireTexture,1)
shotEmitter:setVelocity(300,0,0, 0)
shotEmitter:setColor(1,1,1,1, 1,.5,0,0)
shotEmitter:setSize(22.5,22.5)
shotEmitter:setGravity(0,0,0, 0,0,0)
shotEmitter:setOneShot()
shotEmitter:reset()
addObject(shotEmitter)
shotEmitter:hide()
fireTexture:delete()
----BSP----
if selectedLevel < 0 then
bsp = zip:getLevel("maze.bsx",2.5)
else
local pak = Zip("pak0.pk3")
bsp = pak:getLevel(levelNames[selectedLevel],2.5)
pak:delete()
end
bsp:setShowUntexturedMeshes()
bsp:setShowUntexturedPatches()
showTransparenciesFlag = false
useFastRenderingModeFlag = false
bsp:setDefaultTexture(zip:getTexture("bricks.jpg",1))
setScenery(bsp)
----MODELS----
flyModeActive = 0
runModeActive = 1
isWalking = 0
isRotating = 0
linkTransform = Transform()
legs = 5 ---> LEGS_IDLE
weapon = zip:getModel("gun.md3","gun.jpg")
avatar = zip:getBot("wrokdam.mdl",1)
avatar:pitch(-1.5708)
local startX, startY, startZ = bsp:getStartingPosition()
avatar:move(startX,startY,startZ)
avatar:move(0,0,0)
avatar:getUpper():link("tag_weapon",weapon)
avatar:setUpperAnimation(4) ---> TORSO_STAND
avatar:setLowerAnimation(legs)
addObject(avatar)
setListenerScale(32)
local shotSound = zip:getSample3D("shot.wav");
shotSound:setVolume(255)
shotSound:setMinDistance(8)
shotSource = Source(shotSound,avatar);
shotSource:getSound3D():stop()
addSource(shotSource)
local runSound = zip:getSample3D("run.wav");
runSound:setLooping(1)
runSound:setVolume(255)
runSound:setMinDistance(8)
runSource = Source(runSound,avatar);
runSource:getSound3D():stop()
addSource(runSource)
You don't see any of the underlying Apocalyx engine C++ code... This allow rapid prototyping... and I think it would allow new programmers to access Irrlicht features in a simpler, less convoluted way.
