CommonCtrl.MinisceneManager
mini scene graph manager.which allows a miniscenegraph to load an onload script the same way as the main scene
Title |
mini scene graph manager.which allows a miniscenegraph to load an onload script the same way as the main scene |
Author(s) |
LiXizhi |
Date |
2007/10/7 |
File |
script/ide/MinisceneManager.lua |
Description
Sample Code
NPL.load("(gl)script/ide/MinisceneManager.lua");
CommonCtrl.MinisceneManager.LoadFromOnLoadScript(scene, "worlds/login_world/script/login_world_0_0.onload.lua", 255, 0, 255)
CommonCtrl.MinisceneManager.LoadFromOnNPCdb(scene, "worlds/login_world/login_world.NPC.db", 255, 0, 255)
local worldinfo = CommonCtrl.MinisceneManager.GetWorldAttribute("worlds/login_world/login_world.attribute.db");
CommonCtrl.MinisceneManager.LoadWorldAttribute(scene, worldInfo, worldinfo.PlayerX,worldinfo.PlayerY, worldinfo.PlayerZ)
Member Functions
CommonCtrl.MinisceneManager.LoadFromOnLoadScript
[[ Load a miniscene graph with all mesh objects contained in on load script.
- param scene : the miniscenegraph object.
- param filename : An on load script is usually save at worlds/[name]/script/[name]_0_0.onload.lua during scene saving
- param originX :, originY, originZ: we can use a new scene origin when loading the scene. if nil, 0 is used
]]
syntax
function CommonCtrl.MinisceneManager.LoadFromOnLoadScript(scene, filename, originX, originY, originZ)
parameters
scene |
the miniscenegraph object. |
filename |
|
|
originX | , originY, originZ: we can use a new scene origin when loading the scene. if nil, 0 is used
]] |
CommonCtrl.MinisceneManager.LoadFromOnNPCdb
[[ load character from
NPL database
- param scene : the miniscenegraph object.
- param filename : NPC database file which is usually save at worlds/[name]/[name].NPC.db during scene saving
- param originX :, originY, originZ: we can use a new scene origin when loading the scene. if nil, 0 is used
]]
syntax
function CommonCtrl.MinisceneManager.LoadFromOnNPCdb(scene, filename, originX, originY, originZ)
parameters
scene |
the miniscenegraph object. |
filename |
|
|
originX | , originY, originZ: we can use a new scene origin when loading the scene. if nil, 0 is used
]] |
CommonCtrl.MinisceneManager.GetWorldAttribute
[[ world attribute is returned via a table.
- param filename : world attribute database file is usually at worlds/[name]/[name].attribute.db during scene saving
]]
syntax
function CommonCtrl.MinisceneManager.GetWorldAttribute(filename)
parameters
|
filename | world attribute database file is usually at worlds/[name]/[name].attribute.db during scene saving
]] |
CommonCtrl.MinisceneManager.LoadWorldAttribute
[[ load world info, such as sky box, fog, main player. Currently it only loads main player
- param scene : the miniscenegraph object.
- param worldinfo : this is what is returned by GetWorldAttribute()
]]
syntax
function CommonCtrl.MinisceneManager.LoadWorldAttribute(scene, worldinfo, originX, originY, originZ)
parameters
scene |
the miniscenegraph object. |
worldinfo |
|
originX |
|
originY |
|
originZ |
|