Thread: [Yake-svn] SF.net SVN: yake: [1640] trunk/yake/documentation/manual/yake-manual.txt
Status: Beta
Brought to you by:
psyclonist
From: <psy...@us...> - 2007-03-13 00:11:45
|
Revision: 1640 http://svn.sourceforge.net/yake/?rev=1640&view=rev Author: psyclonist Date: 2007-03-12 17:11:45 -0700 (Mon, 12 Mar 2007) Log Message: ----------- Modified Paths: -------------- trunk/yake/documentation/manual/yake-manual.txt Modified: trunk/yake/documentation/manual/yake-manual.txt =================================================================== --- trunk/yake/documentation/manual/yake-manual.txt 2007-03-13 00:11:34 UTC (rev 1639) +++ trunk/yake/documentation/manual/yake-manual.txt 2007-03-13 00:11:45 UTC (rev 1640) @@ -39,10 +39,9 @@ This manual is licensed under the Attribution-NonCommercial-ShareAlike 2.0 Germany License. -You can read the more complete human-readable summary of the license at this URL in several languages: +You can read the more complete human-readable summary of the license at this URL: -http://creativecommons.org/licenses/by-nc-sa/2.0/de/ (in German) -http://creativecommons.org/licenses/by-nc-sa/2.0/de/deed.en (in English) +http://creativecommons.org/licenses/by-nc-sa/2.0/de/ The full license text is available here: @@ -359,8 +358,8 @@ Basic management of scripting states is handled by the 'scripting' component. -It does not handle binding. This is implemented in specialized plugins -(e.g. "entLua", "modelLua" ..). +It does not handle binding. This is implemented in one or more specialized binding plugins +(e.g. "binding.lua" ..). Interfaces ~~~~~~~~~~ @@ -381,6 +380,71 @@ At the time of writing one official scripting plugin as well as a set of binding modules are available for Lua. +Lua Scripting Bindings +---------------------- + +Official script language bindings are implemented for Lua 5. The library which +implements the bindings is *bindings.lua*. + +Examples +~~~~~~~~ + +C++ pseudocode:: + + #include <yake/scripting/yakeScriptingSystem.h> + #include <yake/bindings.lua/bindings.lua.h> + + // ... setup VM + yake::scripting::IVM* vm = .. + + // bind everything there is + yake::bind_all(vm) + +Alternatively you can set up the bindings directly for a *lua_State*:: + + // setup VM + lua_State* L = lua_open(); + luabind::open(L); + + // bind everything + yake::bind_all(L); + +You can bind a subset of available functionality, either by calling an explicit bind_X function +or by instantiating a binder object. + +Either using bind_X():: + + yake::bind_base(vm); // binds basic functionality (math etc) + yake::bind_model(vm); // binds functionality of yake::model (Model, ModelComponent etc) + .. + +Or using binder objects:: + + yake::SharedPtr<scripting::IBinder> binder = yake::create<scripting::IBinder>("base"); + binder->bind(vm); + +The bind_X() approach is slightly more efficient as it avoids allocation of an IBinder instance. +If you keep the binder object around the difference is negligible. + +.. note:: + The binder approach can prove to be useful when data-driven concepts come into play, i.e. if + you need to specify which components to bind to at runtime (for example, by reading the binder + ids from a configuration file). + +Choosing which binders to build +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can select which script bindings are actually built by editing ``scripts/premake/config.lua``. Use +the ``ENABLE_LUA_*`` settings. (Remember to recreate the build scripts by running the appropriate script. +See `Building Yake (libraries and demos)`_ for more information.) + +If you disable a binding on the code basis in ``config.lua`` then neither bind_X() function nor the binder +object for this feature will be available. + +You can compile all binders and select which binders to use at a later time. Disabling binders +on the build level can make sense when you definitely know that you do not need or want to use a certain +feature at all. This way you can avoid dependencies and reduce compilation time. + Data ---- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-03-15 17:41:33
|
Revision: 1659 http://svn.sourceforge.net/yake/?rev=1659&view=rev Author: psyclonist Date: 2007-03-15 10:41:31 -0700 (Thu, 15 Mar 2007) Log Message: ----------- added libs Modified Paths: -------------- trunk/yake/documentation/manual/yake-manual.txt Modified: trunk/yake/documentation/manual/yake-manual.txt =================================================================== --- trunk/yake/documentation/manual/yake-manual.txt 2007-03-15 17:41:03 UTC (rev 1658) +++ trunk/yake/documentation/manual/yake-manual.txt 2007-03-15 17:41:31 UTC (rev 1659) @@ -311,6 +311,12 @@ +--------------------+------------------------------------------------------------+ | msg | generic message posting / handling / subscription | +--------------------+------------------------------------------------------------+ +| statemachine | generic finite state machine library | ++--------------------+------------------------------------------------------------+ +| reflection | (to be replaced) | ++--------------------+------------------------------------------------------------+ +| file | virtual file system (file, ftp, ...) | ++--------------------+------------------------------------------------------------+ Other libraries: @@ -352,6 +358,12 @@ +--------------------+------------------------------------------------------------+ | raf | Application framework for Yake based applications | +--------------------+------------------------------------------------------------+ +| gui | (documentation to come) | ++--------------------+------------------------------------------------------------+ +| gui_adapter | (documentation to come) | ++--------------------+------------------------------------------------------------+ +| gui_addons | (documentation to come) | ++--------------------+------------------------------------------------------------+ base This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-03-15 23:50:41
|
Revision: 1666 http://svn.sourceforge.net/yake/?rev=1666&view=rev Author: psyclonist Date: 2007-03-15 16:50:41 -0700 (Thu, 15 Mar 2007) Log Message: ----------- Modified Paths: -------------- trunk/yake/documentation/manual/yake-manual.txt Modified: trunk/yake/documentation/manual/yake-manual.txt =================================================================== --- trunk/yake/documentation/manual/yake-manual.txt 2007-03-15 23:39:50 UTC (rev 1665) +++ trunk/yake/documentation/manual/yake-manual.txt 2007-03-15 23:50:41 UTC (rev 1666) @@ -604,23 +604,32 @@ ~~~~~~~~ Models are used to represent more complex objects. They can also be used to -combine different representations (e.g. physics and graphics). +combine different representations (e.g. physics and graphics) as well as +links between these representations. Models own any number of ModelComponents and ModelLinks. -ModelComponents are very generic and can be nearly anything. Common components are model::Graphical (which manages a set of scene nodes, entities and other graphical objects), model::Physical (which manages physical actors, joints and other physical objects) and vehicle::VehicleModelComponent which adapts Yake's vehicle component and interacts with other ModelComponents in the same Model. +ModelComponents are very generic objects and can therefore represent nearly anything. +Common components are model::Graphical (which manages a set of scene nodes, entities +and other graphical objects), model::Physical (which manages physical actors, joints +and other physical objects) and vehicle::VehicleModelComponent which adapts Yake's vehicle +component and interacts with other ModelComponents in the same Model. ModelLinks are used to link ModelComponents and their contained objects. -For example, a movable graphical entity/mesh can be linked to a physical dynamics actor in such a way that the graphical entity inherits the transformation of the physics object. In short, we have created a ball. +For example, a movable graphical entity/mesh can be linked to a physical dynamics actor +in such a way that the graphical entity inherits the transformation of the physics object. +In short, we have created a ball. The exact layout of models and their components as well as the model links can be defined either in code or using a special short cut string representation or, and this is the suggested method for most use cases, it can be defined in an XML file (.model and .link). +As noted above, Yake ships with a variety of ModelComponents and ModelLinks as +well as their corresponding loaders and creators. Have a look at the API documentation +for more details. + dotModel and dotLink file formats ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Examples -~~~~~~~~ Property -------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-04-20 14:36:43
|
Revision: 1711 http://svn.sourceforge.net/yake/?rev=1711&view=rev Author: psyclonist Date: 2007-04-20 07:36:40 -0700 (Fri, 20 Apr 2007) Log Message: ----------- small fixes Modified Paths: -------------- trunk/yake/documentation/manual/yake-manual.txt Modified: trunk/yake/documentation/manual/yake-manual.txt =================================================================== --- trunk/yake/documentation/manual/yake-manual.txt 2007-04-20 14:27:14 UTC (rev 1710) +++ trunk/yake/documentation/manual/yake-manual.txt 2007-04-20 14:36:40 UTC (rev 1711) @@ -185,10 +185,16 @@ Please note that this guide expects the developer to be familiar with the build environment and tools of his choice. -.. note:: - The build scripts for the various platforms and compilers are generated from - premake scripts. You either have to install premake yourself. The official - dependency packages for Yake ship with the executable already in place. +Builds Script Generation with Premake +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The build scripts for the various platforms and compilers are generated from +Lua scripts run by the premake utility. + +The official dependency packages for Yake ship with the executable already in place. + +You can find prebuilt premake packages for various +platforms at `http://premake.sf.net/`_ . Configuration ~~~~~~~~~~~~~ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-07-31 15:25:09
|
Revision: 1780 http://yake.svn.sourceforge.net/yake/?rev=1780&view=rev Author: psyclonist Date: 2007-07-31 08:25:07 -0700 (Tue, 31 Jul 2007) Log Message: ----------- added docs on bindings.lua (events, properties) Modified Paths: -------------- trunk/yake/documentation/manual/yake-manual.txt Modified: trunk/yake/documentation/manual/yake-manual.txt =================================================================== --- trunk/yake/documentation/manual/yake-manual.txt 2007-07-31 14:08:38 UTC (rev 1779) +++ trunk/yake/documentation/manual/yake-manual.txt 2007-07-31 15:25:07 UTC (rev 1780) @@ -770,14 +770,55 @@ Entity Scripting Using Lua ~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Properties +.......... + +Add property to current entity ("this"):: + + this:properties():create("age",42) -- Adds property of type 'int' + this:properties():create("name","Jack") -- Adds property of type string (yake::String) + +Query property object:: + + local age = this:properties():get("age") -- stores property pointer in age + print(age:get()) -- prints 42 + +Or alternatively:: + + local age = this:property("age") + print(age:get()) + +Or without local object:: + + print( this:property("age"):get() ) + +Setting values:: + + this:property("age"):set(32) -- Yay for un-aging! + +Setting values of incorrect type (and handling the error):: + + if not this:property("age"):set(32) do + print("Failed to reset my age!") + end + +Built-in properties are registered as Lua properties and can be accessed in +a more convenient way. One of the default built-in properties is ent::Object's +"id" property:: + + print( this.id ) -- prints 'ObjectId(..,..)' + this.id = yake.ObjectId(42,12) -- Is that a good idea? Well, ... + + Events ...... -Add event to current entity ("self"):: +Add event to current entity ("this"):: - self:events():add("tick") + this:events():add("tick") -Add event to current entity ("self") with shortcut syntax:: +Add event to current entity ("this") with shortcut syntax:: events():add("tick") @@ -793,14 +834,15 @@ events("tick"):fire() --prints: nil events("tick"):fire(42) --prints: 42 - + events("tick"):fire(self.id) --prints: ObjectId(..,..) + .. note:: The event parameter on the C++ side is stored in a boost::any. Types that can be stored in a boost any have to be explicitly registered with Lua. Therefore not all types may be available as parameters. If you use an unsupported type - execution will result in an error. - + execution will stop and an error will be reported. + Scheduler/Executor .................. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-08-19 00:06:27
|
Revision: 1799 http://yake.svn.sourceforge.net/yake/?rev=1799&view=rev Author: psyclonist Date: 2007-08-18 17:06:26 -0700 (Sat, 18 Aug 2007) Log Message: ----------- * [manual] clarifications Modified Paths: -------------- trunk/yake/documentation/manual/yake-manual.txt Modified: trunk/yake/documentation/manual/yake-manual.txt =================================================================== --- trunk/yake/documentation/manual/yake-manual.txt 2007-08-18 23:54:05 UTC (rev 1798) +++ trunk/yake/documentation/manual/yake-manual.txt 2007-08-19 00:06:26 UTC (rev 1799) @@ -842,6 +842,11 @@ registered with Lua. Therefore not all types may be available as parameters. If you use an unsupported type execution will stop and an error will be reported. + Note, that the available list of types can be extended by + registering a so-called "any convert". + The register_any_converter<T>() function does all the hard work. + As a side-effect all of the types registered in this fashion are + also automatically available in the yake.property library Lua bindings. Scheduler/Executor .................. @@ -852,7 +857,7 @@ wait(12) --waits 12 application time units before continuing execution print("after") -Schedule a function to be executed after a certain time:: +Schedule a function to be executed after a certain time ('sched' is the scheduler object):: function callback() print("callback triggered") @@ -1043,5 +1048,5 @@ * Forum (http://www.yake.org/forum/ ) * IRC (irc://freenode.net/#yake) -* E-Mail, Instant Messaging, Skype etc. The details are available at the website. +* E-Mail, Jabber, Skype etc. Up-to-date details are available on the website. * Website: http://www.yake.org/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-08-19 00:06:46
|
Revision: 1800 http://yake.svn.sourceforge.net/yake/?rev=1800&view=rev Author: psyclonist Date: 2007-08-18 17:06:49 -0700 (Sat, 18 Aug 2007) Log Message: ----------- * [manual] version 0.7.x Modified Paths: -------------- trunk/yake/documentation/manual/yake-manual.txt Modified: trunk/yake/documentation/manual/yake-manual.txt =================================================================== --- trunk/yake/documentation/manual/yake-manual.txt 2007-08-19 00:06:26 UTC (rev 1799) +++ trunk/yake/documentation/manual/yake-manual.txt 2007-08-19 00:06:49 UTC (rev 1800) @@ -1,5 +1,5 @@ +++++++++++++++++ -Yake 0.6.x Manual +Yake 0.7.x Manual +++++++++++++++++ .. |date| date:: %d %b %Y This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2008-05-20 21:32:19
|
Revision: 1921 http://yake.svn.sourceforge.net/yake/?rev=1921&view=rev Author: psyclonist Date: 2008-05-20 14:32:17 -0700 (Tue, 20 May 2008) Log Message: ----------- * updated manual Modified Paths: -------------- trunk/yake/documentation/manual/yake-manual.txt Modified: trunk/yake/documentation/manual/yake-manual.txt =================================================================== --- trunk/yake/documentation/manual/yake-manual.txt 2008-05-20 21:31:45 UTC (rev 1920) +++ trunk/yake/documentation/manual/yake-manual.txt 2008-05-20 21:32:17 UTC (rev 1921) @@ -85,20 +85,25 @@ Requirements ------------ -1. a recent C++ compiler (for example, MSVC 7.1/8.0 or GCC 3.3+/4.x) +The following are the minimum requirements for building the Yake core. + +1. a recent C++ compiler (for example, MSVC 8.0/9.0 or GCC 3.4/4.2) 2. a good standard template library (STL) -3. boost 1.32.x or above (certain selected libraries are used) +3. boost 1.35.x or above (certain selected libraries are used) For specific components/plugins additional dependencies may be required. -1. ODE 0.7/0.8 for physicsODE -#. OGRE 1.3/1.4 for graphicsOGRE -#. Lua 5.x for scriptingLua, entLua etc -#. Luabind (0.7+1, i.e. SVN) for scriptingLua, entLua etc +1. OGRE 1.4 for 'graphicsOGRE' +#. ODE 0.7/0.8 for 'physicsODE' +#. OIS for inputOIS (included in OGRE SDK) +#. Lua 5.1.x for the Lua bindings +#. Luabind (0.7+, preferrably SVN trunk) for the Lua bindings + For MSVC 9.0 we use a patched version. Changes are available. #. CEGUI 0.5.x for graphical UI +#. TinyXML 2.5.x for 'data' +#. FMOD ? SDK for audioFMOD #. OpenAL 1.1 SDK for audioOpenAL #. OpenAL++ for audioOpenAL -#. TinyXML 2.5.x for data #. Enet 1.0.x for networking Supported platforms: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |