瀏覽代碼

Update Lua API.

Aster Jian 12 年之前
父節點
當前提交
008480cb27
共有 94 個文件被更改,包括 4853 次插入1343 次删除
  1. 1 1
      Extras/LuaScript/AudioLuaAPI.cpp
  2. 311 80
      Extras/LuaScript/ContainerLuaAPI.cpp
  3. 119 16
      Extras/LuaScript/CoreLuaAPI.cpp
  4. 1 1
      Extras/LuaScript/CoreLuaAPI.h
  5. 1 1
      Extras/LuaScript/EngineLuaAPI.cpp
  6. 334 10
      Extras/LuaScript/GraphicsLuaAPI.cpp
  7. 1 1
      Extras/LuaScript/IOLuaAPI.cpp
  8. 1 1
      Extras/LuaScript/InputLuaAPI.cpp
  9. 1 1
      Extras/LuaScript/LuaScriptLuaAPI.cpp
  10. 776 37
      Extras/LuaScript/MathLuaAPI.cpp
  11. 47 22
      Extras/LuaScript/NavigationLuaAPI.cpp
  12. 8 1
      Extras/LuaScript/NavigationLuaAPI.h
  13. 1 1
      Extras/LuaScript/NetworkLuaAPI.cpp
  14. 67 1
      Extras/LuaScript/PhysicsLuaAPI.cpp
  15. 159 134
      Extras/LuaScript/Pkgs/Container/Str.pkg
  16. 8 9
      Extras/LuaScript/Pkgs/Core/ProcessUtils.pkg
  17. 0 27
      Extras/LuaScript/Pkgs/Core/StringUtils.pkg
  18. 1 1
      Extras/LuaScript/Pkgs/Core/Variant.pkg
  19. 6 6
      Extras/LuaScript/Pkgs/Graphics/AnimationState.pkg
  20. 7 4
      Extras/LuaScript/Pkgs/Graphics/BillboardSet.pkg
  21. 13 13
      Extras/LuaScript/Pkgs/Graphics/Camera.pkg
  22. 10 0
      Extras/LuaScript/Pkgs/Graphics/DebugRenderer.pkg
  23. 5 5
      Extras/LuaScript/Pkgs/Graphics/DecalSet.pkg
  24. 24 24
      Extras/LuaScript/Pkgs/Graphics/Drawable.pkg
  25. 17 17
      Extras/LuaScript/Pkgs/Graphics/Light.pkg
  26. 9 7
      Extras/LuaScript/Pkgs/Graphics/Material.pkg
  27. 4 4
      Extras/LuaScript/Pkgs/Graphics/Model.pkg
  28. 1 1
      Extras/LuaScript/Pkgs/Graphics/Octree.pkg
  29. 29 28
      Extras/LuaScript/Pkgs/Graphics/ParticleEmitter.pkg
  30. 33 33
      Extras/LuaScript/Pkgs/Graphics/Renderer.pkg
  31. 4 4
      Extras/LuaScript/Pkgs/Graphics/StaticModel.pkg
  32. 17 17
      Extras/LuaScript/Pkgs/Graphics/Terrain.pkg
  33. 8 8
      Extras/LuaScript/Pkgs/Graphics/TerrainPatch.pkg
  34. 4 4
      Extras/LuaScript/Pkgs/IO/File.pkg
  35. 1 1
      Extras/LuaScript/Pkgs/IO/FileSystem.pkg
  36. 3 3
      Extras/LuaScript/Pkgs/IO/Log.pkg
  37. 5 5
      Extras/LuaScript/Pkgs/IO/PackageFile.pkg
  38. 40 16
      Extras/LuaScript/Pkgs/Input/Input.pkg
  39. 5 9
      Extras/LuaScript/Pkgs/Math/AreaAllocator.pkg
  40. 169 49
      Extras/LuaScript/Pkgs/Math/BoundingBox.pkg
  41. 64 18
      Extras/LuaScript/Pkgs/Math/Color.pkg
  42. 86 21
      Extras/LuaScript/Pkgs/Math/Frustum.pkg
  43. 46 16
      Extras/LuaScript/Pkgs/Math/MathDefs.pkg
  44. 187 18
      Extras/LuaScript/Pkgs/Math/Matrix3.pkg
  45. 265 24
      Extras/LuaScript/Pkgs/Math/Matrix3x4.pkg
  46. 307 24
      Extras/LuaScript/Pkgs/Math/Matrix4.pkg
  47. 31 9
      Extras/LuaScript/Pkgs/Math/Plane.pkg
  48. 26 26
      Extras/LuaScript/Pkgs/Math/Polyhedron.pkg
  49. 108 43
      Extras/LuaScript/Pkgs/Math/Quaternion.pkg
  50. 29 26
      Extras/LuaScript/Pkgs/Math/Ray.pkg
  51. 98 22
      Extras/LuaScript/Pkgs/Math/Rect.pkg
  52. 110 30
      Extras/LuaScript/Pkgs/Math/Sphere.pkg
  53. 28 11
      Extras/LuaScript/Pkgs/Math/StringHash.pkg
  54. 83 32
      Extras/LuaScript/Pkgs/Math/Vector2.pkg
  55. 68 21
      Extras/LuaScript/Pkgs/Math/Vector3.pkg
  56. 41 16
      Extras/LuaScript/Pkgs/Math/Vector4.pkg
  57. 1 1
      Extras/LuaScript/Pkgs/Navigation/Navigable.pkg
  58. 22 18
      Extras/LuaScript/Pkgs/Navigation/NavigationMesh.pkg
  59. 3 2
      Extras/LuaScript/Pkgs/Navigation/OffMeshConnection.pkg
  60. 7 7
      Extras/LuaScript/Pkgs/Network/Connection.pkg
  61. 13 4
      Extras/LuaScript/Pkgs/Network/Controls.pkg
  62. 2 2
      Extras/LuaScript/Pkgs/Network/Network.pkg
  63. 4 4
      Extras/LuaScript/Pkgs/Network/NetworkPriority.pkg
  64. 8 8
      Extras/LuaScript/Pkgs/Physics/CollisionShape.pkg
  65. 13 13
      Extras/LuaScript/Pkgs/Physics/Constraint.pkg
  66. 12 12
      Extras/LuaScript/Pkgs/Physics/RigidBody.pkg
  67. 8 5
      Extras/LuaScript/Pkgs/Resource/Image.pkg
  68. 4 5
      Extras/LuaScript/Pkgs/Resource/Resource.pkg
  69. 7 3
      Extras/LuaScript/Pkgs/Scene/Component.pkg
  70. 51 21
      Extras/LuaScript/Pkgs/Scene/Node.pkg
  71. 9 9
      Extras/LuaScript/Pkgs/Scene/Scene.pkg
  72. 11 9
      Extras/LuaScript/Pkgs/UI/BorderImage.pkg
  73. 6 4
      Extras/LuaScript/Pkgs/UI/Button.pkg
  74. 4 2
      Extras/LuaScript/Pkgs/UI/CheckBox.pkg
  75. 3 2
      Extras/LuaScript/Pkgs/UI/Cursor.pkg
  76. 6 4
      Extras/LuaScript/Pkgs/UI/DropDownList.pkg
  77. 14 12
      Extras/LuaScript/Pkgs/UI/FileSelector.pkg
  78. 2 0
      Extras/LuaScript/Pkgs/UI/Font.pkg
  79. 13 11
      Extras/LuaScript/Pkgs/UI/LineEdit.pkg
  80. 8 6
      Extras/LuaScript/Pkgs/UI/ListView.pkg
  81. 7 4
      Extras/LuaScript/Pkgs/UI/Menu.pkg
  82. 7 5
      Extras/LuaScript/Pkgs/UI/ScrollBar.pkg
  83. 10 8
      Extras/LuaScript/Pkgs/UI/ScrollView.pkg
  84. 8 6
      Extras/LuaScript/Pkgs/UI/Slider.pkg
  85. 7 8
      Extras/LuaScript/Pkgs/UI/Sprite.pkg
  86. 15 13
      Extras/LuaScript/Pkgs/UI/Text.pkg
  87. 4 4
      Extras/LuaScript/Pkgs/UI/Text3D.pkg
  88. 6 6
      Extras/LuaScript/Pkgs/UI/UI.pkg
  89. 48 49
      Extras/LuaScript/Pkgs/UI/UIElement.pkg
  90. 9 7
      Extras/LuaScript/Pkgs/UI/Window.pkg
  91. 13 14
      Extras/LuaScript/ResourceLuaAPI.cpp
  92. 71 3
      Extras/LuaScript/SceneLuaAPI.cpp
  93. 480 80
      Extras/LuaScript/UILuaAPI.cpp
  94. 109 12
      Extras/LuaScript/UILuaAPI.h

+ 1 - 1
Extras/LuaScript/AudioLuaAPI.cpp

@@ -1,6 +1,6 @@
 /*
 ** Lua binding: Audio
-** Generated automatically by tolua++-1.0.92 on 06/30/13 11:31:48.
+** Generated automatically by tolua++-1.0.92 on 07/02/13 20:27:48.
 */
 
 //

+ 311 - 80
Extras/LuaScript/ContainerLuaAPI.cpp

@@ -1,6 +1,6 @@
 /*
 ** Lua binding: Container
-** Generated automatically by tolua++-1.0.92 on 06/30/13 11:31:48.
+** Generated automatically by tolua++-1.0.92 on 07/02/13 20:27:48.
 */
 
 //
@@ -41,6 +41,13 @@ using namespace Urho3D;
 /* function to release collected object via destructor */
 #ifdef __cplusplus
 
+static int tolua_collect_Vector_String_ (lua_State* tolua_S)
+{
+ Vector<String>* self = (Vector<String>*) tolua_tousertype(tolua_S,1,0);
+  Mtolua_delete(self);
+  return 0;
+}
+
 static int tolua_collect_String (lua_State* tolua_S)
 {
  String* self = (String*) tolua_tousertype(tolua_S,1,0);
@@ -53,6 +60,7 @@ static int tolua_collect_String (lua_State* tolua_S)
 /* function to register type */
 static void tolua_reg_types (lua_State* tolua_S)
 {
+ tolua_usertype(tolua_S,"Vector<String>");
  tolua_usertype(tolua_S,"String");
 }
 
@@ -223,16 +231,14 @@ static int tolua_Container_String_new03(lua_State* tolua_S)
  if (
      !tolua_isusertable(tolua_S,1,"String",0,&tolua_err) ||
      !tolua_isstring(tolua_S,2,0,&tolua_err) ||
-     !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
-     !tolua_isnoobj(tolua_S,4,&tolua_err)
+     !tolua_isnoobj(tolua_S,3,&tolua_err)
  )
   goto tolua_lerror;
  else
  {
-  const char* str = ((const char*)  tolua_tostring(tolua_S,2,0));
-  unsigned length = ((unsigned)  tolua_tonumber(tolua_S,3,0));
+  char* str = ((char*)  tolua_tostring(tolua_S,2,0));
   {
-   String* tolua_ret = (String*)  Mtolua_new((String)(str,length));
+   String* tolua_ret = (String*)  Mtolua_new((String)(str));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
   }
  }
@@ -250,16 +256,14 @@ static int tolua_Container_String_new03_local(lua_State* tolua_S)
  if (
      !tolua_isusertable(tolua_S,1,"String",0,&tolua_err) ||
      !tolua_isstring(tolua_S,2,0,&tolua_err) ||
-     !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
-     !tolua_isnoobj(tolua_S,4,&tolua_err)
+     !tolua_isnoobj(tolua_S,3,&tolua_err)
  )
   goto tolua_lerror;
  else
  {
-  const char* str = ((const char*)  tolua_tostring(tolua_S,2,0));
-  unsigned length = ((unsigned)  tolua_tonumber(tolua_S,3,0));
+  char* str = ((char*)  tolua_tostring(tolua_S,2,0));
   {
-   String* tolua_ret = (String*)  Mtolua_new((String)(str,length));
+   String* tolua_ret = (String*)  Mtolua_new((String)(str));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
     tolua_register_gc(tolua_S,lua_gettop(tolua_S));
   }
@@ -277,15 +281,17 @@ static int tolua_Container_String_new04(lua_State* tolua_S)
  tolua_Error tolua_err;
  if (
      !tolua_isusertable(tolua_S,1,"String",0,&tolua_err) ||
-     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
-     !tolua_isnoobj(tolua_S,3,&tolua_err)
+     !tolua_isstring(tolua_S,2,0,&tolua_err) ||
+     !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,4,&tolua_err)
  )
   goto tolua_lerror;
  else
  {
-  int value = ((int)  tolua_tonumber(tolua_S,2,0));
+  const char* str = ((const char*)  tolua_tostring(tolua_S,2,0));
+  unsigned length = ((unsigned)  tolua_tonumber(tolua_S,3,0));
   {
-   String* tolua_ret = (String*)  Mtolua_new((String)(value));
+   String* tolua_ret = (String*)  Mtolua_new((String)(str,length));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
   }
  }
@@ -302,15 +308,17 @@ static int tolua_Container_String_new04_local(lua_State* tolua_S)
  tolua_Error tolua_err;
  if (
      !tolua_isusertable(tolua_S,1,"String",0,&tolua_err) ||
-     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
-     !tolua_isnoobj(tolua_S,3,&tolua_err)
+     !tolua_isstring(tolua_S,2,0,&tolua_err) ||
+     !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,4,&tolua_err)
  )
   goto tolua_lerror;
  else
  {
-  int value = ((int)  tolua_tonumber(tolua_S,2,0));
+  const char* str = ((const char*)  tolua_tostring(tolua_S,2,0));
+  unsigned length = ((unsigned)  tolua_tonumber(tolua_S,3,0));
   {
-   String* tolua_ret = (String*)  Mtolua_new((String)(value));
+   String* tolua_ret = (String*)  Mtolua_new((String)(str,length));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
     tolua_register_gc(tolua_S,lua_gettop(tolua_S));
   }
@@ -334,7 +342,7 @@ static int tolua_Container_String_new05(lua_State* tolua_S)
   goto tolua_lerror;
  else
  {
-  short value = ((short)  tolua_tonumber(tolua_S,2,0));
+  int value = ((int)  tolua_tonumber(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -359,7 +367,7 @@ static int tolua_Container_String_new05_local(lua_State* tolua_S)
   goto tolua_lerror;
  else
  {
-  short value = ((short)  tolua_tonumber(tolua_S,2,0));
+  int value = ((int)  tolua_tonumber(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -385,7 +393,7 @@ static int tolua_Container_String_new06(lua_State* tolua_S)
   goto tolua_lerror;
  else
  {
-  long value = ((long)  tolua_tonumber(tolua_S,2,0));
+  short value = ((short)  tolua_tonumber(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -410,7 +418,7 @@ static int tolua_Container_String_new06_local(lua_State* tolua_S)
   goto tolua_lerror;
  else
  {
-  long value = ((long)  tolua_tonumber(tolua_S,2,0));
+  short value = ((short)  tolua_tonumber(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -436,7 +444,7 @@ static int tolua_Container_String_new07(lua_State* tolua_S)
   goto tolua_lerror;
  else
  {
-  long long value = ((long long)  tolua_tonumber(tolua_S,2,0));
+  long value = ((long)  tolua_tonumber(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -461,7 +469,7 @@ static int tolua_Container_String_new07_local(lua_State* tolua_S)
   goto tolua_lerror;
  else
  {
-  long long value = ((long long)  tolua_tonumber(tolua_S,2,0));
+  long value = ((long)  tolua_tonumber(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -487,7 +495,7 @@ static int tolua_Container_String_new08(lua_State* tolua_S)
   goto tolua_lerror;
  else
  {
-  unsigned value = ((unsigned)  tolua_tonumber(tolua_S,2,0));
+  long long value = ((long long)  tolua_tonumber(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -512,7 +520,7 @@ static int tolua_Container_String_new08_local(lua_State* tolua_S)
   goto tolua_lerror;
  else
  {
-  unsigned value = ((unsigned)  tolua_tonumber(tolua_S,2,0));
+  long long value = ((long long)  tolua_tonumber(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -538,7 +546,7 @@ static int tolua_Container_String_new09(lua_State* tolua_S)
   goto tolua_lerror;
  else
  {
-  unsigned short value = ((unsigned short)  tolua_tonumber(tolua_S,2,0));
+  unsigned value = ((unsigned)  tolua_tonumber(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -563,7 +571,7 @@ static int tolua_Container_String_new09_local(lua_State* tolua_S)
   goto tolua_lerror;
  else
  {
-  unsigned short value = ((unsigned short)  tolua_tonumber(tolua_S,2,0));
+  unsigned value = ((unsigned)  tolua_tonumber(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -589,7 +597,7 @@ static int tolua_Container_String_new10(lua_State* tolua_S)
   goto tolua_lerror;
  else
  {
-  unsigned long value = ((unsigned long)  tolua_tonumber(tolua_S,2,0));
+  unsigned short value = ((unsigned short)  tolua_tonumber(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -614,7 +622,7 @@ static int tolua_Container_String_new10_local(lua_State* tolua_S)
   goto tolua_lerror;
  else
  {
-  unsigned long value = ((unsigned long)  tolua_tonumber(tolua_S,2,0));
+  unsigned short value = ((unsigned short)  tolua_tonumber(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -640,7 +648,7 @@ static int tolua_Container_String_new11(lua_State* tolua_S)
   goto tolua_lerror;
  else
  {
-  unsigned long long value = ((unsigned long long)  tolua_tonumber(tolua_S,2,0));
+  unsigned long value = ((unsigned long)  tolua_tonumber(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -665,7 +673,7 @@ static int tolua_Container_String_new11_local(lua_State* tolua_S)
   goto tolua_lerror;
  else
  {
-  unsigned long long value = ((unsigned long long)  tolua_tonumber(tolua_S,2,0));
+  unsigned long value = ((unsigned long)  tolua_tonumber(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -691,7 +699,7 @@ static int tolua_Container_String_new12(lua_State* tolua_S)
   goto tolua_lerror;
  else
  {
-  float value = ((float)  tolua_tonumber(tolua_S,2,0));
+  unsigned long long value = ((unsigned long long)  tolua_tonumber(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -716,7 +724,7 @@ static int tolua_Container_String_new12_local(lua_State* tolua_S)
   goto tolua_lerror;
  else
  {
-  float value = ((float)  tolua_tonumber(tolua_S,2,0));
+  unsigned long long value = ((unsigned long long)  tolua_tonumber(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -742,7 +750,7 @@ static int tolua_Container_String_new13(lua_State* tolua_S)
   goto tolua_lerror;
  else
  {
-  double value = ((double)  tolua_tonumber(tolua_S,2,0));
+  float value = ((float)  tolua_tonumber(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -767,7 +775,7 @@ static int tolua_Container_String_new13_local(lua_State* tolua_S)
   goto tolua_lerror;
  else
  {
-  double value = ((double)  tolua_tonumber(tolua_S,2,0));
+  float value = ((float)  tolua_tonumber(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -787,13 +795,13 @@ static int tolua_Container_String_new14(lua_State* tolua_S)
  tolua_Error tolua_err;
  if (
      !tolua_isusertable(tolua_S,1,"String",0,&tolua_err) ||
-     !tolua_isboolean(tolua_S,2,0,&tolua_err) ||
+     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
      !tolua_isnoobj(tolua_S,3,&tolua_err)
  )
   goto tolua_lerror;
  else
  {
-  bool value = ((bool)  tolua_toboolean(tolua_S,2,0));
+  double value = ((double)  tolua_tonumber(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -812,13 +820,13 @@ static int tolua_Container_String_new14_local(lua_State* tolua_S)
  tolua_Error tolua_err;
  if (
      !tolua_isusertable(tolua_S,1,"String",0,&tolua_err) ||
-     !tolua_isboolean(tolua_S,2,0,&tolua_err) ||
+     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
      !tolua_isnoobj(tolua_S,3,&tolua_err)
  )
   goto tolua_lerror;
  else
  {
-  bool value = ((bool)  tolua_toboolean(tolua_S,2,0));
+  double value = ((double)  tolua_tonumber(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -838,13 +846,13 @@ static int tolua_Container_String_new15(lua_State* tolua_S)
  tolua_Error tolua_err;
  if (
      !tolua_isusertable(tolua_S,1,"String",0,&tolua_err) ||
-     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
+     !tolua_isboolean(tolua_S,2,0,&tolua_err) ||
      !tolua_isnoobj(tolua_S,3,&tolua_err)
  )
   goto tolua_lerror;
  else
  {
-  char value = ((char)  tolua_tonumber(tolua_S,2,0));
+  bool value = ((bool)  tolua_toboolean(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -863,13 +871,13 @@ static int tolua_Container_String_new15_local(lua_State* tolua_S)
  tolua_Error tolua_err;
  if (
      !tolua_isusertable(tolua_S,1,"String",0,&tolua_err) ||
-     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
+     !tolua_isboolean(tolua_S,2,0,&tolua_err) ||
      !tolua_isnoobj(tolua_S,3,&tolua_err)
  )
   goto tolua_lerror;
  else
  {
-  char value = ((char)  tolua_tonumber(tolua_S,2,0));
+  bool value = ((bool)  tolua_toboolean(tolua_S,2,0));
   {
    String* tolua_ret = (String*)  Mtolua_new((String)(value));
     tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
@@ -885,6 +893,57 @@ tolua_lerror:
 /* method: new of class  String */
 #ifndef TOLUA_DISABLE_tolua_Container_String_new16
 static int tolua_Container_String_new16(lua_State* tolua_S)
+{
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertable(tolua_S,1,"String",0,&tolua_err) ||
+     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,3,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+ {
+  char value = ((char)  tolua_tonumber(tolua_S,2,0));
+  {
+   String* tolua_ret = (String*)  Mtolua_new((String)(value));
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
+  }
+ }
+ return 1;
+tolua_lerror:
+ return tolua_Container_String_new15(tolua_S);
+}
+#endif //#ifndef TOLUA_DISABLE
+
+/* method: new_local of class  String */
+#ifndef TOLUA_DISABLE_tolua_Container_String_new16_local
+static int tolua_Container_String_new16_local(lua_State* tolua_S)
+{
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertable(tolua_S,1,"String",0,&tolua_err) ||
+     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,3,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+ {
+  char value = ((char)  tolua_tonumber(tolua_S,2,0));
+  {
+   String* tolua_ret = (String*)  Mtolua_new((String)(value));
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"String");
+    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
+  }
+ }
+ return 1;
+tolua_lerror:
+ return tolua_Container_String_new15_local(tolua_S);
+}
+#endif //#ifndef TOLUA_DISABLE
+
+/* method: new of class  String */
+#ifndef TOLUA_DISABLE_tolua_Container_String_new17
+static int tolua_Container_String_new17(lua_State* tolua_S)
 {
  tolua_Error tolua_err;
  if (
@@ -905,13 +964,13 @@ static int tolua_Container_String_new16(lua_State* tolua_S)
  }
  return 1;
 tolua_lerror:
- return tolua_Container_String_new15(tolua_S);
+ return tolua_Container_String_new16(tolua_S);
 }
 #endif //#ifndef TOLUA_DISABLE
 
 /* method: new_local of class  String */
-#ifndef TOLUA_DISABLE_tolua_Container_String_new16_local
-static int tolua_Container_String_new16_local(lua_State* tolua_S)
+#ifndef TOLUA_DISABLE_tolua_Container_String_new17_local
+static int tolua_Container_String_new17_local(lua_State* tolua_S)
 {
  tolua_Error tolua_err;
  if (
@@ -933,7 +992,7 @@ static int tolua_Container_String_new16_local(lua_State* tolua_S)
  }
  return 1;
 tolua_lerror:
- return tolua_Container_String_new15_local(tolua_S);
+ return tolua_Container_String_new16_local(tolua_S);
 }
 #endif //#ifndef TOLUA_DISABLE
 
@@ -1214,6 +1273,102 @@ tolua_lerror:
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* method: operator&[] of class  String */
+#ifndef TOLUA_DISABLE_tolua_Container_String__seti00
+static int tolua_Container_String__seti00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertype(tolua_S,1,"String",0,&tolua_err) ||
+     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
+     !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,4,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  String* self = (String*)  tolua_tousertype(tolua_S,1,0);
+  unsigned index = ((unsigned)  tolua_tonumber(tolua_S,2,0));
+  char tolua_value = ((char)  tolua_tonumber(tolua_S,3,0));
+#ifndef TOLUA_RELEASE
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'operator&[]'", NULL);
+#endif
+  self->operator[](index) =  tolua_value;
+ }
+ return 0;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function '.seti'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
+/* method: operator[] of class  String */
+#ifndef TOLUA_DISABLE_tolua_Container_String__geti00
+static int tolua_Container_String__geti00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertype(tolua_S,1,"String",0,&tolua_err) ||
+     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,3,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  String* self = (String*)  tolua_tousertype(tolua_S,1,0);
+  unsigned index = ((unsigned)  tolua_tonumber(tolua_S,2,0));
+#ifndef TOLUA_RELEASE
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'operator[]'", NULL);
+#endif
+  {
+   char tolua_ret = (char)  self->operator[](index);
+   tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function '.geti'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
+/* method: operator[] of class  String */
+#ifndef TOLUA_DISABLE_tolua_Container_String__geti01
+static int tolua_Container_String__geti01(lua_State* tolua_S)
+{
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertype(tolua_S,1,"const String",0,&tolua_err) ||
+     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,3,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+ {
+  const String* self = (const String*)  tolua_tousertype(tolua_S,1,0);
+  unsigned index = ((unsigned)  tolua_tonumber(tolua_S,2,0));
+#ifndef TOLUA_RELEASE
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'operator[]'", NULL);
+#endif
+  {
+   const char tolua_ret = (const char)  self->operator[](index);
+   tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
+  }
+ }
+ return 1;
+tolua_lerror:
+ return tolua_Container_String__geti00(tolua_S);
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: At of class  String */
 #ifndef TOLUA_DISABLE_tolua_Container_String_At00
 static int tolua_Container_String_At00(lua_State* tolua_S)
@@ -2120,6 +2275,85 @@ static int tolua_Container_String_ToLower00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* method: Split of class  String */
+#ifndef TOLUA_DISABLE_tolua_Container_String_Split00
+static int tolua_Container_String_Split00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertype(tolua_S,1,"const String",0,&tolua_err) ||
+     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,3,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  const String* self = (const String*)  tolua_tousertype(tolua_S,1,0);
+  char separator = ((char)  tolua_tonumber(tolua_S,2,0));
+#ifndef TOLUA_RELEASE
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Split'", NULL);
+#endif
+  {
+   Vector<String> tolua_ret = (Vector<String>)  self->Split(separator);
+   {
+#ifdef __cplusplus
+    void* tolua_obj = Mtolua_new((Vector<String>)(tolua_ret));
+     tolua_pushusertype(tolua_S,tolua_obj,"Vector<String>");
+    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
+#else
+    void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(Vector<String>));
+     tolua_pushusertype(tolua_S,tolua_obj,"Vector<String>");
+    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
+#endif
+   }
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'Split'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
+/* method: Join of class  String */
+#ifndef TOLUA_DISABLE_tolua_Container_String_Join00
+static int tolua_Container_String_Join00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertype(tolua_S,1,"String",0,&tolua_err) ||
+     (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const Vector<String>",0,&tolua_err)) ||
+     (tolua_isvaluenil(tolua_S,3,&tolua_err) || !tolua_isusertype(tolua_S,3,"String",0,&tolua_err)) ||
+     !tolua_isnoobj(tolua_S,4,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  String* self = (String*)  tolua_tousertype(tolua_S,1,0);
+  const Vector<String>* subStrings = ((const Vector<String>*)  tolua_tousertype(tolua_S,2,0));
+  String glue = *((String*)  tolua_tousertype(tolua_S,3,0));
+#ifndef TOLUA_RELEASE
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Join'", NULL);
+#endif
+  {
+   self->Join(*subStrings,glue);
+  }
+ }
+ return 0;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'Join'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: Find of class  String */
 #ifndef TOLUA_DISABLE_tolua_Container_String_Find00
 static int tolua_Container_String_Find00(lua_State* tolua_S)
@@ -2612,36 +2846,6 @@ static int tolua_Container_String_ToHash00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
-/* method: CStringLength of class  String */
-#ifndef TOLUA_DISABLE_tolua_Container_String_CStringLength00
-static int tolua_Container_String_CStringLength00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
-     !tolua_isusertable(tolua_S,1,"String",0,&tolua_err) ||
-     !tolua_isstring(tolua_S,2,0,&tolua_err) ||
-     !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
-  goto tolua_lerror;
- else
-#endif
- {
-  const char* str = ((const char*)  tolua_tostring(tolua_S,2,0));
-  {
-   unsigned tolua_ret = (unsigned)  String::CStringLength(str);
-   tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
-  }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'CStringLength'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
 /* method: Compare of class  String */
 #ifndef TOLUA_DISABLE_tolua_Container_String_Compare02
 static int tolua_Container_String_Compare02(lua_State* tolua_S)
@@ -2671,6 +2875,24 @@ tolua_lerror:
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* get function: NPOS of class  String */
+#ifndef TOLUA_DISABLE_tolua_get_String_NPOS
+static int tolua_get_String_NPOS(lua_State* tolua_S)
+{
+  tolua_pushnumber(tolua_S,(lua_Number)String::NPOS);
+ return 1;
+}
+#endif //#ifndef TOLUA_DISABLE
+
+/* get function: MIN_CAPACITY of class  String */
+#ifndef TOLUA_DISABLE_tolua_get_String_MIN_CAPACITY
+static int tolua_get_String_MIN_CAPACITY(lua_State* tolua_S)
+{
+  tolua_pushnumber(tolua_S,(lua_Number)String::MIN_CAPACITY);
+ return 1;
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* get function: EMPTY of class  String */
 #ifndef TOLUA_DISABLE_tolua_get_String_EMPTY
 static int tolua_get_String_EMPTY(lua_State* tolua_S)
@@ -2744,6 +2966,9 @@ TOLUA_API int tolua_Container_open (lua_State* tolua_S)
    tolua_function(tolua_S,"new",tolua_Container_String_new16);
    tolua_function(tolua_S,"new_local",tolua_Container_String_new16_local);
    tolua_function(tolua_S,".call",tolua_Container_String_new16_local);
+   tolua_function(tolua_S,"new",tolua_Container_String_new17);
+   tolua_function(tolua_S,"new_local",tolua_Container_String_new17_local);
+   tolua_function(tolua_S,".call",tolua_Container_String_new17_local);
    tolua_function(tolua_S,"delete",tolua_Container_String_delete00);
    tolua_function(tolua_S,".add",tolua_Container_String__add00);
    tolua_function(tolua_S,".add",tolua_Container_String__add01);
@@ -2752,6 +2977,9 @@ TOLUA_API int tolua_Container_open (lua_State* tolua_S)
    tolua_function(tolua_S,".lt",tolua_Container_String__lt00);
    tolua_function(tolua_S,".eq",tolua_Container_String__eq01);
    tolua_function(tolua_S,".lt",tolua_Container_String__lt01);
+   tolua_function(tolua_S,".seti",tolua_Container_String__seti00);
+   tolua_function(tolua_S,".geti",tolua_Container_String__geti00);
+   tolua_function(tolua_S,".geti",tolua_Container_String__geti01);
    tolua_function(tolua_S,"At",tolua_Container_String_At00);
    tolua_function(tolua_S,"At",tolua_Container_String_At01);
    tolua_function(tolua_S,"Replace",tolua_Container_String_Replace00);
@@ -2778,6 +3006,8 @@ TOLUA_API int tolua_Container_open (lua_State* tolua_S)
    tolua_function(tolua_S,"Trimmed",tolua_Container_String_Trimmed00);
    tolua_function(tolua_S,"ToUpper",tolua_Container_String_ToUpper00);
    tolua_function(tolua_S,"ToLower",tolua_Container_String_ToLower00);
+   tolua_function(tolua_S,"Split",tolua_Container_String_Split00);
+   tolua_function(tolua_S,"Join",tolua_Container_String_Join00);
    tolua_function(tolua_S,"Find",tolua_Container_String_Find00);
    tolua_function(tolua_S,"Find",tolua_Container_String_Find01);
    tolua_function(tolua_S,"FindLast",tolua_Container_String_FindLast00);
@@ -2793,8 +3023,9 @@ TOLUA_API int tolua_Container_open (lua_State* tolua_S)
    tolua_function(tolua_S,"Contains",tolua_Container_String_Contains00);
    tolua_function(tolua_S,"Contains",tolua_Container_String_Contains01);
    tolua_function(tolua_S,"ToHash",tolua_Container_String_ToHash00);
-   tolua_function(tolua_S,"CStringLength",tolua_Container_String_CStringLength00);
    tolua_function(tolua_S,"Compare",tolua_Container_String_Compare02);
+   tolua_variable(tolua_S,"NPOS",tolua_get_String_NPOS,NULL);
+   tolua_variable(tolua_S,"MIN_CAPACITY",tolua_get_String_MIN_CAPACITY,NULL);
    tolua_variable(tolua_S,"EMPTY",tolua_get_String_EMPTY,NULL);
   tolua_endmodule(tolua_S);
  tolua_endmodule(tolua_S);

+ 119 - 16
Extras/LuaScript/CoreLuaAPI.cpp

@@ -1,6 +1,6 @@
 /*
 ** Lua binding: Core
-** Generated automatically by tolua++-1.0.92 on 06/30/13 11:31:49.
+** Generated automatically by tolua++-1.0.92 on 07/02/13 20:27:48.
 */
 
 //
@@ -58,9 +58,9 @@ static int tolua_collect_IntRect (lua_State* tolua_S)
   return 0;
 }
 
-static int tolua_collect_String (lua_State* tolua_S)
+static int tolua_collect_Vector4 (lua_State* tolua_S)
 {
- String* self = (String*) tolua_tousertype(tolua_S,1,0);
+ Vector4* self = (Vector4*) tolua_tousertype(tolua_S,1,0);
   Mtolua_delete(self);
   return 0;
 }
@@ -128,16 +128,16 @@ static int tolua_collect_Timer (lua_State* tolua_S)
   return 0;
 }
 
-static int tolua_collect_Vector4 (lua_State* tolua_S)
+static int tolua_collect_Vector3 (lua_State* tolua_S)
 {
- Vector4* self = (Vector4*) tolua_tousertype(tolua_S,1,0);
+ Vector3* self = (Vector3*) tolua_tousertype(tolua_S,1,0);
   Mtolua_delete(self);
   return 0;
 }
 
-static int tolua_collect_Vector3 (lua_State* tolua_S)
+static int tolua_collect_String (lua_State* tolua_S)
 {
- Vector3* self = (Vector3*) tolua_tousertype(tolua_S,1,0);
+ String* self = (String*) tolua_tousertype(tolua_S,1,0);
   Mtolua_delete(self);
   return 0;
 }
@@ -157,23 +157,50 @@ static void tolua_reg_types (lua_State* tolua_S)
  tolua_usertype(tolua_S,"VariantMap");
  tolua_usertype(tolua_S,"String");
  tolua_usertype(tolua_S,"Color");
+ tolua_usertype(tolua_S,"Vector<String>");
  tolua_usertype(tolua_S,"Time");
  tolua_usertype(tolua_S,"Variant");
  tolua_usertype(tolua_S,"Vector3");
  tolua_usertype(tolua_S,"IntRect");
  tolua_usertype(tolua_S,"Object");
- tolua_usertype(tolua_S,"Quaternion");
+ tolua_usertype(tolua_S,"ResourceRef");
  tolua_usertype(tolua_S,"StringHash");
- tolua_usertype(tolua_S,"Vector4");
+ tolua_usertype(tolua_S,"Quaternion");
  tolua_usertype(tolua_S,"Rect");
  tolua_usertype(tolua_S,"ResourceRefList");
  tolua_usertype(tolua_S,"Vector2");
  tolua_usertype(tolua_S,"Timer");
- tolua_usertype(tolua_S,"ResourceRef");
  tolua_usertype(tolua_S,"ShortStringHash");
+ tolua_usertype(tolua_S,"Vector4");
  tolua_usertype(tolua_S,"IntVector2");
 }
 
+/* function: InitFPU */
+#ifndef TOLUA_DISABLE_tolua_Core_InitFPU00
+static int tolua_Core_InitFPU00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isnoobj(tolua_S,1,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  {
+   InitFPU();
+  }
+ }
+ return 0;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'InitFPU'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* function: ErrorDialog */
 #ifndef TOLUA_DISABLE_tolua_Core_ErrorDialog00
 static int tolua_Core_ErrorDialog00(lua_State* tolua_S)
@@ -290,7 +317,71 @@ static int tolua_Core_PrintLine00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
-/* function: GetPlatformCString */
+/* function: GetArguments */
+#ifndef TOLUA_DISABLE_tolua_Core_GetArguments00
+static int tolua_Core_GetArguments00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isnoobj(tolua_S,1,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  {
+   const Vector<String>& tolua_ret = (const Vector<String>&)  GetArguments();
+    tolua_pushusertype(tolua_S,(void*)&tolua_ret,"const Vector<String>");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'GetArguments'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
+/* function: GetConsoleInput */
+#ifndef TOLUA_DISABLE_tolua_Core_GetConsoleInput00
+static int tolua_Core_GetConsoleInput00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isnoobj(tolua_S,1,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  {
+   String tolua_ret = (String)  GetConsoleInput();
+   {
+#ifdef __cplusplus
+    void* tolua_obj = Mtolua_new((String)(tolua_ret));
+     tolua_pushusertype(tolua_S,tolua_obj,"String");
+    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
+#else
+    void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(String));
+     tolua_pushusertype(tolua_S,tolua_obj,"String");
+    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
+#endif
+   }
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'GetConsoleInput'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
+/* function: GetPlatform */
 #ifndef TOLUA_DISABLE_tolua_Core_GetPlatform00
 static int tolua_Core_GetPlatform00(lua_State* tolua_S)
 {
@@ -304,8 +395,18 @@ static int tolua_Core_GetPlatform00(lua_State* tolua_S)
 #endif
  {
   {
-   const char* tolua_ret = (const char*)  GetPlatformCString();
-   tolua_pushstring(tolua_S,(const char*)tolua_ret);
+   String tolua_ret = (String)  GetPlatform();
+   {
+#ifdef __cplusplus
+    void* tolua_obj = Mtolua_new((String)(tolua_ret));
+     tolua_pushusertype(tolua_S,tolua_obj,"String");
+    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
+#else
+    void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(String));
+     tolua_pushusertype(tolua_S,tolua_obj,"String");
+    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
+#endif
+   }
   }
  }
  return 1;
@@ -5118,16 +5219,15 @@ static int tolua_Core_VariantMap_SetPtr00(lua_State* tolua_S)
  {
   VariantMap* self = (VariantMap*)  tolua_tousertype(tolua_S,1,0);
   const char* key = ((const char*)  tolua_tostring(tolua_S,2,0));
-  const void* value = ((const void*)  tolua_touserdata(tolua_S,3,0));
+  void* value = ((void*)  tolua_touserdata(tolua_S,3,0));
 #ifndef TOLUA_RELEASE
   if (!self) tolua_error(tolua_S,"invalid 'self' in function 'VariantMapSetPtr'", NULL);
 #endif
   {
    VariantMapSetPtr(self,key,value);
-   tolua_pushuserdata(tolua_S,(void*)value);
   }
  }
- return 1;
+ return 0;
 #ifndef TOLUA_RELEASE
  tolua_lerror:
  tolua_error(tolua_S,"#ferror in function 'SetPtr'.",&tolua_err);
@@ -5560,10 +5660,13 @@ TOLUA_API int tolua_Core_open (lua_State* tolua_S)
  tolua_reg_types(tolua_S);
  tolua_module(tolua_S,NULL,0);
  tolua_beginmodule(tolua_S,NULL);
+  tolua_function(tolua_S,"InitFPU",tolua_Core_InitFPU00);
   tolua_function(tolua_S,"ErrorDialog",tolua_Core_ErrorDialog00);
   tolua_function(tolua_S,"ErrorExit",tolua_Core_ErrorExit00);
   tolua_function(tolua_S,"OpenConsoleWindow",tolua_Core_OpenConsoleWindow00);
   tolua_function(tolua_S,"PrintLine",tolua_Core_PrintLine00);
+  tolua_function(tolua_S,"GetArguments",tolua_Core_GetArguments00);
+  tolua_function(tolua_S,"GetConsoleInput",tolua_Core_GetConsoleInput00);
   tolua_function(tolua_S,"GetPlatform",tolua_Core_GetPlatform00);
   tolua_function(tolua_S,"GetNumPhysicalCPUs",tolua_Core_GetNumPhysicalCPUs00);
   tolua_function(tolua_S,"GetNumLogicalCPUs",tolua_Core_GetNumLogicalCPUs00);

+ 1 - 1
Extras/LuaScript/CoreLuaAPI.h

@@ -139,7 +139,7 @@ namespace Urho3D
     {
         (*vmap)[ShortStringHash(key)] = value;
     }
-    void VariantMapSetPtr(VariantMap* vmap, const char* key, const void* value)
+    void VariantMapSetPtr(VariantMap* vmap, const char* key, void* value)
     {
         (*vmap)[ShortStringHash(key)] = value;
     }

+ 1 - 1
Extras/LuaScript/EngineLuaAPI.cpp

@@ -1,6 +1,6 @@
 /*
 ** Lua binding: Engine
-** Generated automatically by tolua++-1.0.92 on 06/30/13 11:31:49.
+** Generated automatically by tolua++-1.0.92 on 07/02/13 20:27:48.
 */
 
 //

+ 334 - 10
Extras/LuaScript/GraphicsLuaAPI.cpp

@@ -1,6 +1,6 @@
 /*
 ** Lua binding: Graphics
-** Generated automatically by tolua++-1.0.92 on 06/30/13 11:31:49.
+** Generated automatically by tolua++-1.0.92 on 07/02/13 20:27:49.
 */
 
 //
@@ -160,6 +160,7 @@ static void tolua_reg_types (lua_State* tolua_S)
  tolua_usertype(tolua_S,"ColorFrame");
  tolua_usertype(tolua_S,"Octant");
  tolua_usertype(tolua_S,"Component");
+ tolua_usertype(tolua_S,"SharedPtr<Texture>");
  tolua_usertype(tolua_S,"Node");
  tolua_usertype(tolua_S,"Light");
  tolua_usertype(tolua_S,"Pass");
@@ -189,6 +190,7 @@ static void tolua_reg_types (lua_State* tolua_S)
  tolua_usertype(tolua_S,"Bone");
  tolua_usertype(tolua_S,"Renderer");
  tolua_usertype(tolua_S,"Vector3");
+ tolua_usertype(tolua_S,"Billboard");
  tolua_usertype(tolua_S,"Terrain");
  tolua_usertype(tolua_S,"AnimationState");
  tolua_usertype(tolua_S,"ModelMorph");
@@ -197,32 +199,32 @@ static void tolua_reg_types (lua_State* tolua_S)
  tolua_usertype(tolua_S,"TextureFrame");
  tolua_usertype(tolua_S,"Geometry");
  tolua_usertype(tolua_S,"Quaternion");
- tolua_usertype(tolua_S,"Resource");
+ tolua_usertype(tolua_S,"AnimatedModel");
  tolua_usertype(tolua_S,"OctreeQuery");
  tolua_usertype(tolua_S,"Zone");
  tolua_usertype(tolua_S,"RenderSurface");
  tolua_usertype(tolua_S,"TextureCube");
  tolua_usertype(tolua_S,"Texture");
  tolua_usertype(tolua_S,"Drawable");
- tolua_usertype(tolua_S,"BiasParameters");
- tolua_usertype(tolua_S,"DebugRenderer");
  tolua_usertype(tolua_S,"TerrainPatch");
+ tolua_usertype(tolua_S,"DebugRenderer");
+ tolua_usertype(tolua_S,"BiasParameters");
  tolua_usertype(tolua_S,"ShaderVariation");
  tolua_usertype(tolua_S,"BoundingBox");
- tolua_usertype(tolua_S,"Rect");
- tolua_usertype(tolua_S,"AnimationTrack");
  tolua_usertype(tolua_S,"Viewport");
+ tolua_usertype(tolua_S,"AnimationTrack");
  tolua_usertype(tolua_S,"Technique");
  tolua_usertype(tolua_S,"Skybox");
- tolua_usertype(tolua_S,"AnimatedModel");
+ tolua_usertype(tolua_S,"Octree");
+ tolua_usertype(tolua_S,"StringHash");
  tolua_usertype(tolua_S,"BillboardSet");
  tolua_usertype(tolua_S,"Polyhedron");
  tolua_usertype(tolua_S,"RayOctreeQuery");
- tolua_usertype(tolua_S,"Octree");
- tolua_usertype(tolua_S,"StringHash");
- tolua_usertype(tolua_S,"FocusParameters");
+ tolua_usertype(tolua_S,"Rect");
  tolua_usertype(tolua_S,"XMLFile");
+ tolua_usertype(tolua_S,"FocusParameters");
  tolua_usertype(tolua_S,"Matrix4");
+ tolua_usertype(tolua_S,"Resource");
  tolua_usertype(tolua_S,"RenderPath");
  tolua_usertype(tolua_S,"Model");
 }
@@ -3308,6 +3310,40 @@ static int tolua_Graphics_BillboardSet_GetNumBillboards00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* method: GetBillboard of class  BillboardSet */
+#ifndef TOLUA_DISABLE_tolua_Graphics_BillboardSet_GetBillboard00
+static int tolua_Graphics_BillboardSet_GetBillboard00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertype(tolua_S,1,"BillboardSet",0,&tolua_err) ||
+     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,3,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  BillboardSet* self = (BillboardSet*)  tolua_tousertype(tolua_S,1,0);
+  unsigned index = ((unsigned)  tolua_tonumber(tolua_S,2,0));
+#ifndef TOLUA_RELEASE
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetBillboard'", NULL);
+#endif
+  {
+   Billboard* tolua_ret = (Billboard*)  self->GetBillboard(index);
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"Billboard");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'GetBillboard'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: IsRelative of class  BillboardSet */
 #ifndef TOLUA_DISABLE_tolua_Graphics_BillboardSet_IsRelative00
 static int tolua_Graphics_BillboardSet_IsRelative00(lua_State* tolua_S)
@@ -3436,6 +3472,33 @@ static int tolua_Graphics_BillboardSet_GetAnimationLodBias00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* method: GetAnimationLodBias of class  BillboardSet */
+#ifndef TOLUA_DISABLE_tolua_Graphics_BillboardSet_GetAnimationLodBias01
+static int tolua_Graphics_BillboardSet_GetAnimationLodBias01(lua_State* tolua_S)
+{
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertype(tolua_S,1,"const BillboardSet",0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,2,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+ {
+  const BillboardSet* self = (const BillboardSet*)  tolua_tousertype(tolua_S,1,0);
+#ifndef TOLUA_RELEASE
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetAnimationLodBias'", NULL);
+#endif
+  {
+   float tolua_ret = (float)  self->GetAnimationLodBias();
+   tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
+  }
+ }
+ return 1;
+tolua_lerror:
+ return tolua_Graphics_BillboardSet_GetAnimationLodBias00(tolua_S);
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: SetNearClip of class  Camera */
 #ifndef TOLUA_DISABLE_tolua_Graphics_Camera_SetNearClip00
 static int tolua_Graphics_Camera_SetNearClip00(lua_State* tolua_S)
@@ -5108,6 +5171,39 @@ static int tolua_Graphics_Camera_IsProjectionValid00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* method: SetView of class  DebugRenderer */
+#ifndef TOLUA_DISABLE_tolua_Graphics_DebugRenderer_SetView00
+static int tolua_Graphics_DebugRenderer_SetView00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertype(tolua_S,1,"DebugRenderer",0,&tolua_err) ||
+     !tolua_isusertype(tolua_S,2,"Camera",0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,3,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  DebugRenderer* self = (DebugRenderer*)  tolua_tousertype(tolua_S,1,0);
+  Camera* camera = ((Camera*)  tolua_tousertype(tolua_S,2,0));
+#ifndef TOLUA_RELEASE
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetView'", NULL);
+#endif
+  {
+   self->SetView(camera);
+  }
+ }
+ return 0;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'SetView'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: AddLine of class  DebugRenderer */
 #ifndef TOLUA_DISABLE_tolua_Graphics_DebugRenderer_AddLine00
 static int tolua_Graphics_DebugRenderer_AddLine00(lua_State* tolua_S)
@@ -5437,6 +5533,136 @@ static int tolua_Graphics_DebugRenderer_AddSkeleton00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* method: GetView of class  DebugRenderer */
+#ifndef TOLUA_DISABLE_tolua_Graphics_DebugRenderer_GetView00
+static int tolua_Graphics_DebugRenderer_GetView00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertype(tolua_S,1,"const DebugRenderer",0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,2,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  const DebugRenderer* self = (const DebugRenderer*)  tolua_tousertype(tolua_S,1,0);
+#ifndef TOLUA_RELEASE
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetView'", NULL);
+#endif
+  {
+   const Matrix3x4& tolua_ret = (const Matrix3x4&)  self->GetView();
+    tolua_pushusertype(tolua_S,(void*)&tolua_ret,"const Matrix3x4");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'GetView'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
+/* method: GetProjection of class  DebugRenderer */
+#ifndef TOLUA_DISABLE_tolua_Graphics_DebugRenderer_GetProjection00
+static int tolua_Graphics_DebugRenderer_GetProjection00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertype(tolua_S,1,"const DebugRenderer",0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,2,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  const DebugRenderer* self = (const DebugRenderer*)  tolua_tousertype(tolua_S,1,0);
+#ifndef TOLUA_RELEASE
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetProjection'", NULL);
+#endif
+  {
+   const Matrix4& tolua_ret = (const Matrix4&)  self->GetProjection();
+    tolua_pushusertype(tolua_S,(void*)&tolua_ret,"const Matrix4");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'GetProjection'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
+/* method: GetFrustum of class  DebugRenderer */
+#ifndef TOLUA_DISABLE_tolua_Graphics_DebugRenderer_GetFrustum00
+static int tolua_Graphics_DebugRenderer_GetFrustum00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertype(tolua_S,1,"const DebugRenderer",0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,2,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  const DebugRenderer* self = (const DebugRenderer*)  tolua_tousertype(tolua_S,1,0);
+#ifndef TOLUA_RELEASE
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetFrustum'", NULL);
+#endif
+  {
+   const Frustum& tolua_ret = (const Frustum&)  self->GetFrustum();
+    tolua_pushusertype(tolua_S,(void*)&tolua_ret,"const Frustum");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'GetFrustum'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
+/* method: IsInside of class  DebugRenderer */
+#ifndef TOLUA_DISABLE_tolua_Graphics_DebugRenderer_IsInside00
+static int tolua_Graphics_DebugRenderer_IsInside00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertype(tolua_S,1,"const DebugRenderer",0,&tolua_err) ||
+     (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const BoundingBox",0,&tolua_err)) ||
+     !tolua_isnoobj(tolua_S,3,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  const DebugRenderer* self = (const DebugRenderer*)  tolua_tousertype(tolua_S,1,0);
+  const BoundingBox* box = ((const BoundingBox*)  tolua_tousertype(tolua_S,2,0));
+#ifndef TOLUA_RELEASE
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'IsInside'", NULL);
+#endif
+  {
+   bool tolua_ret = (bool)  self->IsInside(*box);
+   tolua_pushboolean(tolua_S,(bool)tolua_ret);
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'IsInside'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* function: GetDebugRenderer */
 #ifndef TOLUA_DISABLE_tolua_Graphics_GetDebugRenderer00
 static int tolua_Graphics_GetDebugRenderer00(lua_State* tolua_S)
@@ -9295,6 +9521,38 @@ static int tolua_Graphics_Material_GetTexture00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* method: GetTextures of class  Material */
+#ifndef TOLUA_DISABLE_tolua_Graphics_Material_GetTextures00
+static int tolua_Graphics_Material_GetTextures00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertype(tolua_S,1,"const Material",0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,2,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  const Material* self = (const Material*)  tolua_tousertype(tolua_S,1,0);
+#ifndef TOLUA_RELEASE
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetTextures'", NULL);
+#endif
+  {
+   const SharedPtr<Texture>* tolua_ret = (const SharedPtr<Texture>*)  self->GetTextures();
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"const SharedPtr<Texture>");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'GetTextures'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: GetShaderParameter of class  Material */
 #ifndef TOLUA_DISABLE_tolua_Graphics_Material_GetShaderParameter00
 static int tolua_Graphics_Material_GetShaderParameter00(lua_State* tolua_S)
@@ -12786,6 +13044,35 @@ static int tolua_Graphics_ParticleEmitter_GetTextureFrame00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* method: GetTextureFrame of class  ParticleEmitter */
+#ifndef TOLUA_DISABLE_tolua_Graphics_ParticleEmitter_GetTextureFrame01
+static int tolua_Graphics_ParticleEmitter_GetTextureFrame01(lua_State* tolua_S)
+{
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertype(tolua_S,1,"ParticleEmitter",0,&tolua_err) ||
+     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,3,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+ {
+  ParticleEmitter* self = (ParticleEmitter*)  tolua_tousertype(tolua_S,1,0);
+  unsigned index = ((unsigned)  tolua_tonumber(tolua_S,2,0));
+#ifndef TOLUA_RELEASE
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetTextureFrame'", NULL);
+#endif
+  {
+   TextureFrame* tolua_ret = (TextureFrame*)  self->GetTextureFrame(index);
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"TextureFrame");
+  }
+ }
+ return 1;
+tolua_lerror:
+ return tolua_Graphics_ParticleEmitter_GetTextureFrame00(tolua_S);
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: SetNumViewports of class  Renderer */
 #ifndef TOLUA_DISABLE_tolua_Graphics_Renderer_SetNumViewports00
 static int tolua_Graphics_Renderer_SetNumViewports00(lua_State* tolua_S)
@@ -18220,6 +18507,33 @@ static int tolua_Graphics_TerrainPatch_GetOcclusionOffset00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* method: GetOcclusionOffset of class  TerrainPatch */
+#ifndef TOLUA_DISABLE_tolua_Graphics_TerrainPatch_GetOcclusionOffset01
+static int tolua_Graphics_TerrainPatch_GetOcclusionOffset01(lua_State* tolua_S)
+{
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertype(tolua_S,1,"const TerrainPatch",0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,2,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+ {
+  const TerrainPatch* self = (const TerrainPatch*)  tolua_tousertype(tolua_S,1,0);
+#ifndef TOLUA_RELEASE
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetOcclusionOffset'", NULL);
+#endif
+  {
+   float tolua_ret = (float)  self->GetOcclusionOffset();
+   tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
+  }
+ }
+ return 1;
+tolua_lerror:
+ return tolua_Graphics_TerrainPatch_GetOcclusionOffset00(tolua_S);
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: SetNumLevels of class  Texture */
 #ifndef TOLUA_DISABLE_tolua_Graphics_Texture_SetNumLevels00
 static int tolua_Graphics_Texture_SetNumLevels00(lua_State* tolua_S)
@@ -19749,10 +20063,12 @@ TOLUA_API int tolua_Graphics_open (lua_State* tolua_S)
    tolua_function(tolua_S,"Commit",tolua_Graphics_BillboardSet_Commit00);
    tolua_function(tolua_S,"GetMaterial",tolua_Graphics_BillboardSet_GetMaterial00);
    tolua_function(tolua_S,"GetNumBillboards",tolua_Graphics_BillboardSet_GetNumBillboards00);
+   tolua_function(tolua_S,"GetBillboard",tolua_Graphics_BillboardSet_GetBillboard00);
    tolua_function(tolua_S,"IsRelative",tolua_Graphics_BillboardSet_IsRelative00);
    tolua_function(tolua_S,"IsScaled",tolua_Graphics_BillboardSet_IsScaled00);
    tolua_function(tolua_S,"IsSorted",tolua_Graphics_BillboardSet_IsSorted00);
    tolua_function(tolua_S,"GetAnimationLodBias",tolua_Graphics_BillboardSet_GetAnimationLodBias00);
+   tolua_function(tolua_S,"GetAnimationLodBias",tolua_Graphics_BillboardSet_GetAnimationLodBias01);
   tolua_endmodule(tolua_S);
   tolua_cclass(tolua_S,"Camera","Camera","Component",NULL);
   tolua_beginmodule(tolua_S,"Camera");
@@ -19807,6 +20123,7 @@ TOLUA_API int tolua_Graphics_open (lua_State* tolua_S)
   tolua_endmodule(tolua_S);
   tolua_cclass(tolua_S,"DebugRenderer","DebugRenderer","Component",NULL);
   tolua_beginmodule(tolua_S,"DebugRenderer");
+   tolua_function(tolua_S,"SetView",tolua_Graphics_DebugRenderer_SetView00);
    tolua_function(tolua_S,"AddLine",tolua_Graphics_DebugRenderer_AddLine00);
    tolua_function(tolua_S,"AddLine",tolua_Graphics_DebugRenderer_AddLine01);
    tolua_function(tolua_S,"AddNode",tolua_Graphics_DebugRenderer_AddNode00);
@@ -19816,6 +20133,10 @@ TOLUA_API int tolua_Graphics_open (lua_State* tolua_S)
    tolua_function(tolua_S,"AddPolyhedron",tolua_Graphics_DebugRenderer_AddPolyhedron00);
    tolua_function(tolua_S,"AddSphere",tolua_Graphics_DebugRenderer_AddSphere00);
    tolua_function(tolua_S,"AddSkeleton",tolua_Graphics_DebugRenderer_AddSkeleton00);
+   tolua_function(tolua_S,"GetView",tolua_Graphics_DebugRenderer_GetView00);
+   tolua_function(tolua_S,"GetProjection",tolua_Graphics_DebugRenderer_GetProjection00);
+   tolua_function(tolua_S,"GetFrustum",tolua_Graphics_DebugRenderer_GetFrustum00);
+   tolua_function(tolua_S,"IsInside",tolua_Graphics_DebugRenderer_IsInside00);
   tolua_endmodule(tolua_S);
   tolua_function(tolua_S,"GetDebugRenderer",tolua_Graphics_GetDebugRenderer00);
   tolua_cclass(tolua_S,"DecalSet","DecalSet","Drawable",NULL);
@@ -20074,6 +20395,7 @@ TOLUA_API int tolua_Graphics_open (lua_State* tolua_S)
    tolua_function(tolua_S,"GetTechnique",tolua_Graphics_Material_GetTechnique00);
    tolua_function(tolua_S,"GetPass",tolua_Graphics_Material_GetPass00);
    tolua_function(tolua_S,"GetTexture",tolua_Graphics_Material_GetTexture00);
+   tolua_function(tolua_S,"GetTextures",tolua_Graphics_Material_GetTextures00);
    tolua_function(tolua_S,"GetShaderParameter",tolua_Graphics_Material_GetShaderParameter00);
    tolua_function(tolua_S,"GetCullMode",tolua_Graphics_Material_GetCullMode00);
    tolua_function(tolua_S,"GetShadowCullMode",tolua_Graphics_Material_GetShadowCullMode00);
@@ -20211,6 +20533,7 @@ TOLUA_API int tolua_Graphics_open (lua_State* tolua_S)
    tolua_function(tolua_S,"GetColor",tolua_Graphics_ParticleEmitter_GetColor00);
    tolua_function(tolua_S,"GetNumTextureFrames",tolua_Graphics_ParticleEmitter_GetNumTextureFrames00);
    tolua_function(tolua_S,"GetTextureFrame",tolua_Graphics_ParticleEmitter_GetTextureFrame00);
+   tolua_function(tolua_S,"GetTextureFrame",tolua_Graphics_ParticleEmitter_GetTextureFrame01);
   tolua_endmodule(tolua_S);
   tolua_cclass(tolua_S,"Renderer","Renderer","",NULL);
   tolua_beginmodule(tolua_S,"Renderer");
@@ -20411,6 +20734,7 @@ TOLUA_API int tolua_Graphics_open (lua_State* tolua_S)
    tolua_function(tolua_S,"GetCoordinates",tolua_Graphics_TerrainPatch_GetCoordinates00);
    tolua_function(tolua_S,"GetLodLevel",tolua_Graphics_TerrainPatch_GetLodLevel00);
    tolua_function(tolua_S,"GetOcclusionOffset",tolua_Graphics_TerrainPatch_GetOcclusionOffset00);
+   tolua_function(tolua_S,"GetOcclusionOffset",tolua_Graphics_TerrainPatch_GetOcclusionOffset01);
   tolua_endmodule(tolua_S);
   tolua_cclass(tolua_S,"Texture","Texture","Resource",NULL);
   tolua_beginmodule(tolua_S,"Texture");

+ 1 - 1
Extras/LuaScript/IOLuaAPI.cpp

@@ -1,6 +1,6 @@
 /*
 ** Lua binding: IO
-** Generated automatically by tolua++-1.0.92 on 06/30/13 11:31:50.
+** Generated automatically by tolua++-1.0.92 on 07/02/13 20:27:49.
 */
 
 //

+ 1 - 1
Extras/LuaScript/InputLuaAPI.cpp

@@ -1,6 +1,6 @@
 /*
 ** Lua binding: Input
-** Generated automatically by tolua++-1.0.92 on 06/30/13 11:31:50.
+** Generated automatically by tolua++-1.0.92 on 07/02/13 20:27:49.
 */
 
 //

+ 1 - 1
Extras/LuaScript/LuaScriptLuaAPI.cpp

@@ -1,6 +1,6 @@
 /*
 ** Lua binding: LuaScript
-** Generated automatically by tolua++-1.0.92 on 06/30/13 11:31:52.
+** Generated automatically by tolua++-1.0.92 on 07/02/13 20:27:51.
 */
 
 //

文件差異過大導致無法顯示
+ 776 - 37
Extras/LuaScript/MathLuaAPI.cpp


+ 47 - 22
Extras/LuaScript/NavigationLuaAPI.cpp

@@ -1,6 +1,6 @@
 /*
 ** Lua binding: Navigation
-** Generated automatically by tolua++-1.0.92 on 06/30/13 11:31:51.
+** Generated automatically by tolua++-1.0.92 on 07/02/13 20:27:50.
 */
 
 //
@@ -63,6 +63,13 @@ static int tolua_collect_Vector3 (lua_State* tolua_S)
   Mtolua_delete(self);
   return 0;
 }
+
+static int tolua_collect_PODVector_Vector3_ (lua_State* tolua_S)
+{
+ PODVector<Vector3>* self = (PODVector<Vector3>*) tolua_tousertype(tolua_S,1,0);
+  Mtolua_delete(self);
+  return 0;
+}
 #endif
 
 
@@ -790,7 +797,7 @@ tolua_lerror:
 }
 #endif //#ifndef TOLUA_DISABLE
 
-/* method: FindPath of class  NavigationMesh */
+/* method: NavigationMeshFindPath of class  NavigationMesh */
 #ifndef TOLUA_DISABLE_tolua_Navigation_NavigationMesh_FindPath00
 static int tolua_Navigation_NavigationMesh_FindPath00(lua_State* tolua_S)
 {
@@ -798,27 +805,36 @@ static int tolua_Navigation_NavigationMesh_FindPath00(lua_State* tolua_S)
  tolua_Error tolua_err;
  if (
      !tolua_isusertype(tolua_S,1,"NavigationMesh",0,&tolua_err) ||
-     (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"PODVector<Vector3>",0,&tolua_err)) ||
+     (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const Vector3",0,&tolua_err)) ||
      (tolua_isvaluenil(tolua_S,3,&tolua_err) || !tolua_isusertype(tolua_S,3,"const Vector3",0,&tolua_err)) ||
-     (tolua_isvaluenil(tolua_S,4,&tolua_err) || !tolua_isusertype(tolua_S,4,"const Vector3",0,&tolua_err)) ||
-     !tolua_isnoobj(tolua_S,5,&tolua_err)
+     !tolua_isnoobj(tolua_S,4,&tolua_err)
  )
   goto tolua_lerror;
  else
 #endif
  {
   NavigationMesh* self = (NavigationMesh*)  tolua_tousertype(tolua_S,1,0);
-  PODVector<Vector3>* dest = ((PODVector<Vector3>*)  tolua_tousertype(tolua_S,2,0));
-  const Vector3* start = ((const Vector3*)  tolua_tousertype(tolua_S,3,0));
-  const Vector3* end = ((const Vector3*)  tolua_tousertype(tolua_S,4,0));
+  const Vector3* start = ((const Vector3*)  tolua_tousertype(tolua_S,2,0));
+  const Vector3* end = ((const Vector3*)  tolua_tousertype(tolua_S,3,0));
 #ifndef TOLUA_RELEASE
-  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'FindPath'", NULL);
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'NavigationMeshFindPath'", NULL);
 #endif
   {
-   self->FindPath(*dest,*start,*end);
+   tolua_outside PODVector<Vector3> tolua_ret = (tolua_outside PODVector<Vector3>)  NavigationMeshFindPath(self,*start,*end);
+   {
+#ifdef __cplusplus
+    void* tolua_obj = Mtolua_new((PODVector<Vector3>)(tolua_ret));
+     tolua_pushusertype(tolua_S,tolua_obj,"PODVector<Vector3>");
+    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
+#else
+    void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(PODVector<Vector3>));
+     tolua_pushusertype(tolua_S,tolua_obj,"PODVector<Vector3>");
+    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
+#endif
+   }
   }
  }
- return 0;
+ return 1;
 #ifndef TOLUA_RELEASE
  tolua_lerror:
  tolua_error(tolua_S,"#ferror in function 'FindPath'.",&tolua_err);
@@ -827,35 +843,44 @@ static int tolua_Navigation_NavigationMesh_FindPath00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
-/* method: FindPath of class  NavigationMesh */
+/* method: NavigationMeshFindPath of class  NavigationMesh */
 #ifndef TOLUA_DISABLE_tolua_Navigation_NavigationMesh_FindPath01
 static int tolua_Navigation_NavigationMesh_FindPath01(lua_State* tolua_S)
 {
  tolua_Error tolua_err;
  if (
      !tolua_isusertype(tolua_S,1,"NavigationMesh",0,&tolua_err) ||
-     (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"PODVector<Vector3>",0,&tolua_err)) ||
+     (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const Vector3",0,&tolua_err)) ||
      (tolua_isvaluenil(tolua_S,3,&tolua_err) || !tolua_isusertype(tolua_S,3,"const Vector3",0,&tolua_err)) ||
      (tolua_isvaluenil(tolua_S,4,&tolua_err) || !tolua_isusertype(tolua_S,4,"const Vector3",0,&tolua_err)) ||
-     (tolua_isvaluenil(tolua_S,5,&tolua_err) || !tolua_isusertype(tolua_S,5,"const Vector3",0,&tolua_err)) ||
-     !tolua_isnoobj(tolua_S,6,&tolua_err)
+     !tolua_isnoobj(tolua_S,5,&tolua_err)
  )
   goto tolua_lerror;
  else
  {
   NavigationMesh* self = (NavigationMesh*)  tolua_tousertype(tolua_S,1,0);
-  PODVector<Vector3>* dest = ((PODVector<Vector3>*)  tolua_tousertype(tolua_S,2,0));
-  const Vector3* start = ((const Vector3*)  tolua_tousertype(tolua_S,3,0));
-  const Vector3* end = ((const Vector3*)  tolua_tousertype(tolua_S,4,0));
-  const Vector3* extents = ((const Vector3*)  tolua_tousertype(tolua_S,5,0));
+  const Vector3* start = ((const Vector3*)  tolua_tousertype(tolua_S,2,0));
+  const Vector3* end = ((const Vector3*)  tolua_tousertype(tolua_S,3,0));
+  const Vector3* extents = ((const Vector3*)  tolua_tousertype(tolua_S,4,0));
 #ifndef TOLUA_RELEASE
-  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'FindPath'", NULL);
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'NavigationMeshFindPath'", NULL);
 #endif
   {
-   self->FindPath(*dest,*start,*end,*extents);
+   tolua_outside PODVector<Vector3> tolua_ret = (tolua_outside PODVector<Vector3>)  NavigationMeshFindPath(self,*start,*end,*extents);
+   {
+#ifdef __cplusplus
+    void* tolua_obj = Mtolua_new((PODVector<Vector3>)(tolua_ret));
+     tolua_pushusertype(tolua_S,tolua_obj,"PODVector<Vector3>");
+    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
+#else
+    void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(PODVector<Vector3>));
+     tolua_pushusertype(tolua_S,tolua_obj,"PODVector<Vector3>");
+    tolua_register_gc(tolua_S,lua_gettop(tolua_S));
+#endif
+   }
   }
  }
- return 0;
+ return 1;
 tolua_lerror:
  return tolua_Navigation_NavigationMesh_FindPath00(tolua_S);
 }

+ 8 - 1
Extras/LuaScript/NavigationLuaAPI.h

@@ -22,7 +22,14 @@
 
 #pragma once
 
+#include "NavigationMesh.h"
+
 namespace Urho3D
 {
-
+	PODVector<Vector3> NavigationMeshFindPath(NavigationMesh* navMesh, const Vector3& start, const Vector3& end, const Vector3& extents = Vector3::ONE)
+	{
+		PODVector<Vector3> dest;
+		navMesh->FindPath(dest, start, end, extents);
+		return dest;
+	}
 }

+ 1 - 1
Extras/LuaScript/NetworkLuaAPI.cpp

@@ -1,6 +1,6 @@
 /*
 ** Lua binding: Network
-** Generated automatically by tolua++-1.0.92 on 06/30/13 11:31:51.
+** Generated automatically by tolua++-1.0.92 on 07/02/13 20:27:50.
 */
 
 //

+ 67 - 1
Extras/LuaScript/PhysicsLuaAPI.cpp

@@ -1,6 +1,6 @@
 /*
 ** Lua binding: Physics
-** Generated automatically by tolua++-1.0.92 on 06/30/13 11:31:51.
+** Generated automatically by tolua++-1.0.92 on 07/02/13 20:27:50.
 */
 
 //
@@ -5454,6 +5454,38 @@ static int tolua_Physics_RigidBody_GetLinearRestThreshold00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* method: GetLinearDamping of class  RigidBody */
+#ifndef TOLUA_DISABLE_tolua_Physics_RigidBody_GetLinearDamping00
+static int tolua_Physics_RigidBody_GetLinearDamping00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertype(tolua_S,1,"const RigidBody",0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,2,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  const RigidBody* self = (const RigidBody*)  tolua_tousertype(tolua_S,1,0);
+#ifndef TOLUA_RELEASE
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetLinearDamping'", NULL);
+#endif
+  {
+   float tolua_ret = (float)  self->GetLinearDamping();
+   tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'GetLinearDamping'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: GetAngularVelocity of class  RigidBody */
 #ifndef TOLUA_DISABLE_tolua_Physics_RigidBody_GetAngularVelocity00
 static int tolua_Physics_RigidBody_GetAngularVelocity00(lua_State* tolua_S)
@@ -5570,6 +5602,38 @@ static int tolua_Physics_RigidBody_GetAngularRestThreshold00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* method: GetAngularDamping of class  RigidBody */
+#ifndef TOLUA_DISABLE_tolua_Physics_RigidBody_GetAngularDamping00
+static int tolua_Physics_RigidBody_GetAngularDamping00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertype(tolua_S,1,"const RigidBody",0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,2,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  const RigidBody* self = (const RigidBody*)  tolua_tousertype(tolua_S,1,0);
+#ifndef TOLUA_RELEASE
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetAngularDamping'", NULL);
+#endif
+  {
+   float tolua_ret = (float)  self->GetAngularDamping();
+   tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'GetAngularDamping'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: GetFriction of class  RigidBody */
 #ifndef TOLUA_DISABLE_tolua_Physics_RigidBody_GetFriction00
 static int tolua_Physics_RigidBody_GetFriction00(lua_State* tolua_S)
@@ -6419,9 +6483,11 @@ TOLUA_API int tolua_Physics_open (lua_State* tolua_S)
    tolua_function(tolua_S,"GetLinearFactor",tolua_Physics_RigidBody_GetLinearFactor00);
    tolua_function(tolua_S,"GetVelocityAtPoint",tolua_Physics_RigidBody_GetVelocityAtPoint00);
    tolua_function(tolua_S,"GetLinearRestThreshold",tolua_Physics_RigidBody_GetLinearRestThreshold00);
+   tolua_function(tolua_S,"GetLinearDamping",tolua_Physics_RigidBody_GetLinearDamping00);
    tolua_function(tolua_S,"GetAngularVelocity",tolua_Physics_RigidBody_GetAngularVelocity00);
    tolua_function(tolua_S,"GetAngularFactor",tolua_Physics_RigidBody_GetAngularFactor00);
    tolua_function(tolua_S,"GetAngularRestThreshold",tolua_Physics_RigidBody_GetAngularRestThreshold00);
+   tolua_function(tolua_S,"GetAngularDamping",tolua_Physics_RigidBody_GetAngularDamping00);
    tolua_function(tolua_S,"GetFriction",tolua_Physics_RigidBody_GetFriction00);
    tolua_function(tolua_S,"GetRestitution",tolua_Physics_RigidBody_GetRestitution00);
    tolua_function(tolua_S,"GetContactProcessingThreshold",tolua_Physics_RigidBody_GetContactProcessingThreshold00);

+ 159 - 134
Extras/LuaScript/Pkgs/Container/Str.pkg

@@ -5,209 +5,234 @@ class String
 {
 public:
     /// Construct empty.
-    String();
+    String() :
+        length_(0),
+        capacity_(0),
+        buffer_(&endZero)
+    {
+    }
     
     /// Construct from another string.
-    String(const String& str);
+    String(const String& str) :
+        length_(0),
+        capacity_(0),
+        buffer_(&endZero)
+    {
+        *this = str;
+    }
     
     /// Construct from a C string.
-    String(const char* str);
+    String(const char* str) :
+        length_(0),
+        capacity_(0),
+        buffer_(&endZero)
+    {
+        *this = str;
+    }
+    
+    /// Construct from a C string.
+    String(char* str) :
+        length_(0),
+        capacity_(0),
+        buffer_(&endZero)
+    {
+        *this = (const char*)str;
+    }
     
     /// Construct from a char array and length.
-    String(const char* str, unsigned length);
+    String(const char* str, unsigned length) :
+        length_(0),
+        capacity_(0),
+        buffer_(&endZero)
+    {
+        Resize(length);
+        CopyChars(buffer_, str, length);
+    }
     
     /// Construct from an integer.
     explicit String(int value);
-    
-	/// Construct from a short integer.
+    /// Construct from a short integer.
     explicit String(short value);
-    
-	/// Construct from a long integer.
+    /// Construct from a long integer.
     explicit String(long value);
-    
-	/// Construct from a long long integer.
+    /// Construct from a long long integer.
     explicit String(long long value);
-    
-	/// Construct from an unsigned integer.
+    /// Construct from an unsigned integer.
     explicit String(unsigned value);
-    
-	/// Construct from an unsigned short integer.
+    /// Construct from an unsigned short integer.
     explicit String(unsigned short value);
-    
-	/// Construct from an unsigned long integer.
+    /// Construct from an unsigned long integer.
     explicit String(unsigned long value);
-    
-	/// Construct from an unsigned long long integer.
+    /// Construct from an unsigned long long integer.
     explicit String(unsigned long long value);
-	
-	/// Construct from a float.
+    /// Construct from a float.
     explicit String(float value);
-    
-	/// Construct from a double.
+    /// Construct from a double.
     explicit String(double value);
-    
-	/// Construct from a bool.
+    /// Construct from a bool.
     explicit String(bool value);
-    
-	/// Construct from a character.
+    /// Construct from a character.
     explicit String(char value);
-    
-	/// Construct from a character and fill length.
+    /// Construct from a character and fill length.
     explicit String(char value, unsigned length);
     
-	/// Destruct.
-    ~String();
-  
+    /// Destruct.
+    ~String()
+    {
+        if (capacity_)
+            delete[] buffer_;
+    }
+    
     /// Add a string.
-    String operator + (const String& rhs) const;
+    String operator + (const String& rhs) const
+    {
+        String ret;
+        ret.Resize(length_ + rhs.length_);
+        CopyChars(ret.buffer_, buffer_, length_);
+        CopyChars(ret.buffer_ + length_, rhs.buffer_, rhs.length_);
+        
+        return ret;
+    }
     
     /// Add a C string.
-    String operator + (const char* rhs) const;
+    String operator + (const char* rhs) const
+    {
+        unsigned rhsLength = CStringLength(rhs);
+        String ret;
+        ret.Resize(length_ + rhsLength);
+        CopyChars(ret.buffer_, buffer_, length_);
+        CopyChars(ret.buffer_ + length_, rhs, rhsLength);
+        
+        return ret;
+    }
     
     /// Add a character.
-    String operator + (char rhs) const;
+    String operator + (char rhs) const
+    {
+        String ret(*this);
+        ret += rhs;
+        
+        return ret;
+    }
     
     /// Test for equality with another string.
-    bool operator == (const String& rhs) const;
-    
-	/// Test if string is less than another string.
-    bool operator < (const String& rhs) const;
-    
-	/// Test for equality with a C string.
-    bool operator == (const char* rhs) const;
-    
-	/// Test if string is less than a C string.
-    bool operator < (const char* rhs) const;
-    
-	/// Return char at index.
-    char& At(unsigned index);
-	
+    bool operator == (const String& rhs) const { return strcmp(CString(), rhs.CString()) == 0; }
+    /// Test if string is less than another string.
+    bool operator < (const String& rhs) const { return strcmp(CString(), rhs.CString()) < 0; }
+    bool operator == (const char* rhs) const { return strcmp(CString(), rhs) == 0; }
+    /// Test if string is less than a C string.
+    bool operator < (const char* rhs) const { return strcmp(CString(), rhs) < 0; }
+    /// Return char at index.
+    char& operator [] (unsigned index) { assert(index < length_); return buffer_[index]; }
+    /// Return const char at index.
+    const char& operator [] (unsigned index) const { assert(index < length_); return buffer_[index]; }
+    /// Return char at index.
+    char& At(unsigned index) { assert(index < length_); return buffer_[index]; }
     /// Return const char at index.
-    const char& At(unsigned index) const;
+    const char& At(unsigned index) const { assert(index < length_); return buffer_[index]; }
     
     /// Replace all occurrences of a character.
     void Replace(char replaceThis, char replaceWith);
-    
-	/// Replace all occurrences of a string.
+    /// Replace all occurrences of a string.
     void Replace(const String& replaceThis, const String& replaceWith);
-    
-	/// Replace a substring.
+    /// Replace a substring.
     void Replace(unsigned pos, unsigned length, const String& replaceWith);
-    
-	/// Return a string with all occurrences of a character replaced.
+    /// Return a string with all occurrences of a character replaced.
     String Replaced(char replaceThis, char replaceWith) const;
-    
-	/// Return a string with all occurrences of a string replaced.
+    /// Return a string with all occurrences of a string replaced.
     String Replaced(const String& replaceThis, const String& replaceWith) const;
-    
-	/// Append a string.
+    /// Append a string.
     String& Append(const String& str);
-    
-	/// Append a C string.
+    /// Append a C string.
     String& Append(const char* str);
-    
-	/// Append a character.
+    /// Append a character.
     String& Append(char c);
-    
-	/// Append characters.
+    /// Append characters.
     String& Append(const char* str, unsigned length);
-    
-	/// Insert a string.
+    /// Insert a string.
     void Insert(unsigned pos, const String& str);
-    
-	/// Insert a character.
+    /// Insert a character.
     void Insert(unsigned pos, char c);
-    
-	/// Erase a substring.
+    /// Erase a substring.
     void Erase(unsigned pos, unsigned length = 1);
-    
-	/// Resize the string.
+    /// Resize the string.
     void Resize(unsigned newLength);
-    
-	/// Set new capacity.
+    /// Set new capacity.
     void Reserve(unsigned newCapacity);
-    
-	/// Reallocate so that no extra memory is used.
+    /// Reallocate so that no extra memory is used.
     void Compact();
-    
-	/// Clear the string.
+    /// Clear the string.
     void Clear();
-    
-	/// Swap with another string.
+    /// Swap with another string.
     void Swap(String& str);
     
     /// Return first char, or 0 if empty.
-    char Front() const;
-    
-	/// Return last char, or 0 if empty.
-    char Back() const;
-    
-	/// Return a substring from position to end.
+    char Front() const { return buffer_[0]; }
+    /// Return last char, or 0 if empty.
+    char Back() const { return length_ ? buffer_[length_ - 1] : buffer_[0]; }
+    /// Return a substring from position to end.
     String Substring(unsigned pos) const;
-    
-	/// Return a substring with length from position.
+    /// Return a substring with length from position.
     String Substring(unsigned pos, unsigned length) const;
-    
-	/// Return string with whitespace trimmed from the beginning and the end.
+    /// Return string with whitespace trimmed from the beginning and the end.
     String Trimmed() const;
-    
-	/// Return string in uppercase.
+    /// Return string in uppercase.
     String ToUpper() const;
-    
-	/// Return string in lowercase.
+    /// Return string in lowercase.
     String ToLower() const;
-    
-	/// Return index to the first occurrence of a string, or NPOS if not found.
+    /// Return substrings split by a separator char.
+    Vector<String> Split(char separator) const;
+    /// Join substrings with a 'glue' string.
+    void Join(const Vector<String>& subStrings, String glue);
+    /// Return index to the first occurrence of a string, or NPOS if not found.
     unsigned Find(const String& str, unsigned startPos = 0) const;
-    
-	/// Return index to the first occurrence of a character, or NPOS if not found.
+    /// Return index to the first occurrence of a character, or NPOS if not found.
     unsigned Find(char c, unsigned startPos = 0) const;
-    
-	/// Return index to the last occurrence of a string, or NPOS if not found.
+    /// Return index to the last occurrence of a string, or NPOS if not found.
     unsigned FindLast(const String& str, unsigned startPos = String::NPOS) const;
-    
-	/// Return index to the last occurrence of a character, or NPOS if not found.
+    /// Return index to the last occurrence of a character, or NPOS if not found.
     unsigned FindLast(char c, unsigned startPos = String::NPOS) const;
-    
-	/// Return whether starts with a string.
+    /// Return whether starts with a string.
     bool StartsWith(const String& str) const;
-    
-	/// Return whether ends with a string.
+    /// Return whether ends with a string.
     bool EndsWith(const String& str) const;
-    
-	/// Return the C string.
-    const char* CString() const;
-    
-	/// Return length.
-    unsigned Length() const;
-    
-	/// Return buffer capacity.
-    unsigned Capacity() const;
-    
-	/// Return whether the string is empty.
-    bool Empty() const;
-    
-	/// Return comparision result with a string.
+    /// Return the C string.
+    const char* CString() const { return buffer_; }
+    /// Return length.
+    unsigned Length() const { return length_; }
+    /// Return buffer capacity.
+    unsigned Capacity() const { return capacity_; }
+    /// Return whether the string is empty.
+    bool Empty() const { return length_ == 0; }
+    /// Return comparision result with a string.
     int Compare(const String& str, bool caseSensitive = true) const;
-    
-	/// Return comparision result with a C string.
+    /// Return comparision result with a C string.
     int Compare(const char* str, bool caseSensitive = true) const;
-    
-	/// Return whether contains a specific occurences of string.
-    bool Contains(const String& str) const;
-    
-	/// Return whether contains a specific character.
-    bool Contains(char c) const;
+    /// Return whether contains a specific occurences of string.
+    bool Contains(const String& str) const { return Find(str) != String::NPOS; }
+    /// Return whether contains a specific character.
+    bool Contains(char c) const { return Find(c) != String::NPOS; }
 
     /// Return hash value for HashSet & HashMap.
-    unsigned ToHash() const;
-    
-    /// Return length of a C string.
-    static unsigned CStringLength(const char* str);
+    unsigned ToHash() const
+    {
+        unsigned hash = 0;
+        const char* ptr = buffer_;
+        while (*ptr)
+        {
+            hash = *ptr + (hash << 6) + (hash << 16) - hash;
+            ++ptr;
+        }
+        
+        return hash;
+    }
     
     /// Compare two C strings.
     static int Compare(const char* str1, const char* str2, bool caseSensitive);
-    
+    /// Position for "not found."
+    static const unsigned NPOS;
+    /// Initial dynamic allocation size.
+    static const unsigned MIN_CAPACITY;
     /// Empty string.
     static const String EMPTY;
 };

+ 8 - 9
Extras/LuaScript/Pkgs/Core/ProcessUtils.pkg

@@ -1,23 +1,22 @@
 $#include "ProcessUtils.h"
 
+/// Initialize the FPU to round-to-nearest, single precision mode.
+void InitFPU();
 /// Display an error dialog with the specified title and message.
 void ErrorDialog(const char* title, const char* message);
-
 /// Exit the application with an error message to the console.
 void ErrorExit(const char* message, int exitCode = EXIT_FAILURE);
-
 /// Open a console window.
 void OpenConsoleWindow();
-
 /// Print ASCII text to the console with a newline appended. Uses printf() to allow printing into the MSVC output window.
 void PrintLine(const char* str, bool error = false);
-
+/// Return previously parsed arguments.
+const Vector<String>& GetArguments();
+/// Read input from the console window. Return empty if no input.
+String GetConsoleInput();
 /// Return the runtime platform identifier. Currently either "Windows", "Linux", "Mac OS X" or "Android".
-const char* GetPlatformCString @ GetPlatform();
-
+String GetPlatform();
 /// Return the number of physical CPU cores.
 unsigned GetNumPhysicalCPUs();
-
 /// Return the number of logical CPUs (different from physical if hyperthreading is used.)
-unsigned GetNumLogicalCPUs();
-
+unsigned GetNumLogicalCPUs();

+ 0 - 27
Extras/LuaScript/Pkgs/Core/StringUtils.pkg

@@ -2,84 +2,57 @@ $#include "StringUtils.h"
 
 /// Parse a bool from a string. Check for the first non-empty character (converted to lowercase) being either 't', 'y' or '1'.
 bool ToBool(const String& source);
-
 /// Parse a bool from a C string. Check for the first non-empty character (converted to lowercase) being either 't', 'y' or '1'.
 bool ToBool(const char* source);
-
 /// Parse a float from a string.
 float ToFloat(const String& source);
-
 /// Parse a float from a C string.
 float ToFloat(const char* source);
-
 /// Parse an integer from a string.
 int ToInt(const String& source);
-
 /// Parse an integer from a C string.
 int ToInt(const char* source);
-
 /// Parse an unsigned integer from a string.
 unsigned ToUInt(const String& source);
-
 /// Parse an unsigned integer from a C string.
 unsigned ToUInt(const char* source);
-
 /// Parse a Color from a string.
 Color ToColor(const String& source);
-
 /// Parse a Color from a C string.
 Color ToColor(const char* source);
-
 /// Parse an IntRect from a string.
 IntRect ToIntRect(const String& source);
-
 /// Parse an IntRect from a C string.
 IntRect ToIntRect(const char* source);
-
 /// Parse an IntVector2 from a string.
 IntVector2 ToIntVector2(const String& source);
-
 /// Parse an IntVector2 from a C string.
 IntVector2 ToIntVector2(const char* source);
-
 /// Parse a Quaternion from a string. If only 3 components specified, convert Euler angles (degrees) to quaternion.
 Quaternion ToQuaternion(const String& source);
-
 /// Parse a Quaternion from a C string. If only 3 components specified, convert Euler angles (degrees) to quaternion.
 Quaternion ToQuaternion(const char* source);
-
 /// Parse a Rect from a string.
 Rect ToRect(const String& source);
-
 /// Parse a Rect from a C string.
 Rect ToRect(const char* source);
-
 /// Parse a Vector2 from a string.
 Vector2 ToVector2(const String& source);
-
 /// Parse a Vector2 from a C string.
 Vector2 ToVector2(const char* source);
-
 /// Parse a Vector3 from a string.
 Vector3 ToVector3(const String& source);
-
 /// Parse a Vector3 from a C string.
 Vector3 ToVector3(const char* source);
-
 /// Parse a Vector4 from a string.
 Vector4 ToVector4(const String& source, bool allowMissingCoords = false);
-
 /// Parse a Vector4 from a C string.
 Vector4 ToVector4(const char* source, bool allowMissingCoords = false);
-
 /// Convert a pointer to string (returns hexadecimal.)
 String ToString(void* value);
-
 /// Convert an unsigned integer to string as hexadecimal.
 String ToStringHex(unsigned value);
-
 /// Return whether a char is an alphabet letter.
 bool IsAlpha(unsigned ch);
-
 /// Return whether a char is a digit.
 bool IsDigit(unsigned ch);

+ 1 - 1
Extras/LuaScript/Pkgs/Core/Variant.pkg

@@ -254,7 +254,7 @@ public:
 	tolua_outside void VariantMapSetQuaternion @ SetQuaternion(const char* key, const Quaternion& value);
 	tolua_outside void VariantMapSetColor @ SetColor(const char* key, const Color& value);
 	tolua_outside void VariantMapSetString @ SetString(const char* key, const String& value);
-	tolua_outside void VariantMapSetPtr @ SetPtr(const char* key, const void*& value);
+	tolua_outside void VariantMapSetPtr @ SetPtr(const char* key, void* value);
 	tolua_outside void VariantMapSetResourceRef @ SetResourceRef(const char* key, const ResourceRef& value);
 	tolua_outside void VariantMapSetResourceRefList @ SetResourceRefList(const char* key, const ResourceRefList& value); 
 	tolua_outside void VariantMapSetIntRect @ SetIntRect(const char* key, const IntRect& value);

+ 6 - 6
Extras/LuaScript/Pkgs/Graphics/AnimationState.pkg

@@ -27,21 +27,21 @@ public:
     void SetLayer(unsigned char layer);
     
     /// Return animation.
-    Animation* GetAnimation() const;
+    Animation* GetAnimation() const { return animation_; }
     /// Return start bone.
     Bone* GetStartBone() const;
     /// Return whether weight is nonzero.
-    bool IsEnabled() const;
+    bool IsEnabled() const { return weight_ > 0.0f; }
     /// Return whether looped.
-    bool IsLooped() const;
+    bool IsLooped() const { return looped_; }
     /// Return blending weight.
-    float GetWeight() const;
+    float GetWeight() const { return weight_; }
     /// Return time position.
-    float GetTime() const;
+    float GetTime() const { return time_; }
     /// Return animation length.
     float GetLength() const;
     /// Return blending layer.
-    unsigned char GetLayer() const;
+    unsigned char GetLayer() const { return layer_; }
     
     /// Apply the animation at the current time position.
     void Apply();

+ 7 - 4
Extras/LuaScript/Pkgs/Graphics/BillboardSet.pkg

@@ -22,13 +22,16 @@ public:
     /// Return material.
     Material* GetMaterial() const;
     /// Return number of billboards.
-    unsigned GetNumBillboards() const;
+    unsigned GetNumBillboards() const { return billboards_.Size(); }
+    /// Return billboard by index.
+    Billboard* GetBillboard(unsigned index);
     /// Return whether billboards are relative to the scene node.
-    bool IsRelative() const;
+    bool IsRelative() const { return relative_; }
     /// Return whether scene node scale affects billboards' size.
-    bool IsScaled() const;
+    bool IsScaled() const { return scaled_; }
     /// Return whether billboards are sorted.
-    bool IsSorted() const;
+    bool IsSorted() const { return sorted_; }
     /// Return animation LOD bias.
+    float GetAnimationLodBias() const { return animationLodBias_; }
     float GetAnimationLodBias() const;
 };

+ 13 - 13
Extras/LuaScript/Pkgs/Graphics/Camera.pkg

@@ -36,29 +36,29 @@ public:
     void SetFlipVertical(bool enable);
     
     /// Return far clip distance.
-    float GetFarClip() const;
+    float GetFarClip() const { return farClip_; }
     /// Return near clip distance.
     float GetNearClip() const;
     /// Return field of view.
-    float GetFov() const;
+    float GetFov() const { return fov_; }
     /// Return orthographic mode size.
-    float GetOrthoSize() const;
+    float GetOrthoSize() const { return orthoSize_; } 
     /// Return aspect ratio.
-    float GetAspectRatio() const;
+    float GetAspectRatio() const { return aspectRatio_; }
     /// Return zoom.
-    float GetZoom() const;
+    float GetZoom() const { return zoom_; }
     /// Return LOD bias.
-    float GetLodBias() const;
+    float GetLodBias() const { return lodBias_; }
     /// Return view mask.
-    unsigned GetViewMask() const;
+    unsigned GetViewMask() const { return viewMask_; }
     /// Return view override flags.
-    unsigned GetViewOverrideFlags() const;
+    unsigned GetViewOverrideFlags() const { return viewOverrideFlags_; }
     /// Return fill mode.
-    FillMode GetFillMode() const;
+    FillMode GetFillMode() const { return fillMode_; }
     /// Return orthographic flag.
-    bool IsOrthographic() const;
+    bool IsOrthographic() const { return orthographic_; }
     /// Return auto aspect ratio flag.
-    bool GetAutoAspectRatio() const;
+    bool GetAutoAspectRatio() const { return autoAspectRatio_; }
     /// Return frustum in world space.
     const Frustum& GetFrustum() const;
     /// Return API-specific projection matrix.
@@ -90,9 +90,9 @@ public:
     /// Return up vector.
     Vector3 GetUpVector() const;
     /// Return projection offset.
-    const Vector2& GetProjectionOffset() const;
+    const Vector2& GetProjectionOffset() const { return projectionOffset_; }
     /// Return vertical flipping mode.
-    bool GetFlipVertical() const;
+    bool GetFlipVertical() const { return flipVertical_; }
     /// Return distance to position. In orthographic mode uses only Z coordinate.
     float GetDistance(const Vector3& worldPos) const;
     /// Return squared distance to position. In orthographic mode uses only Z coordinate.

+ 10 - 0
Extras/LuaScript/Pkgs/Graphics/DebugRenderer.pkg

@@ -4,6 +4,8 @@ $#include "DebugRenderer.h"
 class DebugRenderer : public Component
 {
 public:
+    /// Set the camera viewpoint. Call before rendering, or before adding geometry if you want to use culling.
+    void SetView(Camera* camera);
     /// Add a line.
     void AddLine(const Vector3& start, const Vector3& end, const Color& color, bool depthTest = true);
     /// Add a line with color already converted to unsigned.
@@ -22,6 +24,14 @@ public:
     void AddSphere(const Sphere& sphere, const Color& color, bool depthTest = true);
     /// Add a skeleton.
     void AddSkeleton(const Skeleton& skeleton, const Color& color, bool depthTest = true);    
+    /// Return the view transform.
+    const Matrix3x4& GetView() const { return view_; }
+    /// Return the projection transform.
+    const Matrix4& GetProjection() const { return projection_; }
+    /// Return the view frustum.
+    const Frustum& GetFrustum() const { return frustum_; }
+    /// Check whether a bounding box is inside the view frustum.
+    bool IsInside(const BoundingBox& box) const;
 };
 
 DebugRenderer* GetDebugRenderer();

+ 5 - 5
Extras/LuaScript/Pkgs/Graphics/DecalSet.pkg

@@ -20,13 +20,13 @@ public:
     /// Return material.
     Material* GetMaterial() const;
     /// Return number of decals.
-    unsigned GetNumDecals() const;
+    unsigned GetNumDecals() const { return decals_.Size(); }
     /// Retur number of vertices in the decals.
-    unsigned GetNumVertices() const;
+    unsigned GetNumVertices() const { return numVertices_; }
     /// Retur number of vertex indices in the decals.
-    unsigned GetNumIndices() const;
+    unsigned GetNumIndices() const { return numIndices_; }
     /// Return maximum number of decal vertices.
-    unsigned GetMaxVertices() const;
+    unsigned GetMaxVertices() const { return maxVertices_; }
     /// Return maximum number of decal vertex indices.
-    unsigned GetMaxIndices() const;
+    unsigned GetMaxIndices() const { return maxIndices_; }
 };

+ 24 - 24
Extras/LuaScript/Pkgs/Graphics/Drawable.pkg

@@ -32,29 +32,29 @@ public:
     /// Return world-space bounding box.
     const BoundingBox& GetWorldBoundingBox();
     /// Return drawable flags.
-    unsigned char GetDrawableFlags() const;
+    unsigned char GetDrawableFlags() const { return drawableFlags_; }
     /// Return draw distance.
-    float GetDrawDistance() const;
+    float GetDrawDistance() const { return drawDistance_; }
     /// Return shadow draw distance.
-    float GetShadowDistance() const;
+    float GetShadowDistance() const { return shadowDistance_; }
     /// Return LOD bias.
-    float GetLodBias() const;
+    float GetLodBias() const { return lodBias_; }
     /// Return view mask.
-    unsigned GetViewMask() const;
+    unsigned GetViewMask() const { return viewMask_; }
     /// Return light mask.
-    unsigned GetLightMask() const;
+    unsigned GetLightMask() const { return lightMask_; }
     /// Return shadow mask.
-    unsigned GetShadowMask() const;
+    unsigned GetShadowMask() const { return shadowMask_; }
     /// Return zone mask.
-    unsigned GetZoneMask() const;
+    unsigned GetZoneMask() const { return zoneMask_; }
     /// Return maximum number of per-pixel lights.
-    unsigned GetMaxLights() const;
+    unsigned GetMaxLights() const { return maxLights_; }
     /// Return shadowcaster flag.
-    bool GetCastShadows() const;
+    bool GetCastShadows() const { return castShadows_; }
     /// Return occluder flag.
-    bool IsOccluder() const;
+    bool IsOccluder() const { return occluder_; }
     /// Return occludee flag.
-    bool IsOccludee() const;
+    bool IsOccludee() const { return occludee_; }
     
     /// Set new zone.
     void SetZone(Zone* zone, bool temporary = false);
@@ -75,31 +75,31 @@ public:
     /// Sort and limit per-vertex lights to maximum allowed.
     void LimitVertexLights();
     /// Set base pass flag for a batch.
-    void SetBasePass(unsigned batchIndex);
+    void SetBasePass(unsigned batchIndex) { basePassFlags_ |= (1 << batchIndex); }
     /// Return octree octant.
-    Octant* GetOctant() const;
+    Octant* GetOctant() const { return octant_; }
     /// Return current zone.
     Zone* GetZone() const;
     /// Return previous zone.
     Zone* GetLastZone() const;
     /// Return if zone assignment needs re-evaluation.
-    bool IsZoneDirty() const;
+    bool IsZoneDirty() const { return zoneDirty_; }
     /// Return distance from camera.
-    float GetDistance() const;
+    float GetDistance() const { return distance_; }
     /// Return LOD scaled distance from camera.
-    float GetLodDistance() const;
+    float GetLodDistance() const { return lodDistance_; }
     /// Return sorting value.
-    float GetSortValue() const;
+    float GetSortValue() const { return sortValue_; }
     /// Return whether is in view this frame.
-    bool IsInView(unsigned frameNumber) const;
+    bool IsInView(unsigned frameNumber) const { return viewFrameNumber_ == frameNumber; }
     /// Return whether is visible in a specific view this frame.
-    bool IsInView(const FrameInfo& frame, bool mainView = true) const;
+    bool IsInView(const FrameInfo& frame, bool mainView = true) const { return viewFrameNumber_ == frame.frameNumber_ && viewFrame_ == &frame && (!mainView || viewCamera_ == frame.camera_); }
     /// Return whether has a base pass.
-    bool HasBasePass(unsigned batchIndex) const;
+    bool HasBasePass(unsigned batchIndex) const { return (basePassFlags_ & (1 << batchIndex)) != 0; }
     /// Return the first added per-pixel light.
-    Light* GetFirstLight() const;
+    Light* GetFirstLight() const { return firstLight_; }
     /// Return the minimum view-space depth.
-    float GetMinZ() const;
+    float GetMinZ() const { return minZ_; }
     /// Return the maximum view-space depth.
-    float GetMaxZ() const;
+    float GetMaxZ() const { return maxZ_; }
 };

+ 17 - 17
Extras/LuaScript/Pkgs/Graphics/Light.pkg

@@ -49,39 +49,39 @@ public:
     void SetShapeTexture(Texture* texture);
     
     /// Return light type.
-    LightType GetLightType() const;
+    LightType GetLightType() const { return lightType_; }
     /// Return vertex lighting mode.
-    bool GetPerVertex() const;
+    bool GetPerVertex() const { return perVertex_; }
     /// Return color.
-    const Color& GetColor() const;
+    const Color& GetColor() const { return color_; }
     /// Return specular intensity.
-    float GetSpecularIntensity() const;
+    float GetSpecularIntensity() const { return specularIntensity_; }
     /// Return range.
-    float GetRange() const;
+    float GetRange() const { return range_; }
     /// Return spotlight field of view.
-    float GetFov() const;
+    float GetFov() const { return fov_; }
     /// Return spotlight aspect ratio.
-    float GetAspectRatio() const;
+    float GetAspectRatio() const { return aspectRatio_; }
     /// Return fade start distance.
-    float GetFadeDistance() const;
+    float GetFadeDistance() const { return fadeDistance_; }
     /// Return shadow fade start distance.
-    float GetShadowFadeDistance() const;
+    float GetShadowFadeDistance() const { return shadowFadeDistance_; }
     /// Return shadow depth bias parameters.
-    const BiasParameters& GetShadowBias() const;
+    const BiasParameters& GetShadowBias() const { return shadowBias_; }
     /// Return directional light cascaded shadow parameters.
-    const CascadeParameters& GetShadowCascade() const;
+    const CascadeParameters& GetShadowCascade() const { return shadowCascade_; }
     /// Return shadow map focus parameters.
-    const FocusParameters& GetShadowFocus() const;
+    const FocusParameters& GetShadowFocus() const { return shadowFocus_; }
     /// Return shadow intensity.
-    float GetShadowIntensity() const;
+    float GetShadowIntensity() const { return shadowIntensity_; }
     /// Return shadow resolution.
-    float GetShadowResolution() const;
+    float GetShadowResolution() const { return shadowResolution_; }
     /// Return shadow camera near/far clip distance ratio.
-    float GetShadowNearFarRatio() const;
+    float GetShadowNearFarRatio() const { return shadowNearFarRatio_; }
     /// Return range attenuation texture.
-    Texture* GetRampTexture() const;
+    Texture* GetRampTexture() const { return rampTexture_; }
     /// Return spotlight attenuation texture.
-    Texture* GetShapeTexture() const;
+    Texture* GetShapeTexture() const { return shapeTexture_; }
     /// Return spotlight frustum.
     Frustum GetFrustum() const;
 };

+ 9 - 7
Extras/LuaScript/Pkgs/Graphics/Material.pkg

@@ -5,7 +5,7 @@ class Material : public Resource
 {
 public:
     /// Return number of techniques.
-    unsigned GetNumTechniques() const;
+    unsigned GetNumTechniques() const { return techniques_.Size(); }
     /// Return technique entry by index.
     const TechniqueEntry& GetTechniqueEntry(unsigned index) const;
     /// Return technique by index.
@@ -14,20 +14,22 @@ public:
     Pass* GetPass(unsigned index, StringHash passType) const;
     /// Return texture by unit.
     Texture* GetTexture(TextureUnit unit) const;
+   /// Return all textures.
+    const SharedPtr<Texture>* GetTextures() const { return &textures_[0]; }
     /// Return shader parameter.
     const Vector4& GetShaderParameter(const String& name) const;
     /// Return normal culling mode.
-    CullMode GetCullMode() const;
+    CullMode GetCullMode() const { return cullMode_; }
     /// Return culling mode for shadows.
-    CullMode GetShadowCullMode() const;
+    CullMode GetShadowCullMode() const { return shadowCullMode_; }
     /// Return depth bias.
-    const BiasParameters& GetDepthBias() const;
+    const BiasParameters& GetDepthBias() const { return depthBias_; }
     /// Return last auxiliary view rendered frame number.
-    unsigned GetAuxViewFrameNumber() const;
+    unsigned GetAuxViewFrameNumber() const { return auxViewFrameNumber_; }
     /// Return whether should render occlusion.
-    bool GetOcclusion() const;
+    bool GetOcclusion() const { return occlusion_; }
     /// Return whether should render specular.
-    bool GetSpecular() const;
+    bool GetSpecular() const { return specular_; }
     
     /// Return name for texture unit.
     static String GetTextureUnitName(TextureUnit unit);

+ 4 - 4
Extras/LuaScript/Pkgs/Graphics/Model.pkg

@@ -5,17 +5,17 @@ class Model : public Resource
 {
 public:
     /// Return bounding box.
-    const BoundingBox& GetBoundingBox() const;
+    const BoundingBox& GetBoundingBox() const { return boundingBox_; }
     /// Return skeleton.
-    Skeleton& GetSkeleton();
+    Skeleton& GetSkeleton() { return skeleton_; }
     /// Return number of geometries.
-    unsigned GetNumGeometries() const;
+    unsigned GetNumGeometries() const { return geometries_.Size(); }
     /// Return number of LOD levels in geometry.
     unsigned GetNumGeometryLodLevels(unsigned index) const;
     /// Return geometry by index and LOD level. The LOD level is clamped if out of range.
     Geometry* GetGeometry(unsigned index, unsigned lodLevel) const;
     /// Return number of vertex morphs.
-    unsigned GetNumMorphs() const;
+    unsigned GetNumMorphs() const { return morphs_.Size(); }
     /// Return vertex morph by index.
     const ModelMorph* GetMorph(unsigned index) const;
     /// Return vertex morph by name.

+ 1 - 1
Extras/LuaScript/Pkgs/Graphics/Octree.pkg

@@ -20,7 +20,7 @@ public:
     /// Return the closest drawable object by a ray query.
     void RaycastSingle(RayOctreeQuery& query) const;
     /// Return subdivision levels.
-    unsigned GetNumLevels() const;
+    unsigned GetNumLevels() const { return numLevels_; }
     
     /// Mark drawable object as requiring an update.
     void QueueUpdate(Drawable* drawable);

+ 29 - 28
Extras/LuaScript/Pkgs/Graphics/ParticleEmitter.pkg

@@ -138,61 +138,62 @@ public:
     void SetNumTextureFrames(unsigned num);
     
     /// Return maximum number of particles.
-    unsigned GetNumParticles() const;
+    unsigned GetNumParticles() const { return particles_.Size(); }
     /// Return whether is currently emitting.
-    bool IsEmitting() const;
+    bool IsEmitting() const { return emitting_; }
     /// Return whether to update when particles are not visible.
-    bool GetUpdateInvisible() const;
+    bool GetUpdateInvisible() const { return updateInvisible_; }
     /// Return minimum emission rate.
-    float GetMinEmissionRate() const;
+    float GetMinEmissionRate() const { return emissionRateMin_; }
     /// Return maximum emission rate.
-    float GetMaxEmissionRate() const;
+    float GetMaxEmissionRate() const { return emissionRateMax_; }
     /// Return emitter type.
-    EmitterType GetEmitterType() const;
+    EmitterType GetEmitterType() const { return emitterType_; }
     /// Return emitter size.
-    const Vector3& GetEmitterSize() const;
+    const Vector3& GetEmitterSize() const { return emitterSize_; }
     /// Return emission active period length (0 = infinite.)
-    float GetActiveTime() const;
+    float GetActiveTime() const { return activeTime_; }
     /// Return emission inactive period length (0 = infinite.)
-    float GetInactiveTime() const;
+    float GetInactiveTime() const { return inactiveTime_; }
     /// Return particle minimum time to live.
-    float GetMinTimeToLive() const;
+    float GetMinTimeToLive() const { return timeToLiveMin_; }
     /// Return particle maximum time to live.
-    float GetMaxTimeToLive() const;
+    float GetMaxTimeToLive() const { return timeToLiveMax_; }
     /// Return particle minimum size.
-    const Vector2& GetMinParticleSize() const;
+    const Vector2& GetMinParticleSize() const { return sizeMin_; }
     /// Return particle maximum size.
-    const Vector2& GetMaxParticleSize() const;
+    const Vector2& GetMaxParticleSize() const { return sizeMax_; }
     /// Return negative direction limit.
-    const Vector3& GetMinDirection() const;
+    const Vector3& GetMinDirection() const { return directionMin_; }
     /// Return positive direction limit.
-    const Vector3& GetMaxDirection() const;
+    const Vector3& GetMaxDirection() const { return directionMax_; }
     /// Return particle minimum velocity.
-    float GetMinVelocity() const;
+    float GetMinVelocity() const { return velocityMin_; }
     /// Return particle maximum velocity.
-    float GetMaxVelocity() const;
+    float GetMaxVelocity() const { return velocityMax_; }
     /// Return particle minimum rotation.
-    float GetMinRotation() const;
+    float GetMinRotation() const { return rotationMin_; }
     /// Return particle maximum rotation.
-    float GetMaxRotation() const;
+    float GetMaxRotation() const { return rotationMax_; }
     /// Return particle minimum rotation speed.
-    float GetMinRotationSpeed() const;
+    float GetMinRotationSpeed() const { return rotationSpeedMin_; }
     /// Return particle maximum rotation speed.
-    float GetMaxRotationSpeed() const;
+    float GetMaxRotationSpeed() const { return rotationSpeedMax_; }
     /// Return constant force acting on particles.
-    const Vector3& GetConstantForce() const;
+    const Vector3& GetConstantForce() const { return constantForce_; }
     /// Return particle velocity damping force.
-    float GetDampingForce() const;
+    float GetDampingForce() const { return dampingForce_; }
     /// Return particle size additive modifier.
-    float GetSizeAdd() const;
+    float GetSizeAdd() const { return sizeAdd_; }
     /// Return particle size multiplicative modifier.
-    float GetSizeMul() const;
+    float GetSizeMul() const { return sizeMul_; }
     /// Return number of color animation frames.
-    unsigned GetNumColors() const;
+    unsigned GetNumColors() const { return colorFrames_.Size(); }
     /// Return a color animation frame, or null if outside range.
-    ColorFrame* GetColor(unsigned index);
+    ColorFrame* GetColor(unsigned index) { return index < colorFrames_.Size() ? &colorFrames_[index] : (ColorFrame*)0; }
     /// Return number of texture animation frames.
-    unsigned GetNumTextureFrames() const;
+    unsigned GetNumTextureFrames() const { return textureFrames_.Size(); }
     /// Return a texture animation frame, or null if outside range.
+    TextureFrame* GetTextureFrame(unsigned index) { return index < colorFrames_.Size() ? &textureFrames_[index] : (TextureFrame*)0; }
     TextureFrame* GetTextureFrame(unsigned index);
 };

+ 33 - 33
Extras/LuaScript/Pkgs/Graphics/Renderer.pkg

@@ -52,53 +52,53 @@ public:
     void ReloadShaders();
     
     /// Return number of backbuffer viewports.
-    unsigned GetNumViewports() const;
+    unsigned GetNumViewports() const { return viewports_.Size(); }
     /// Return backbuffer viewport by index.
     Viewport* GetViewport(unsigned index) const;
     /// Return default renderpath.
     RenderPath* GetDefaultRenderPath() const;
     /// Return whether specular lighting is enabled.
-    bool GetSpecularLighting() const;
+    bool GetSpecularLighting() const { return specularLighting_; }
     /// Return whether drawing shadows is enabled.
-    bool GetDrawShadows() const;
+    bool GetDrawShadows() const { return drawShadows_; }
     /// Return texture anisotropy.
-    int GetTextureAnisotropy() const;
+    int GetTextureAnisotropy() const { return textureAnisotropy_; }
     /// Return texture filtering.
-    TextureFilterMode GetTextureFilterMode() const;
+    TextureFilterMode GetTextureFilterMode() const { return textureFilterMode_; }
     /// Return texture quality level.
-    int GetTextureQuality() const;
+    int GetTextureQuality() const { return textureQuality_; }
     /// Return material quality level.
-    int GetMaterialQuality() const;
+    int GetMaterialQuality() const { return materialQuality_; }
     /// Return shadow map resolution.
-    int GetShadowMapSize() const;
+    int GetShadowMapSize() const { return shadowMapSize_; }
     /// Return shadow quality.
-    int GetShadowQuality() const;
+    int GetShadowQuality() const { return shadowQuality_; }
     /// Return whether shadow maps are reused.
-    bool GetReuseShadowMaps() const;
+    bool GetReuseShadowMaps() const { return reuseShadowMaps_; }
     /// Return maximum number of shadow maps per resolution.
-    int GetMaxShadowMaps() const;
+    int GetMaxShadowMaps() const { return maxShadowMaps_; }
     /// Return maximum number of directional light shadow map cascades.
-    int GetMaxShadowCascades() const;
+    int GetMaxShadowCascades() const { return maxShadowCascades_; }
     /// Return whether dynamic instancing is in use.
-    bool GetDynamicInstancing() const;
+    bool GetDynamicInstancing() const { return dynamicInstancing_; }
     /// Return minimum number of instances required in a batch group to render as instanced.
-    int GetMinInstances() const;
+    int GetMinInstances() const { return minInstances_; }
     /// Return maximum number of triangles per object for instancing.
-    int GetMaxInstanceTriangles() const;
+    int GetMaxInstanceTriangles() const { return maxInstanceTriangles_; }
     /// Return maximum number of sorted instances per batch group.
-    int GetMaxSortedInstances() const;
+    int GetMaxSortedInstances() const { return maxSortedInstances_; }
     /// Return maximum number of occluder triangles.
-    int GetMaxOccluderTriangles() const;
+    int GetMaxOccluderTriangles() const { return maxOccluderTriangles_; }
     /// Return occlusion buffer width.
-    int GetOcclusionBufferSize() const;
+    int GetOcclusionBufferSize() const { return occlusionBufferSize_; }
     /// Return occluder screen size threshold.
-    float GetOccluderSizeThreshold() const;
+    float GetOccluderSizeThreshold() const { return occluderSizeThreshold_; }
     /// Return number of views rendered.
-    unsigned GetNumViews() const;
+    unsigned GetNumViews() const { return numViews_; }
     /// Return number of primitives rendered.
-    unsigned GetNumPrimitives() const;
+    unsigned GetNumPrimitives() const { return numPrimitives_; }
     /// Return number of batches rendered.
-    unsigned GetNumBatches() const;
+    unsigned GetNumBatches() const { return numBatches_; }
     /// Return number of geometries rendered.
     unsigned GetNumGeometries(bool allViews = false) const;
     /// Return number of lights rendered.
@@ -108,31 +108,31 @@ public:
     /// Return number of occluders rendered.
     unsigned GetNumOccluders(bool allViews = false) const;
     /// Return the default zone.
-    Zone* GetDefaultZone() const;
+    Zone* GetDefaultZone() const { return defaultZone_; }
     /// Return the directional light for fullscreen quad rendering.
-    Light* GetQuadDirLight() const;
+    Light* GetQuadDirLight() const { return quadDirLight_; }
     /// Return the default material.
-    Material* GetDefaultMaterial() const;
+    Material* GetDefaultMaterial() const { return defaultMaterial_; }
     /// Return the default range attenuation texture.
-    Texture2D* GetDefaultLightRamp() const;
+    Texture2D* GetDefaultLightRamp() const { return defaultLightRamp_; }
     /// Return the default spotlight attenuation texture.
-    Texture2D* GetDefaultLightSpot() const;
+    Texture2D* GetDefaultLightSpot() const { return defaultLightSpot_; }
     /// Return the shadowed pointlight face selection cube map.
-    TextureCube* GetFaceSelectCubeMap() const;
+    TextureCube* GetFaceSelectCubeMap() const { return faceSelectCubeMap_; }
     /// Return the shadowed pointlight indirection cube map.
-    TextureCube* GetIndirectionCubeMap() const;
+    TextureCube* GetIndirectionCubeMap() const { return indirectionCubeMap_; }
     /// Return the instancing vertex buffer
-    VertexBuffer* GetInstancingBuffer() const;
+    VertexBuffer* GetInstancingBuffer() const { return dynamicInstancing_ ? instancingBuffer_ : (VertexBuffer*)0; }
     /// Return a vertex shader by name.
     ShaderVariation* GetVertexShader(const String& name, bool checkExists = false) const;
     /// Return a pixel shader by name.
     ShaderVariation* GetPixelShader(const String& name, bool checkExists = false) const;
     /// Return the stencil vertex shader.
-    ShaderVariation* GetStencilVS() const;
+    ShaderVariation* GetStencilVS() const { return stencilVS_; }
     /// Return the stencil pixel shader.
-    ShaderVariation* GetStencilPS() const;
+    ShaderVariation* GetStencilPS() const { return stencilPS_; }
     /// Return the frame update parameters.
-    const FrameInfo& GetFrameInfo();
+    const FrameInfo& GetFrameInfo() { return frame_; }
 };
 
 Renderer* GetRenderer();

+ 4 - 4
Extras/LuaScript/Pkgs/Graphics/StaticModel.pkg

@@ -14,15 +14,15 @@ public:
     void SetOcclusionLodLevel(unsigned level);
     
     /// Return model.
-    Model* GetModel() const;
+    Model* GetModel() const { return model_; }
     /// Return model's bounding box.
-    const BoundingBox& GetBoundingBox() const;
+    const BoundingBox& GetBoundingBox() const { return boundingBox_; }
     /// Return number of geometries.
-    unsigned GetNumGeometries() const;
+    unsigned GetNumGeometries() const { return geometries_.Size(); }
     /// Return material by geometry index.
     Material* GetMaterial(unsigned index) const;
     /// Return occlusion LOD level.
-    unsigned GetOcclusionLodLevel() const;
+    unsigned GetOcclusionLodLevel() const { return occlusionLodLevel_; }
     /// Determines if the given world space point is within the model geometry.
     bool IsInside(const Vector3& point) const;
     /// Determines if the given local space point is within the model geometry.

+ 17 - 17
Extras/LuaScript/Pkgs/Graphics/Terrain.pkg

@@ -38,15 +38,15 @@ public:
     void SetOccludee(bool enable);
 
     /// Return patch quads per side.
-    int GetPatchSize() const;
+    int GetPatchSize() const { return patchSize_; }
     /// Return vertex and height spacing.
-    const Vector3& GetSpacing() const;
+    const Vector3& GetSpacing() const { return spacing_; }
     /// Return heightmap size in vertices.
-    const IntVector2& GetNumVertices() const;
+    const IntVector2& GetNumVertices() const { return numVertices_; }
     /// Return heightmap size in patches.
-    const IntVector2& GetNumPatches() const;
+    const IntVector2& GetNumPatches() const { return numPatches_; }
     /// Return whether smoothing is in use.
-    bool GetSmoothing() const;
+    bool GetSmoothing() const { return smoothing_; }
     /// Return heightmap image.
     Image* GetHeightMap() const;
     /// Return material.
@@ -60,27 +60,27 @@ public:
     /// Return normal at world coordinates.
     Vector3 GetNormal(const Vector3& worldPosition) const;
     /// Return draw distance.
-    float GetDrawDistance() const;
+    float GetDrawDistance() const { return drawDistance_; }
     /// Return shadow draw distance.
-    float GetShadowDistance() const;
+    float GetShadowDistance() const { return shadowDistance_; }
     /// Return LOD bias.
-    float GetLodBias() const;
+    float GetLodBias() const { return lodBias_; }
     /// Return view mask.
-    unsigned GetViewMask() const;
+    unsigned GetViewMask() const { return viewMask_; }
     /// Return light mask.
-    unsigned GetLightMask() const;
+    unsigned GetLightMask() const { return lightMask_; }
     /// Return shadow mask.
-    unsigned GetShadowMask() const;
+    unsigned GetShadowMask() const { return shadowMask_; }
     /// Return zone mask.
-    unsigned GetZoneMask() const;
+    unsigned GetZoneMask() const { return zoneMask_; }
     /// Return maximum number of per-pixel lights.
-    unsigned GetMaxLights() const;
+    unsigned GetMaxLights() const { return maxLights_; }
     /// Return visible flag.
-    bool IsVisible() const;
+    bool IsVisible() const { return visible_; }
     /// Return shadowcaster flag.
-    bool GetCastShadows() const;
+    bool GetCastShadows() const { return castShadows_; }
     /// Return occluder flag.
-    bool IsOccluder() const;
+    bool IsOccluder() const { return occluder_; }
     /// Return occludee flag.
-    bool IsOccludee() const;
+    bool IsOccludee() const { return occludee_; }
 };

+ 8 - 8
Extras/LuaScript/Pkgs/Graphics/TerrainPatch.pkg

@@ -30,20 +30,20 @@ public:
     /// Return owner terrain.
     Terrain* GetOwner() const;
     /// Return north neighbor patch.
-    TerrainPatch* GetNorthPatch() const;
+    TerrainPatch* GetNorthPatch() const { return north_; }
     /// Return south neighbor patch.
-    TerrainPatch* GetSouthPatch() const;
+    TerrainPatch* GetSouthPatch() const { return south_; }
     /// Return west neighbor patch.
-    TerrainPatch* GetWestPatch() const;
+    TerrainPatch* GetWestPatch() const { return west_; }
     /// Return east neighbor patch.
-    TerrainPatch* GetEastPatch() const;
-    /// Return geometrical error array.
+    TerrainPatch* GetEastPatch() const { return east_; }
     /// Return local-space bounding box.
-    const BoundingBox& GetBoundingBox() const;
+    const BoundingBox& GetBoundingBox() const { return boundingBox_; }
     /// Return patch coordinates.
-    const IntVector2& GetCoordinates() const;
+    const IntVector2& GetCoordinates() const { return coordinates_; }
     /// Return current LOD level.
-    unsigned GetLodLevel() const;
+    unsigned GetLodLevel() const { return lodLevel_; }
     /// Return vertical offset for occlusion geometry..
+    float GetOcclusionOffset() const { return occlusionOffset_; }
     float GetOcclusionOffset() const;
 };

+ 4 - 4
Extras/LuaScript/Pkgs/IO/File.pkg

@@ -33,11 +33,11 @@ public:
     void SetName(const String& name);
     
     /// Return the open mode.
-    FileMode GetMode() const;
+    FileMode GetMode() const { return mode_; }
     /// Return whether is open.
-    bool IsOpen() const;
+    bool IsOpen() const { return handle_ != 0; }
     /// Return the file handle.
-    void* GetHandle() const;
+    void* GetHandle() const { return handle_; }
     /// Return whether the file originates from a package.
-    bool IsPackaged() const;
+    bool IsPackaged() const { return offset_ != 0; }
 };

+ 1 - 1
Extras/LuaScript/Pkgs/IO/FileSystem.pkg

@@ -32,7 +32,7 @@ public:
     /// Return the absolute current working directory.
     String GetCurrentDir() const;
     /// Return whether paths have been registered.
-    bool HasRegisteredPaths() const;
+    bool HasRegisteredPaths() const { return allowedPaths_.Size() > 0; }
     /// Check if a path is allowed to be accessed. If no paths are registered, all are allowed.
     bool CheckAccess(const String& pathName) const;
     /// Returns the file's last modified time as seconds since 1.1.1970, or 0 if can not be accessed.

+ 3 - 3
Extras/LuaScript/Pkgs/IO/Log.pkg

@@ -23,12 +23,12 @@ public:
     void SetQuiet(bool quiet);
     
     /// Return logging level.
-    int GetLevel() const;
+    int GetLevel() const { return level_; }
     /// Return whether log messages are timestamped.
-    bool GetTimeStamp() const;
+    bool GetTimeStamp() const { return timeStamp_; }
     /// Return last log message.
     /// Return whether log is in quiet mode (only errors printed to standard error stream).
-    bool IsQuiet() const;
+    bool IsQuiet() const { return quiet_; }
     
     /// Write to the log. If logging level is higher than the level of the message, the message is ignored.
     static void Write(int level, const char* message);

+ 5 - 5
Extras/LuaScript/Pkgs/IO/PackageFile.pkg

@@ -22,13 +22,13 @@ public:
     /// Return the file entry corresponding to the name, or null if not found.
     const PackageEntry* GetEntry(const String& fileName) const;
     /// Return the package file name.
-    const String& GetName() const;
+    const String& GetName() const { return fileName_; }
     /// Return hash of the package file name.
-    StringHash GetNameHash() const;
+    StringHash GetNameHash() const { return nameHash_; }
     /// Return number of files.
-    unsigned GetNumFiles() const;
+    unsigned GetNumFiles() const { return entries_.Size(); }
     /// Return total size of the package file.
-    unsigned GetTotalSize() const;
+    unsigned GetTotalSize() const { return totalSize_; }
     /// Return checksum of the package file contents.
-    unsigned GetChecksum() const;
+    unsigned GetChecksum() const { return checksum_; }
 };

+ 40 - 16
Extras/LuaScript/Pkgs/Input/Input.pkg

@@ -19,23 +19,47 @@ struct TouchState
 struct JoystickState
 {
     /// Return number of buttons.
-    unsigned GetNumButtons() const;
+    unsigned GetNumButtons() const { return buttons_.Size(); }
     /// Return number of axes.
-    unsigned GetNumAxes() const;
+    unsigned GetNumAxes() const { return axes_.Size(); }
     /// Return number of hats.
-    unsigned GetNumHats() const;
+    unsigned GetNumHats() const { return hats_.Size(); }
     
     /// Check if a button is held down.
-    bool GetButtonDown(unsigned index) const;
+    bool GetButtonDown(unsigned index) const
+    {
+        if (index < buttons_.Size())
+            return buttons_[index];
+        else
+            return false;
+    }
     
     /// Check if a button has been pressed on this frame.
-    bool GetButtonPress(unsigned index) const;
+    bool GetButtonPress(unsigned index) const
+    {
+        if (index < buttons_.Size())
+            return buttonPress_[index];
+        else
+            return false;
+    }
     
     /// Return axis position.
-    float GetAxisPosition(unsigned index) const;
+    float GetAxisPosition(unsigned index) const
+    {
+        if (index < axes_.Size())
+            return axes_[index];
+        else
+            return 0.0f;
+    }
     
     /// Return hat position.
-    int GetHatPosition(unsigned index) const;    
+    int GetHatPosition(unsigned index) const
+    {
+        if (index < hats_.Size())
+            return hats_[index];
+        else
+            return HAT_CENTER;
+    }
 };
 
 /// %Input subsystem. Converts operating system window messages to input state and events.
@@ -68,29 +92,29 @@ public:
     /// Return mouse position within window. Should only be used with a visible mouse cursor.
     IntVector2 GetMousePosition() const;
     /// Return mouse movement since last frame.
-    const IntVector2& GetMouseMove() const;
+    const IntVector2& GetMouseMove() const { return mouseMove_; }
     /// Return horizontal mouse movement since last frame.
-    int GetMouseMoveX() const;
+    int GetMouseMoveX() const { return mouseMove_.x_; }
     /// Return vertical mouse movement since last frame.
-    int GetMouseMoveY() const;
+    int GetMouseMoveY() const { return mouseMove_.y_; }
     /// Return mouse wheel movement since last frame.
-    int GetMouseMoveWheel() const;
+    int GetMouseMoveWheel() const { return mouseMoveWheel_; }
     /// Return number of active finger touches.
-    unsigned GetNumTouches() const;
+    unsigned GetNumTouches() const { return touches_.Size(); }
     /// Return active finger touch by index.
     TouchState* GetTouch(unsigned index) const;
     /// Return number of connected joysticks.
-    unsigned GetNumJoysticks() const;
+    unsigned GetNumJoysticks() const { return joysticks_.Size(); }
     /// Return joystick name by index.
     const String& GetJoystickName(unsigned index) const;
     /// Return joystick state by index. Automatically open if not opened yet.
     JoystickState* GetJoystick(unsigned index);
     /// Return whether fullscreen toggle is enabled.
-    bool GetToggleFullscreen() const;
+    bool GetToggleFullscreen() const { return toggleFullscreen_; }
     /// Return whether the operating system mouse cursor is visible.
-    bool IsMouseVisible() const;
+    bool IsMouseVisible() const { return mouseVisible_; }
     /// Return whether application window has input focus.
-    bool HasFocus();
+    bool HasFocus() { return inputFocus_; }
     /// Return whether application window is minimized.
     bool IsMinimized() const;
 };

+ 5 - 9
Extras/LuaScript/Pkgs/Math/AreaAllocator.pkg

@@ -6,19 +6,15 @@ class AreaAllocator
 public:
     /// Construct with given width and height.
     AreaAllocator(int width, int height);
-    
-	/// Construct with given width and height, and set the maximum it allows to grow.
+    /// Construct with given width and height, and set the maximum it allows to grow.
     AreaAllocator(int width, int height, int maxWidth, int maxHeight);
     
     /// Reset to given width and height and remove all previous allocations.
     void Reset(int width, int height);
-	
     /// Try to allocate an area. Return true if successful, with x & y coordinates filled.
     bool Allocate(int width, int height, int& x, int& y);
-    
-	/// Return the current width.
-    int GetWidth() const;
-    
-	/// Return the current height.
-    int GetHeight() const;
+    /// Return the current width.
+    int GetWidth() const { return size_.x_; }
+    /// Return the current height.
+    int GetHeight() const { return size_.y_; }
 };

+ 169 - 49
Extras/LuaScript/Pkgs/Math/BoundingBox.pkg

@@ -5,125 +5,245 @@ class BoundingBox
 {
 public:
     /// Construct with zero size.
-    BoundingBox();
+    BoundingBox() :
+        min_(Vector3::ZERO),
+        max_(Vector3::ZERO),
+        defined_(false)
+    {
+    }
     
     /// Copy-construct from another bounding box.
-    BoundingBox(const BoundingBox& box);
+    BoundingBox(const BoundingBox& box) :
+        min_(box.min_),
+        max_(box.max_),
+        defined_(box.defined_)
+    {
+    }
     
     /// Construct from a rect, with the Z dimension left zero.
-    BoundingBox(const Rect& rect);
+    BoundingBox(const Rect& rect) :
+        min_(Vector3(rect.min_, 0.0f)),
+        max_(Vector3(rect.max_, 0.0f)),
+        defined_(true)
+    {
+    }
     
     /// Construct from minimum and maximum vectors.
-    BoundingBox(const Vector3& min, const Vector3& max);
+    BoundingBox(const Vector3& min, const Vector3& max) :
+        min_(min),
+        max_(max),
+        defined_(true)
+    {
+    }
     
     /// Construct from minimum and maximum floats (all dimensions same.)
-    BoundingBox(float min, float max);
+    BoundingBox(float min, float max) :
+        min_(Vector3(min, min, min)),
+        max_(Vector3(max, max, max)),
+        defined_(true)
+    {
+    }
     
     /// Construct from an array of vertices.
-    BoundingBox(const Vector3* vertices, unsigned count);
+    BoundingBox(const Vector3* vertices, unsigned count) :
+        defined_(false)
+    {
+        Define(vertices, count);
+    }
     
     /// Construct from a frustum.
-    BoundingBox(const Frustum& frustum);
+    BoundingBox(const Frustum& frustum) :
+        defined_(false)
+    {
+        Define(frustum);
+    }
     
     /// Construct from a polyhedron.
-    BoundingBox(const Polyhedron& poly);
+    BoundingBox(const Polyhedron& poly) :
+        defined_(false)
+    {
+        Define(poly);
+    }
     
     /// Construct from a sphere.
-    BoundingBox(const Sphere& sphere);
+    BoundingBox(const Sphere& sphere) :
+        defined_(false)
+    {
+        Define(sphere);
+    }
     
     /// Test for equality with another bounding box.
-    bool operator == (const BoundingBox& rhs) const;
+    bool operator == (const BoundingBox& rhs) const { return (min_ == rhs.min_ && max_ == rhs.max_); }
     
     /// Define from another bounding box.
-    void Define(const BoundingBox& box);
+    void Define(const BoundingBox& box)
+    {
+        Define(box.min_, box.max_);
+    }
     
     /// Define from a Rect.
-    void Define(const Rect& rect);
+    void Define(const Rect& rect)
+    {
+        Define(Vector3(rect.min_, 0.0f), Vector3(rect.max_, 0.0f));
+    }
     
     /// Define from minimum and maximum vectors.
-    void Define(const Vector3& min, const Vector3& max);
+    void Define(const Vector3& min, const Vector3& max)
+    {
+        min_ = min;
+        max_ = max;
+        defined_ = true;
+    }
     
     /// Define from minimum and maximum floats (all dimensions same.)
-    void Define(float min, float max);
+    void Define(float min, float max)
+    {
+        min_ = Vector3(min, min, min);
+        max_ = Vector3(max, max, max);
+        defined_ = true;
+    }
     
     /// Define from a point.
-    void Define(const Vector3& point);
+    void Define(const Vector3& point)
+    {
+        min_ = max_ = point;
+        defined_ = true;
+    }
     
     /// Merge a point.
-    void Merge(const Vector3& point);
+    void Merge(const Vector3& point)
+    {
+        if (!defined_)
+        {
+            min_ = max_ = point;
+            defined_ = true;
+            return;
+        }
+        
+        if (point.x_ < min_.x_)
+            min_.x_ = point.x_;
+        if (point.y_ < min_.y_)
+            min_.y_ = point.y_;
+        if (point.z_ < min_.z_)
+            min_.z_ = point.z_;
+        if (point.x_ > max_.x_)
+            max_.x_ = point.x_;
+        if (point.y_ > max_.y_)
+            max_.y_ = point.y_;
+        if (point.z_ > max_.z_)
+            max_.z_ = point.z_;
+    }
     
     /// Merge another bounding box.
-    void Merge(const BoundingBox& box);
-	
+    void Merge(const BoundingBox& box)
+    {
+        if (!defined_)
+        {
+            min_ = box.min_;
+            max_ = box.max_;
+            defined_ = true;
+            return;
+        }
+    
+        if (box.min_.x_ < min_.x_)
+            min_.x_ = box.min_.x_;
+        if (box.min_.y_ < min_.y_)
+            min_.y_ = box.min_.y_;
+        if (box.min_.z_ < min_.z_)
+            min_.z_ = box.min_.z_;
+        if (box.max_.x_ > max_.x_)
+            max_.x_ = box.max_.x_;
+        if (box.max_.y_ > max_.y_)
+            max_.y_ = box.max_.y_;
+        if (box.max_.z_ > max_.z_)
+            max_.z_ = box.max_.z_;
+    }
+    
     /// Define from an array of vertices.
     void Define(const Vector3* vertices, unsigned count);
-	
     /// Define from a frustum.
     void Define(const Frustum& frustum);
-    
-	/// Define from a polyhedron.
+    /// Define from a polyhedron.
     void Define(const Polyhedron& poly);
-    
-	/// Define from a sphere.
+    /// Define from a sphere.
     void Define(const Sphere& sphere);
-    
-	/// Merge an array of vertices.
+    /// Merge an array of vertices.
     void Merge(const Vector3* vertices, unsigned count);
-    
-	/// Merge a frustum.
+    /// Merge a frustum.
     void Merge(const Frustum& frustum);
-    
-	/// Merge a polyhedron.
+    /// Merge a polyhedron.
     void Merge(const Polyhedron& poly);
-    
-	/// Merge a sphere.
+    /// Merge a sphere.
     void Merge(const Sphere& sphere);
-    
-	/// Clip with another bounding box.
+    /// Clip with another bounding box.
     void Clip(const BoundingBox& box);
-    
-	/// Transform with a 3x3 matrix.
+    /// Transform with a 3x3 matrix.
     void Transform(const Matrix3& transform);
-    
-	/// Transform with a 3x4 matrix.
+    /// Transform with a 3x4 matrix.
     void Transform(const Matrix3x4& transform);
     
     /// Clear to undefined state.
-    void Clear();
+    void Clear()
+    {
+        min_ = Vector3::ZERO;
+        max_ = Vector3::ZERO;
+        defined_ = false;
+    }
     
     /// Return center.
-    Vector3 Center() const;
-	
+    Vector3 Center() const { return (max_ + min_) * 0.5f; }
     /// Return size.
-    Vector3 Size() const;
-	
+    Vector3 Size() const { return max_ - min_; }
     /// Return half-size.
-    Vector3 HalfSize() const;
+    Vector3 HalfSize() const { return (max_ - min_) * 0.5f; }
     
     /// Return transformed by a 3x3 matrix.
     BoundingBox Transformed(const Matrix3& transform) const;
-	
     /// Return transformed by a 3x4 matrix.
     BoundingBox Transformed(const Matrix3x4& transform) const;
-	
     /// Return projected by a 4x4 projection matrix.
     Rect Projected(const Matrix4& projection) const;
     
     /// Test if a point is inside.
-    Intersection IsInside(const Vector3& point) const;
+    Intersection IsInside(const Vector3& point) const
+    {
+        if (point.x_ < min_.x_ || point.x_ > max_.x_ || point.y_ < min_.y_ || point.y_ > max_.y_ ||
+            point.z_ < min_.z_ || point.z_ > max_.z_)
+            return OUTSIDE;
+        else
+            return INSIDE;
+    }
     
     /// Test if another bounding box is inside, outside or intersects.
-    Intersection IsInside(const BoundingBox& box) const;
+    Intersection IsInside(const BoundingBox& box) const
+    {
+        if (box.max_.x_ < min_.x_ || box.min_.x_ > max_.x_ || box.max_.y_ < min_.y_ || box.min_.y_ > max_.y_ ||
+            box.max_.z_ < min_.z_ || box.min_.z_ > max_.z_)
+            return OUTSIDE;
+        else if (box.min_.x_ < min_.x_ || box.max_.x_ > max_.x_ || box.min_.y_ < min_.y_ || box.max_.y_ > max_.y_ ||
+            box.min_.z_ < min_.z_ || box.max_.z_ > max_.z_)
+            return INTERSECTS;
+        else
+            return INSIDE;
+    }
     
     /// Test if another bounding box is (partially) inside or outside.
-    Intersection IsInsideFast(const BoundingBox& box) const;
+    Intersection IsInsideFast(const BoundingBox& box) const
+    {
+        if (box.max_.x_ < min_.x_ || box.min_.x_ > max_.x_ || box.max_.y_ < min_.y_ || box.min_.y_ > max_.y_ ||
+            box.max_.z_ < min_.z_ || box.min_.z_ > max_.z_)
+            return OUTSIDE;
+        else
+            return INSIDE;
+    }
     
     /// Test if a sphere is inside, outside or intersects.
     Intersection IsInside(const Sphere& sphere) const;
-	
     /// Test if a sphere is (partially) inside or outside.
     Intersection IsInsideFast(const Sphere& sphere) const;
     
+    /// Return as string.
+    String ToString() const;
     /// Minimum vector.
     Vector3 min_ @ min;
 	

+ 64 - 18
Extras/LuaScript/Pkgs/Math/Color.pkg

@@ -4,45 +4,91 @@ $#include "Color.h"
 class Color
 {
 public:
-  /// Construct with default values (opaque white.)
-    Color();
+    /// Construct with default values (opaque white.)
+    Color() :
+        r_(1.0f),
+        g_(1.0f),
+        b_(1.0f),
+        a_(1.0f)
+    {
+    }
     
     /// Copy-construct from another color.
-    Color(const Color& color);
+    Color(const Color& color) :
+        r_(color.r_),
+        g_(color.g_),
+        b_(color.b_),
+        a_(color.a_)
+    {
+    }
     
     /// Construct from another color and modify the alpha.
-    Color(const Color& color, float a);
+    Color(const Color& color, float a) :
+        r_(color.r_),
+        g_(color.g_),
+        b_(color.b_),
+        a_(a)
+    {
+    }
     
     /// Construct from RGB values and set alpha fully opaque.
-    Color(float r, float g, float b);
+    Color(float r, float g, float b) :
+        r_(r),
+        g_(g),
+        b_(b),
+        a_(1.0f)
+    {
+    }
     
     /// Construct from RGBA values.
-    Color(float r, float g, float b, float a);	
-	
+    Color(float r, float g, float b, float a) :
+        r_(r),
+        g_(g),
+        b_(b),
+        a_(a)
+    {
+    }
     /// Test for equality with another color.
-    bool operator == (const Color& rhs) const;
+    bool operator == (const Color& rhs) const { return Equals(r_, rhs.r_) && Equals(g_, rhs.g_) && Equals(b_, rhs.b_) && Equals(a_, rhs.a_); }
+    /// Multiply with a scalar.
+    Color operator * (float rhs) const { return Color(r_ * rhs, g_ * rhs, b_ * rhs, a_ * rhs); }
+    /// Add a color.
+    Color operator + (const Color& rhs) const { return Color(r_ + rhs.r_, g_ + rhs.g_, b_ + rhs.b_, a_ + rhs.a_); }
     
-	/// Multiply with a scalar.
-    Color operator * (float rhs) const;
     
-	/// Add a color.
-    Color operator + (const Color& rhs) const;
         
     /// Return RGB values as a Vector3.
-    Vector3 RGBValues() const;
-	
+    Vector3 RGBValues() const { return Vector3(r_, g_, b_); }
     /// Return approximate intensity.
-    float Intensity() const;
+    float Intensity() const { return RGBValues().DotProduct(Vector3(0.333f, 0.333f, 0.333f)); }
     
     /// Linear interpolation with another color.
-    Color Lerp(const Color& rhs, float t) const;
+    Color Lerp(const Color& rhs, float t) const
+    {
+        float invT = 1.0f - t;
+        return Color(
+            r_ * invT + rhs.r_ * t,
+            g_ * invT + rhs.g_ * t,
+            b_ * invT + rhs.b_ * t,
+            a_ * invT + rhs.a_ * t
+        );
+    }
     
     /// Return color packed to a 32-bit integer. Components are clamped to [0, 1] range.
-    unsigned ToUInt() const;
+    unsigned ToUInt() const
+    {
+        unsigned r = Clamp(((int)(r_ * 255.0f)), 0, 255);
+        unsigned g = Clamp(((int)(g_ * 255.0f)), 0, 255);
+        unsigned b = Clamp(((int)(b_ * 255.0f)), 0, 255);
+        unsigned a = Clamp(((int)(a_ * 255.0f)), 0, 255);
+        return (a << 24) | (b << 16) | (g << 8) | r;
+    }
     
     /// Return as a four-dimensional vector.
-    Vector4 ToVector4() const;
+    Vector4 ToVector4() const { return Vector4(r_, g_, b_, a_); }
     
+    /// Return as string.
+    String ToString() const;
     /// Red value.
     float r_ @ r;
     /// Green value.

+ 86 - 21
Extras/LuaScript/Pkgs/Math/Frustum.pkg

@@ -20,53 +20,118 @@ class Frustum
 public:
     /// Construct undefined.
     Frustum();
-
-	/// Copy-construct from another frustum.
+    /// Copy-construct from another frustum.
     Frustum(const Frustum& frustum);
     
     /// Define with projection parameters and a transform matrix.
     void Define(float fov, float aspectRatio, float zoom, float nearZ, float farZ, const Matrix3x4& transform = Matrix3x4::IDENTITY);
-    
-	/// Define with near and far dimension vectors and a transform matrix.
+    /// Define with near and far dimension vectors and a transform matrix.
     void Define(const Vector3& near, const Vector3& far, const Matrix3x4& transform = Matrix3x4::IDENTITY);
-    
-	/// Define with a bounding box and a transform matrix.
+    /// Define with a bounding box and a transform matrix.
     void Define(const BoundingBox& box, const Matrix3x4& transform = Matrix3x4::IDENTITY);
-    
-	/// Define with orthographic projection parameters and a transform matrix.
+    /// Define with orthographic projection parameters and a transform matrix.
     void DefineOrtho(float orthoSize, float aspectRatio, float zoom, float nearZ, float farZ, const Matrix3x4& transform = Matrix3x4::IDENTITY);
-    
-	/// Transform by a 3x3 matrix.
+    /// Transform by a 3x3 matrix.
     void Transform(const Matrix3& transform);
-    
-	/// Transform by a 3x4 matrix.
+    /// Transform by a 3x4 matrix.
     void Transform(const Matrix3x4& transform);
     
     /// Test if a point is inside or outside.
-    Intersection IsInside(const Vector3& point) const;
+    Intersection IsInside(const Vector3& point) const
+    {
+        for (unsigned i = 0; i < NUM_FRUSTUM_PLANES; ++i)
+        {
+            if (planes_[i].Distance(point) < 0.0f)
+                return OUTSIDE;
+        }
+        
+        return INSIDE;
+    }
     
     /// Test if a sphere is inside, outside or intersects.
-    Intersection IsInside(const Sphere& sphere) const;
+    Intersection IsInside(const Sphere& sphere) const
+    {
+        bool allInside = true;
+        for (unsigned i = 0; i < NUM_FRUSTUM_PLANES; ++i)
+        {
+            float dist = planes_[i].Distance(sphere.center_);
+            if (dist < -sphere.radius_)
+                return OUTSIDE;
+            else if (dist < sphere.radius_)
+                allInside = false;
+        }
+        
+        return allInside ? INSIDE : INTERSECTS;
+    }
     
     /// Test if a sphere if (partially) inside or outside.
-    Intersection IsInsideFast(const Sphere& sphere) const;
+    Intersection IsInsideFast(const Sphere& sphere) const
+    {
+        for (unsigned i = 0; i < NUM_FRUSTUM_PLANES; ++i)
+        {
+            if (planes_[i].Distance(sphere.center_) < -sphere.radius_)
+                return OUTSIDE;
+        }
+        
+        return INSIDE;
+    }
     
     /// Test if a bounding box is inside, outside or intersects.
-    Intersection IsInside(const BoundingBox& box) const;
+    Intersection IsInside(const BoundingBox& box) const
+    {
+        Vector3 center = box.Center();
+        Vector3 edge = center - box.min_;
+        bool allInside = true;
+        
+        for (unsigned i = 0; i < NUM_FRUSTUM_PLANES; ++i)
+        {
+            const Plane& plane = planes_[i];
+            float dist = plane.normal_.DotProduct(center) - plane.intercept_;
+            float absDist = plane.absNormal_.DotProduct(edge);
+            
+            if (dist < -absDist)
+                return OUTSIDE;
+            else if (dist < absDist)
+                allInside = false;
+        }
+        
+        return allInside ? INSIDE : INTERSECTS;
+    }
     
     /// Test if a bounding box is (partially) inside or outside.
-    Intersection IsInsideFast(const BoundingBox& box) const;
+    Intersection IsInsideFast(const BoundingBox& box) const
+    {
+        Vector3 center = box.Center();
+        Vector3 edge = center - box.min_;
+        
+        for (unsigned i = 0; i < NUM_FRUSTUM_PLANES; ++i)
+        {
+            const Plane& plane = planes_[i];
+            float dist = plane.normal_.DotProduct(center) - plane.intercept_;
+            float absDist = plane.absNormal_.DotProduct(edge);
+            
+            if (dist < -absDist)
+                return OUTSIDE;
+        }
+        
+        return INSIDE;
+    }
     
     /// Return distance of a point to the frustum, or 0 if inside.
-    float Distance(const Vector3& point) const;
+    float Distance(const Vector3& point) const
+    {
+        float distance = 0.0f;
+        for (unsigned i = 0; i < NUM_FRUSTUM_PLANES; ++i)
+            distance = Max(-planes_[i].Distance(point), distance);
+        
+        return distance;
+    }
     
     /// Return transformed by a 3x3 matrix.
     Frustum Transformed(const Matrix3& transform) const;
-	
     /// Return transformed by a 3x4 matrix.
     Frustum Transformed(const Matrix3x4& transform) const;
-    
-	/// Return projected by a 4x4 projection matrix.
+    /// Return projected by a 4x4 projection matrix.
     Rect Projected(const Matrix4& transform) const;
     
     /// Update the planes. Called internally.

+ 46 - 16
Extras/LuaScript/Pkgs/Math/MathDefs.pkg

@@ -26,40 +26,70 @@ enum Intersection
 };
 
 /// Linear interpolation between two float values.
-inline float Lerp(float lhs, float rhs, float t);
+inline float Lerp(float lhs, float rhs, float t) { return lhs * (1.0f - t) + rhs * t; }
 /// Return the smaller of two floats.
-inline float Min(float lhs, float rhs);
+inline float Min(float lhs, float rhs) { return lhs < rhs ? lhs : rhs; }
 /// Return the larger of two floats.
-inline float Max(float lhs, float rhs);
+inline float Max(float lhs, float rhs) { return lhs > rhs ? lhs : rhs; }
 /// Return absolute value of a float.
-inline float Abs(float value);
+inline float Abs(float value) { return value >= 0.0f ? value : -value; }
 
 /// Clamp a float to a range.
-inline float Clamp(float value, float min, float max);
+inline float Clamp(float value, float min, float max)
+{
+    if (value < min)
+        return min;
+    else if (value > max)
+        return max;
+    else
+        return value;
+}
 
 /// Check whether two floating point values are equal within accuracy.
-inline bool Equals(float lhs, float rhs);
+inline bool Equals(float lhs, float rhs) { return lhs + M_EPSILON >= rhs && lhs - M_EPSILON <= rhs; }
 /// Return the smaller of two integers.
-inline int Min(int lhs, int rhs);
+inline int Min(int lhs, int rhs) { return lhs < rhs ? lhs : rhs; }
 /// Return the larger of two integers.
-inline int Max(int lhs, int rhs);
+inline int Max(int lhs, int rhs) { return lhs > rhs ? lhs : rhs; }
 /// Return absolute value of an integer
-inline int Abs(int value);
+inline int Abs(int value) { return value >= 0 ? value : -value; }
 
 /// Clamp an integer to a range.
-inline int Clamp(int value, int min, int max);
+inline int Clamp(int value, int min, int max)
+{
+    if (value < min)
+        return min;
+    else if (value > max)
+        return max;
+    else
+        return value;
+}
 
 /// Check whether an unsigned integer is a power of two.
-inline bool IsPowerOfTwo(unsigned value);
+inline bool IsPowerOfTwo(unsigned value)
+{
+    if (!value)
+        return true;
+    while (!(value & 1))
+        value >>= 1;
+    return value == 1;
+}
 
 /// Round up to next power of two.
-inline unsigned NextPowerOfTwo(unsigned value);
+inline unsigned NextPowerOfTwo(unsigned value)
+{
+    unsigned ret = 1;
+    while (ret < value && ret < 0x80000000)
+        ret <<= 1;
+    return ret;
+}
 
 /// Update a hash with the given 8-bit value using the SDBM algorithm.
-inline unsigned SDBMHash(unsigned hash, unsigned char c);
+inline unsigned SDBMHash(unsigned hash, unsigned char c) { return c + (hash << 6) + (hash << 16) - hash; }
 /// Return a random float between 0.0 (inclusive) and 1.0 (exclusive.)
-inline float Random();
+inline float Random() { return Rand() / 32768.0f; }
 /// Return a random float between 0.0 and range, inclusive from both ends.
-inline float Random(float range);
+inline float Random(float range) { return Rand() * range / 32767.0f; }
 /// Return a random integer between 0 and range - 1.
-inline int Random @ RandomInt (int range);
+inline int Random @ RandomInt(int range) { return (Rand() * (range - 1) + 16384) / 32767; }
+

+ 187 - 18
Extras/LuaScript/Pkgs/Math/Matrix3.pkg

@@ -5,51 +5,202 @@ class Matrix3
 {
 public:
     /// Construct undefined.
-    Matrix3();
+    Matrix3()
+    {
+    }
     
     /// Copy-construct from another matrix.
-    Matrix3(const Matrix3& matrix);
+    Matrix3(const Matrix3& matrix) :
+        m00_(matrix.m00_),
+        m01_(matrix.m01_),
+        m02_(matrix.m02_),
+        m10_(matrix.m10_),
+        m11_(matrix.m11_),
+        m12_(matrix.m12_),
+        m20_(matrix.m20_),
+        m21_(matrix.m21_),
+        m22_(matrix.m22_)
+    {
+    }
     
     /// Construct from values.
     Matrix3(float v00, float v01, float v02,
             float v10, float v11, float v12,
-            float v20, float v21, float v22);
+            float v20, float v21, float v22) :
+        m00_(v00),
+        m01_(v01),
+        m02_(v02),
+        m10_(v10),
+        m11_(v11),
+        m12_(v12),
+        m20_(v20),
+        m21_(v21),
+        m22_(v22)
+    {
+    }
+    
     
     /// Test for equality with another matrix without epsilon.
-    bool operator == (const Matrix3& rhs) const;
+    bool operator == (const Matrix3& rhs) const
+    {
+        const float* leftData = Data();
+        const float* rightData = rhs.Data();
+        
+        for (unsigned i = 0; i < 9; ++i)
+        {
+            if (leftData[i] != rightData[i])
+                return false;
+        }
+        
+        return true;
+    }
     
     /// Multiply a Vector3.
-    Vector3 operator * (const Vector3& rhs) const;
+    Vector3 operator * (const Vector3& rhs) const
+    {
+        return Vector3(
+            m00_ * rhs.x_ + m01_ * rhs.y_ + m02_ * rhs.z_,
+            m10_ * rhs.x_ + m11_ * rhs.y_ + m12_ * rhs.z_,
+            m20_ * rhs.x_ + m21_ * rhs.y_ + m22_ * rhs.z_
+        );
+    }
     
     /// Add a matrix.
-    Matrix3 operator + (const Matrix3& rhs) const;
+    Matrix3 operator + (const Matrix3& rhs) const
+    {
+        return Matrix3(
+            m00_ + rhs.m00_,
+            m01_ + rhs.m01_,
+            m02_ + rhs.m02_,
+            m10_ + rhs.m10_,
+            m11_ + rhs.m11_,
+            m12_ + rhs.m12_,
+            m20_ + rhs.m20_,
+            m21_ + rhs.m21_,
+            m22_ + rhs.m22_
+        );
+    }
     
     /// Subtract a matrix.
-    Matrix3 operator - (const Matrix3& rhs) const;
-	
+    Matrix3 operator - (const Matrix3& rhs) const
+    {
+        return Matrix3(
+            m00_ - rhs.m00_,
+            m01_ - rhs.m01_,
+            m02_ - rhs.m02_,
+            m10_ - rhs.m10_,
+            m11_ - rhs.m11_,
+            m12_ - rhs.m12_,
+            m20_ - rhs.m20_,
+            m21_ - rhs.m21_,
+            m22_ - rhs.m22_
+        );
+    }
+    
     /// Multiply with a scalar.
-    Matrix3 operator * (float rhs) const;
-	
+    Matrix3 operator * (float rhs) const
+    {
+        return Matrix3(
+            m00_ * rhs,
+            m01_ * rhs,
+            m02_ * rhs,
+            m10_ * rhs,
+            m11_ * rhs,
+            m12_ * rhs,
+            m20_ * rhs,
+            m21_ * rhs,
+            m22_ * rhs
+        );
+    }
+    
     /// Multiply a matrix.
-    Matrix3 operator * (const Matrix3& rhs) const;
+    Matrix3 operator * (const Matrix3& rhs) const
+    {
+        return Matrix3(
+            m00_ * rhs.m00_ + m01_ * rhs.m10_ + m02_ * rhs.m20_,
+            m00_ * rhs.m01_ + m01_ * rhs.m11_ + m02_ * rhs.m21_,
+            m00_ * rhs.m02_ + m01_ * rhs.m12_ + m02_ * rhs.m22_,
+            m10_ * rhs.m00_ + m11_ * rhs.m10_ + m12_ * rhs.m20_,
+            m10_ * rhs.m01_ + m11_ * rhs.m11_ + m12_ * rhs.m21_,
+            m10_ * rhs.m02_ + m11_ * rhs.m12_ + m12_ * rhs.m22_,
+            m20_ * rhs.m00_ + m21_ * rhs.m10_ + m22_ * rhs.m20_,
+            m20_ * rhs.m01_ + m21_ * rhs.m11_ + m22_ * rhs.m21_,
+            m20_ * rhs.m02_ + m21_ * rhs.m12_ + m22_ * rhs.m22_
+        );
+    }
     
     /// Set scaling elements.
-    void SetScale(const Vector3& scale);
+    void SetScale(const Vector3& scale)
+    {
+        m00_ = scale.x_;
+        m11_ = scale.y_;
+        m22_ = scale.z_;
+    }
     
     /// Set uniform scaling elements.
-    void SetScale(float scale);
+    void SetScale(float scale)
+    {
+        m00_ = scale;
+        m11_ = scale;
+        m22_ = scale;
+    }
     
     /// Return the scaling part.
-    Vector3 Scale() const;
+    Vector3 Scale() const
+    {
+        return Vector3(
+            sqrtf(m00_ * m00_ + m10_ * m10_ + m20_ * m20_),
+            sqrtf(m01_ * m01_ + m11_ * m11_ + m21_ * m21_),
+            sqrtf(m02_ * m02_ + m12_ * m12_ + m22_ * m22_)
+        );
+    }
     
     /// Return transpose.
-    Matrix3 Transpose() const;
+    Matrix3 Transpose() const
+    {
+        return Matrix3(
+            m00_,
+            m10_,
+            m20_,
+            m01_,
+            m11_,
+            m21_,
+            m02_,
+            m12_,
+            m22_
+        );
+    }
     
     /// Return scaled by a vector.
-    Matrix3 Scaled(const Vector3& scale) const;
+    Matrix3 Scaled(const Vector3& scale) const
+    {
+        return Matrix3(
+            m00_ * scale.x_,
+            m01_ * scale.y_,
+            m02_ * scale.z_,
+            m10_ * scale.x_,
+            m11_ * scale.y_,
+            m12_ * scale.z_,
+            m20_ * scale.x_,
+            m21_ * scale.y_,
+            m22_ * scale.z_
+        );
+    }
     
     /// Test for equality with another matrix with epsilon.
-    bool Equals(const Matrix3& rhs) const;
+    bool Equals(const Matrix3& rhs) const
+    {
+        const float* leftData = Data();
+        const float* rightData = rhs.Data();
+        
+        for (unsigned i = 0; i < 9; ++i)
+        {
+            if (!Urho3D::Equals(leftData[i], rightData[i]))
+                return false;
+        }
+        
+        return true;
+    }
     
     /// Return inverse.
     Matrix3 Inverse() const;
@@ -65,7 +216,25 @@ public:
     float m22_ @ m22;
     
     /// Bulk transpose matrices.
-    static void BulkTranspose(float* dest, const float* src, unsigned count);    
+    static void BulkTranspose(float* dest, const float* src, unsigned count)
+    {
+        for (unsigned i = 0; i < count; ++i)
+        {
+            dest[0] = src[0];
+            dest[1] = src[3];
+            dest[2] = src[6];
+            dest[3] = src[1];
+            dest[4] = src[4];
+            dest[5] = src[7];
+            dest[6] = src[2];
+            dest[7] = src[5];
+            dest[8] = src[8];
+            
+            dest += 9;
+            src += 9;
+        }
+    }
+    
     /// Zero matrix.
     static const Matrix3 ZERO;
     /// Identity matrix.

+ 265 - 24
Extras/LuaScript/Pkgs/Math/Matrix3x4.pkg

@@ -5,21 +5,79 @@ class Matrix3x4
 {
 public:
     /// Construct undefined.
-    Matrix3x4();
+    Matrix3x4()
+    {
+    }
     
     /// Copy-construct from another matrix.
-    Matrix3x4(const Matrix3x4& matrix);
+    Matrix3x4(const Matrix3x4& matrix) :
+        m00_(matrix.m00_),
+        m01_(matrix.m01_),
+        m02_(matrix.m02_),
+        m03_(matrix.m03_),
+        m10_(matrix.m10_),
+        m11_(matrix.m11_),
+        m12_(matrix.m12_),
+        m13_(matrix.m13_),
+        m20_(matrix.m20_),
+        m21_(matrix.m21_),
+        m22_(matrix.m22_),
+        m23_(matrix.m23_)
+    {
+    }
     
     /// Copy-construct from a 3x3 matrix and set the extra elements to identity.
-    Matrix3x4(const Matrix3& matrix);
+    Matrix3x4(const Matrix3& matrix) :
+        m00_(matrix.m00_),
+        m01_(matrix.m01_),
+        m02_(matrix.m02_),
+        m03_(0.0f),
+        m10_(matrix.m10_),
+        m11_(matrix.m11_),
+        m12_(matrix.m12_),
+        m13_(0.0f),
+        m20_(matrix.m20_),
+        m21_(matrix.m21_),
+        m22_(matrix.m22_),
+        m23_(0.0f)
+    {
+    }
     
     /// Copy-construct from a 4x4 matrix which is assumed to contain no projection.
-    Matrix3x4(const Matrix4& matrix);
+    Matrix3x4(const Matrix4& matrix) :
+        m00_(matrix.m00_),
+        m01_(matrix.m01_),
+        m02_(matrix.m02_),
+        m03_(matrix.m03_),
+        m10_(matrix.m10_),
+        m11_(matrix.m11_),
+        m12_(matrix.m12_),
+        m13_(matrix.m13_),
+        m20_(matrix.m20_),
+        m21_(matrix.m21_),
+        m22_(matrix.m22_),
+        m23_(matrix.m23_)
+    {
+    }
     
     // Construct from values.
     Matrix3x4(float v00, float v01, float v02, float v03,
             float v10, float v11, float v12, float v13,
-            float v20, float v21, float v22, float v23);
+            float v20, float v21, float v22, float v23) :
+        m00_(v00),
+        m01_(v01),
+        m02_(v02),
+        m03_(v03),
+        m10_(v10),
+        m11_(v11),
+        m12_(v12),
+        m13_(v13),
+        m20_(v20),
+        m21_(v21),
+        m22_(v22),
+        m23_(v23)
+    {
+    }
     
     /// Construct from translation, rotation and uniform scale.
     Matrix3x4(const Vector3& translation, const Quaternion& rotation, float scale);
@@ -27,62 +85,245 @@ public:
     Matrix3x4(const Vector3& translation, const Quaternion& rotation, const Vector3& scale);
     
     /// Test for equality with another matrix without epsilon.
-    bool operator == (const Matrix3x4& rhs) const;
+    bool operator == (const Matrix3x4& rhs) const
+    {
+        const float* leftData = Data();
+        const float* rightData = rhs.Data();
+        
+        for (unsigned i = 0; i < 12; ++i)
+        {
+            if (leftData[i] != rightData[i])
+                return false;
+        }
+        
+        return true;
+    }
     
     /// Multiply a Vector3 which is assumed to represent position.
-    Vector3 operator * (const Vector3& rhs) const;
+    Vector3 operator * (const Vector3& rhs) const
+    {
+        return Vector3(
+            (m00_ * rhs.x_ + m01_ * rhs.y_ + m02_ * rhs.z_ + m03_),
+            (m10_ * rhs.x_ + m11_ * rhs.y_ + m12_ * rhs.z_ + m13_),
+            (m20_ * rhs.x_ + m21_ * rhs.y_ + m22_ * rhs.z_ + m23_)
+        );
+    }
     
     /// Multiply a Vector4.
-    Vector3 operator * (const Vector4& rhs) const;
+    Vector3 operator * (const Vector4& rhs) const
+    {
+        return Vector3(
+            (m00_ * rhs.x_ + m01_ * rhs.y_ + m02_ * rhs.z_ + m03_ * rhs.w_),
+            (m10_ * rhs.x_ + m11_ * rhs.y_ + m12_ * rhs.z_ + m13_ * rhs.w_),
+            (m20_ * rhs.x_ + m21_ * rhs.y_ + m22_ * rhs.z_ + m23_ * rhs.w_)
+        );
+    }
     
     /// Add a matrix.
-    Matrix3x4 operator + (const Matrix3x4& rhs) const;
+    Matrix3x4 operator + (const Matrix3x4& rhs) const
+    {
+        return Matrix3x4(
+            m00_ + rhs.m00_,
+            m01_ + rhs.m01_,
+            m02_ + rhs.m02_,
+            m03_ + rhs.m03_,
+            m10_ + rhs.m10_,
+            m11_ + rhs.m11_,
+            m12_ + rhs.m12_,
+            m13_ + rhs.m13_,
+            m20_ + rhs.m20_,
+            m21_ + rhs.m21_,
+            m22_ + rhs.m22_,
+            m23_ + rhs.m23_
+        );
+    }
     
     /// Subtract a matrix.
-    Matrix3x4 operator - (const Matrix3x4& rhs) const;
+    Matrix3x4 operator - (const Matrix3x4& rhs) const
+    {
+        return Matrix3x4(
+            m00_ - rhs.m00_,
+            m01_ - rhs.m01_,
+            m02_ - rhs.m02_,
+            m03_ - rhs.m03_,
+            m10_ - rhs.m10_,
+            m11_ - rhs.m11_,
+            m12_ - rhs.m12_,
+            m13_ - rhs.m13_,
+            m20_ - rhs.m20_,
+            m21_ - rhs.m21_,
+            m22_ - rhs.m22_,
+            m23_ - rhs.m23_
+        );
+    }
     
     /// Multiply with a scalar.
-    Matrix3x4 operator * (float rhs) const;
+    Matrix3x4 operator * (float rhs) const
+    {
+        return Matrix3x4(
+            m00_ * rhs,
+            m01_ * rhs,
+            m02_ * rhs,
+            m03_ * rhs,
+            m10_ * rhs,
+            m11_ * rhs,
+            m12_ * rhs,
+            m13_ * rhs,
+            m20_ * rhs,
+            m21_ * rhs,
+            m22_ * rhs,
+            m23_ * rhs
+        );
+    }
     
     /// Multiply a matrix.
-    Matrix3x4 operator * (const Matrix3x4& rhs) const;
+    Matrix3x4 operator * (const Matrix3x4& rhs) const
+    {
+        return Matrix3x4(
+            m00_ * rhs.m00_ + m01_ * rhs.m10_ + m02_ * rhs.m20_,
+            m00_ * rhs.m01_ + m01_ * rhs.m11_ + m02_ * rhs.m21_,
+            m00_ * rhs.m02_ + m01_ * rhs.m12_ + m02_ * rhs.m22_,
+            m00_ * rhs.m03_ + m01_ * rhs.m13_ + m02_ * rhs.m23_ + m03_,
+            m10_ * rhs.m00_ + m11_ * rhs.m10_ + m12_ * rhs.m20_,
+            m10_ * rhs.m01_ + m11_ * rhs.m11_ + m12_ * rhs.m21_,
+            m10_ * rhs.m02_ + m11_ * rhs.m12_ + m12_ * rhs.m22_,
+            m10_ * rhs.m03_ + m11_ * rhs.m13_ + m12_ * rhs.m23_ + m13_,
+            m20_ * rhs.m00_ + m21_ * rhs.m10_ + m22_ * rhs.m20_,
+            m20_ * rhs.m01_ + m21_ * rhs.m11_ + m22_ * rhs.m21_,
+            m20_ * rhs.m02_ + m21_ * rhs.m12_ + m22_ * rhs.m22_,
+            m20_ * rhs.m03_ + m21_ * rhs.m13_ + m22_ * rhs.m23_ + m23_
+        );
+    }
     
     /// Multiply a 4x4 matrix.
-    Matrix4 operator * (const Matrix4& rhs) const;
+    Matrix4 operator * (const Matrix4& rhs) const
+    {
+        return Matrix4(
+            m00_ * rhs.m00_ + m01_ * rhs.m10_ + m02_ * rhs.m20_ + m03_ * rhs.m30_,
+            m00_ * rhs.m01_ + m01_ * rhs.m11_ + m02_ * rhs.m21_ + m03_ * rhs.m31_,
+            m00_ * rhs.m02_ + m01_ * rhs.m12_ + m02_ * rhs.m22_ + m03_ * rhs.m32_,
+            m00_ * rhs.m03_ + m01_ * rhs.m13_ + m02_ * rhs.m23_ + m03_ * rhs.m33_,
+            m10_ * rhs.m00_ + m11_ * rhs.m10_ + m12_ * rhs.m20_ + m13_ * rhs.m30_,
+            m10_ * rhs.m01_ + m11_ * rhs.m11_ + m12_ * rhs.m21_ + m13_ * rhs.m31_,
+            m10_ * rhs.m02_ + m11_ * rhs.m12_ + m12_ * rhs.m22_ + m13_ * rhs.m32_,
+            m10_ * rhs.m03_ + m11_ * rhs.m13_ + m12_ * rhs.m23_ + m13_ * rhs.m33_,
+            m20_ * rhs.m00_ + m21_ * rhs.m10_ + m22_ * rhs.m20_ + m23_ * rhs.m30_,
+            m20_ * rhs.m01_ + m21_ * rhs.m11_ + m22_ * rhs.m21_ + m23_ * rhs.m31_,
+            m20_ * rhs.m02_ + m21_ * rhs.m12_ + m22_ * rhs.m22_ + m23_ * rhs.m32_,
+            m20_ * rhs.m03_ + m21_ * rhs.m13_ + m22_ * rhs.m23_ + m23_ * rhs.m33_,
+            rhs.m30_,
+            rhs.m31_,
+            rhs.m32_,
+            rhs.m33_
+        );
+    }
     
     /// Set translation elements.
-    void SetTranslation(const Vector3& translation);
+    void SetTranslation(const Vector3& translation)
+    {
+        m03_ = translation.x_;
+        m13_ = translation.y_;
+        m23_ = translation.z_;
+    }
     
     /// Set rotation elements from a 3x3 matrix.
-    void SetRotation(const Matrix3& rotation);
+    void SetRotation(const Matrix3& rotation)
+    {
+        m00_ = rotation.m00_;
+        m01_ = rotation.m01_;
+        m02_ = rotation.m02_;
+        m10_ = rotation.m10_;
+        m11_ = rotation.m11_;
+        m12_ = rotation.m12_;
+        m20_ = rotation.m20_;
+        m21_ = rotation.m21_;
+        m22_ = rotation.m22_;
+    }
     
     /// Set scaling elements.
-    void SetScale(const Vector3& scale);
+    void SetScale(const Vector3& scale)
+    {
+        m00_ = scale.x_;
+        m11_ = scale.y_;
+        m22_ = scale.z_;
+    }
     
     /// Set uniform scaling elements.
-    void SetScale(float scale);
+    void SetScale(float scale)
+    {
+        m00_ = scale;
+        m11_ = scale;
+        m22_ = scale;
+    }
     
     /// Return the combined rotation and scaling matrix.
-    Matrix3 ToMatrix3() const;
+    Matrix3 ToMatrix3() const
+    {
+        return Matrix3(
+            m00_,
+            m01_,
+            m02_,
+            m10_,
+            m11_,
+            m12_,
+            m20_,
+            m21_,
+            m22_
+        );
+    }
     
     /// Return the rotation matrix with scaling removed.
-    Matrix3 RotationMatrix() const;
+    Matrix3 RotationMatrix() const
+    {
+        Vector3 invScale(
+            1.0f / sqrtf(m00_ * m00_ + m10_ * m10_ + m20_ * m20_),
+            1.0f / sqrtf(m01_ * m01_ + m11_ * m11_ + m21_ * m21_),
+            1.0f / sqrtf(m02_ * m02_ + m12_ * m12_ + m22_ * m22_)
+        );
+        
+        return ToMatrix3().Scaled(invScale);
+    }
     
     /// Return the translation part.
-    Vector3 Translation() const;
+    Vector3 Translation() const
+    {
+        return Vector3(
+            m03_,
+            m13_,
+            m23_
+        );
+    }
     
     /// Return the rotation part.
-    Quaternion Rotation() const;
+    Quaternion Rotation() const { return Quaternion(RotationMatrix()); }
     
     /// Return the scaling part.
-    Vector3 Scale() const;
+    Vector3 Scale() const
+    {
+        return Vector3(
+            sqrtf(m00_ * m00_ + m10_ * m10_ + m20_ * m20_),
+            sqrtf(m01_ * m01_ + m11_ * m11_ + m21_ * m21_),
+            sqrtf(m02_ * m02_ + m12_ * m12_ + m22_ * m22_)
+        );
+    }
     
     /// Test for equality with another matrix with epsilon.
-    bool Equals(const Matrix3x4& rhs) const;
+    bool Equals(const Matrix3x4& rhs) const
+    {
+        const float* leftData = Data();
+        const float* rightData = rhs.Data();
+        
+        for (unsigned i = 0; i < 12; ++i)
+        {
+            if (!Urho3D::Equals(leftData[i], rightData[i]))
+                return false;
+        }
+        
+        return true;
+    }
     
     /// Return decomposition to translation, rotation and scale.
     void Decompose(Vector3& translation, Quaternion& rotation, Vector3& scale) const;
-	
     /// Return inverse.
     Matrix3x4 Inverse() const;
     

+ 307 - 24
Extras/LuaScript/Pkgs/Math/Matrix4.pkg

@@ -5,78 +5,337 @@ class Matrix4
 {
 public:
     /// Construct undefined.
-    Matrix4();
+    Matrix4()
+    {
+    }
     
     /// Copy-construct from another matrix.
-    Matrix4(const Matrix4& matrix);
+    Matrix4(const Matrix4& matrix) :
+        m00_(matrix.m00_),
+        m01_(matrix.m01_),
+        m02_(matrix.m02_),
+        m03_(matrix.m03_),
+        m10_(matrix.m10_),
+        m11_(matrix.m11_),
+        m12_(matrix.m12_),
+        m13_(matrix.m13_),
+        m20_(matrix.m20_),
+        m21_(matrix.m21_),
+        m22_(matrix.m22_),
+        m23_(matrix.m23_),
+        m30_(matrix.m30_),
+        m31_(matrix.m31_),
+        m32_(matrix.m32_),
+        m33_(matrix.m33_)
+    {
+    }
     
     /// Copy-cnstruct from a 3x3 matrix and set the extra elements to identity.
-    Matrix4(const Matrix3& matrix);
+    Matrix4(const Matrix3& matrix) :
+        m00_(matrix.m00_),
+        m01_(matrix.m01_),
+        m02_(matrix.m02_),
+        m03_(0.0f),
+        m10_(matrix.m10_),
+        m11_(matrix.m11_),
+        m12_(matrix.m12_),
+        m13_(0.0f),
+        m20_(matrix.m20_),
+        m21_(matrix.m21_),
+        m22_(matrix.m22_),
+        m23_(0.0f),
+        m30_(0.0f),
+        m31_(0.0f),
+        m32_(0.0f),
+        m33_(1.0f)
+    {
+    }
     
     // Construct from values.
     Matrix4(float v00, float v01, float v02, float v03,
             float v10, float v11, float v12, float v13,
             float v20, float v21, float v22, float v23,
-            float v30, float v31, float v32, float v33);
+            float v30, float v31, float v32, float v33) :
+        m00_(v00),
+        m01_(v01),
+        m02_(v02),
+        m03_(v03),
+        m10_(v10),
+        m11_(v11),
+        m12_(v12),
+        m13_(v13),
+        m20_(v20),
+        m21_(v21),
+        m22_(v22),
+        m23_(v23),
+        m30_(v30),
+        m31_(v31),
+        m32_(v32),
+        m33_(v33)
+    {
+    }
+    /// Test for equality with another matrix without epsilon.
+    bool operator == (const Matrix4& rhs) const
+    {
+        const float* leftData = Data();
+        const float* rightData = rhs.Data();
+        
+        for (unsigned i = 0; i < 16; ++i)
+        {
+            if (leftData[i] != rightData[i])
+                return false;
+        }
         
+        return true;
+    }
     /// Test for equality with another matrix without epsilon.
     bool operator == (const Matrix4& rhs) const;
     
     /// Multiply a Vector3 which is assumed to represent position.
-    Vector3 operator * (const Vector3& rhs) const;
+    Vector3 operator * (const Vector3& rhs) const
+    {
+        float invW = 1.0f / (m30_ * rhs.x_ + m31_ * rhs.y_ + m32_ * rhs.z_ + m33_);
+        
+        return Vector3(
+            (m00_ * rhs.x_ + m01_ * rhs.y_ + m02_ * rhs.z_ + m03_) * invW,
+            (m10_ * rhs.x_ + m11_ * rhs.y_ + m12_ * rhs.z_ + m13_) * invW,
+            (m20_ * rhs.x_ + m21_ * rhs.y_ + m22_ * rhs.z_ + m23_) * invW
+        );
+    }
     
     /// Multiply a Vector4.
-    Vector4 operator * (const Vector4& rhs) const;
+    Vector4 operator * (const Vector4& rhs) const
+    {
+        return Vector4(
+            m00_ * rhs.x_ + m01_ * rhs.y_ + m02_ * rhs.z_ + m03_ * rhs.w_,
+            m10_ * rhs.x_ + m11_ * rhs.y_ + m12_ * rhs.z_ + m13_ * rhs.w_,
+            m20_ * rhs.x_ + m21_ * rhs.y_ + m22_ * rhs.z_ + m23_ * rhs.w_,
+            m30_ * rhs.x_ + m31_ * rhs.y_ + m32_ * rhs.z_ + m33_ * rhs.w_
+        );
+    }
     
     /// Add a matrix.
-    Matrix4 operator + (const Matrix4& rhs) const;
+    Matrix4 operator + (const Matrix4& rhs) const
+    {
+        return Matrix4(
+            m00_ + rhs.m00_,
+            m01_ + rhs.m01_,
+            m02_ + rhs.m02_,
+            m03_ + rhs.m03_,
+            m10_ + rhs.m10_,
+            m11_ + rhs.m11_,
+            m12_ + rhs.m12_,
+            m13_ + rhs.m13_,
+            m20_ + rhs.m20_,
+            m21_ + rhs.m21_,
+            m22_ + rhs.m22_,
+            m23_ + rhs.m23_,
+            m30_ + rhs.m30_,
+            m31_ + rhs.m31_,
+            m32_ + rhs.m32_,
+            m33_ + rhs.m33_
+        );
+    }
     
     /// Subtract a matrix.
-    Matrix4 operator - (const Matrix4& rhs) const;
+    Matrix4 operator - (const Matrix4& rhs) const
+    {
+        return Matrix4(
+            m00_ - rhs.m00_,
+            m01_ - rhs.m01_,
+            m02_ - rhs.m02_,
+            m03_ - rhs.m03_,
+            m10_ - rhs.m10_,
+            m11_ - rhs.m11_,
+            m12_ - rhs.m12_,
+            m13_ - rhs.m13_,
+            m20_ - rhs.m20_,
+            m21_ - rhs.m21_,
+            m22_ - rhs.m22_,
+            m23_ - rhs.m23_,
+            m30_ - rhs.m30_,
+            m31_ - rhs.m31_,
+            m32_ - rhs.m32_,
+            m33_ - rhs.m33_
+        );
+    }
     
     /// Multiply with a scalar.
-    Matrix4 operator * (float rhs) const;
+    Matrix4 operator * (float rhs) const
+    {
+        return Matrix4(
+            m00_ * rhs,
+            m01_ * rhs,
+            m02_ * rhs,
+            m03_ * rhs,
+            m10_ * rhs,
+            m11_ * rhs,
+            m12_ * rhs,
+            m13_ * rhs,
+            m20_ * rhs,
+            m21_ * rhs,
+            m22_ * rhs,
+            m23_ * rhs,
+            m30_ * rhs,
+            m31_ * rhs,
+            m32_ * rhs,
+            m33_ * rhs
+        );
+    }
     
     /// Multiply a matrix.
-    Matrix4 operator * (const Matrix4& rhs) const;
+    Matrix4 operator * (const Matrix4& rhs) const
+    {
+        return Matrix4(
+            m00_ * rhs.m00_ + m01_ * rhs.m10_ + m02_ * rhs.m20_ + m03_ * rhs.m30_,
+            m00_ * rhs.m01_ + m01_ * rhs.m11_ + m02_ * rhs.m21_ + m03_ * rhs.m31_,
+            m00_ * rhs.m02_ + m01_ * rhs.m12_ + m02_ * rhs.m22_ + m03_ * rhs.m32_,
+            m00_ * rhs.m03_ + m01_ * rhs.m13_ + m02_ * rhs.m23_ + m03_ * rhs.m33_,
+            m10_ * rhs.m00_ + m11_ * rhs.m10_ + m12_ * rhs.m20_ + m13_ * rhs.m30_,
+            m10_ * rhs.m01_ + m11_ * rhs.m11_ + m12_ * rhs.m21_ + m13_ * rhs.m31_,
+            m10_ * rhs.m02_ + m11_ * rhs.m12_ + m12_ * rhs.m22_ + m13_ * rhs.m32_,
+            m10_ * rhs.m03_ + m11_ * rhs.m13_ + m12_ * rhs.m23_ + m13_ * rhs.m33_,
+            m20_ * rhs.m00_ + m21_ * rhs.m10_ + m22_ * rhs.m20_ + m23_ * rhs.m30_,
+            m20_ * rhs.m01_ + m21_ * rhs.m11_ + m22_ * rhs.m21_ + m23_ * rhs.m31_,
+            m20_ * rhs.m02_ + m21_ * rhs.m12_ + m22_ * rhs.m22_ + m23_ * rhs.m32_,
+            m20_ * rhs.m03_ + m21_ * rhs.m13_ + m22_ * rhs.m23_ + m23_ * rhs.m33_,
+            m30_ * rhs.m00_ + m31_ * rhs.m10_ + m32_ * rhs.m20_ + m33_ * rhs.m30_,
+            m30_ * rhs.m01_ + m31_ * rhs.m11_ + m32_ * rhs.m21_ + m33_ * rhs.m31_,
+            m30_ * rhs.m02_ + m31_ * rhs.m12_ + m32_ * rhs.m22_ + m33_ * rhs.m32_,
+            m30_ * rhs.m03_ + m31_ * rhs.m13_ + m32_ * rhs.m23_ + m33_ * rhs.m33_
+        );
+    }
     
     /// Set translation elements.
-    void SetTranslation(const Vector3& translation);
+    void SetTranslation(const Vector3& translation)
+    {
+        m03_ = translation.x_;
+        m13_ = translation.y_;
+        m23_ = translation.z_;
+    }
     
     /// Set rotation elements from a 3x3 matrix.
-    void SetRotation(const Matrix3& rotation);
+    void SetRotation(const Matrix3& rotation)
+    {
+        m00_ = rotation.m00_;
+        m01_ = rotation.m01_;
+        m02_ = rotation.m02_;
+        m10_ = rotation.m10_;
+        m11_ = rotation.m11_;
+        m12_ = rotation.m12_;
+        m20_ = rotation.m20_;
+        m21_ = rotation.m21_;
+        m22_ = rotation.m22_;
+    }
     
     // Set scaling elements.
-    void SetScale(const Vector3& scale);
+    void SetScale(const Vector3& scale)
+    {
+        m00_ = scale.x_;
+        m11_ = scale.y_;
+        m22_ = scale.z_;
+    }
     
     // Set uniform scaling elements.
-    void SetScale(float scale);
+    void SetScale(float scale)
+    {
+        m00_ = scale;
+        m11_ = scale;
+        m22_ = scale;
+    }
     
     /// Return the combined rotation and scaling matrix.
-    Matrix3 ToMatrix3() const;
+    Matrix3 ToMatrix3() const
+    {
+        return Matrix3(
+            m00_,
+            m01_,
+            m02_,
+            m10_,
+            m11_,
+            m12_,
+            m20_,
+            m21_,
+            m22_
+        );
+    }
     
     /// Return the rotation matrix with scaling removed.
-    Matrix3 RotationMatrix() const;
+    Matrix3 RotationMatrix() const
+    {
+        Vector3 invScale(
+            1.0f / sqrtf(m00_ * m00_ + m10_ * m10_ + m20_ * m20_),
+            1.0f / sqrtf(m01_ * m01_ + m11_ * m11_ + m21_ * m21_),
+            1.0f / sqrtf(m02_ * m02_ + m12_ * m12_ + m22_ * m22_)
+        );
+        
+        return ToMatrix3().Scaled(invScale);
+    }
     
     /// Return the translation part.
-    Vector3 Translation() const;
+    Vector3 Translation() const
+    {
+        return Vector3(
+            m03_,
+            m13_,
+            m23_
+        );
+    }
     
     /// Return the rotation part.
-    Quaternion Rotation() const;
+    Quaternion Rotation() const { return Quaternion(RotationMatrix()); }
     
     /// Return the scaling part
-    Vector3 Scale() const;
+    Vector3 Scale() const
+    {
+        return Vector3(
+            sqrtf(m00_ * m00_ + m10_ * m10_ + m20_ * m20_),
+            sqrtf(m01_ * m01_ + m11_ * m11_ + m21_ * m21_),
+            sqrtf(m02_ * m02_ + m12_ * m12_ + m22_ * m22_)
+        );
+    }
     
     /// Return transpose
-    Matrix4 Transpose() const;
+    Matrix4 Transpose() const
+    {
+        return Matrix4(
+            m00_,
+            m10_,
+            m20_,
+            m30_,
+            m01_,
+            m11_,
+            m21_,
+            m31_,
+            m02_,
+            m12_,
+            m22_,
+            m32_,
+            m03_,
+            m13_,
+            m23_,
+            m33_
+        );
+    }
     
     /// Test for equality with another matrix with epsilon.
-    bool Equals(const Matrix4& rhs) const;
+    bool Equals(const Matrix4& rhs) const
+    {
+        const float* leftData = Data();
+        const float* rightData = rhs.Data();
+        
+        for (unsigned i = 0; i < 16; ++i)
+        {
+            if (!Urho3D::Equals(leftData[i], rightData[i]))
+                return false;
+        }
+        
+        return true;
+    }
     
     /// Return decomposition to translation, rotation and scale
     void Decompose(Vector3& translation, Quaternion& rotation, Vector3& scale) const;
-    
-	/// Return inverse
+    /// Return inverse
     Matrix4 Inverse() const;
     
     float m00_ @ m00;
@@ -97,7 +356,31 @@ public:
     float m33_ @ m33;
     
     /// Bulk transpose matrices.
-    static void BulkTranspose(float* dest, const float* src, unsigned count);
+    static void BulkTranspose(float* dest, const float* src, unsigned count)
+    {
+        for (unsigned i = 0; i < count; ++i)
+        {
+            dest[0] = src[0];
+            dest[1] = src[4];
+            dest[2] = src[8];
+            dest[3] = src[12];
+            dest[4] = src[1];
+            dest[5] = src[5];
+            dest[6] = src[9];
+            dest[7] = src[13];
+            dest[8] = src[2];
+            dest[9] = src[6];
+            dest[10] = src[10];
+            dest[11] = src[14];
+            dest[12] = src[3];
+            dest[13] = src[7];
+            dest[14] = src[11];
+            dest[15] = src[15];
+            
+            dest += 16;
+            src += 16;
+        }
+    }
     
     /// Zero matrix.
     static const Matrix4 ZERO;

+ 31 - 9
Extras/LuaScript/Pkgs/Math/Plane.pkg

@@ -5,32 +5,54 @@ class Plane
 {
 public:
     /// Construct undefined.
-    Plane();
+    Plane()
+    {
+    }
     
     /// Copy-construct from another plane.
-    Plane(const Plane& plane);
+    Plane(const Plane& plane) :
+        normal_(plane.normal_),
+        absNormal_(plane.absNormal_),
+        intercept_(plane.intercept_)
+    {
+    }
     
     /// Construct from 3 vertices.
-    Plane(const Vector3& v0, const Vector3& v1, const Vector3& v2);
+    Plane(const Vector3& v0, const Vector3& v1, const Vector3& v2)
+    {
+        Define(v0, v1, v2);
+    }
     
     /// Construct from a normal vector and a point on the plane.
-    Plane(const Vector3& normal, const Vector3& point);
+    Plane(const Vector3& normal, const Vector3& point)
+    {
+        Define(normal, point);
+    }
     
     /// Define from 3 vertices.
-    void Define(const Vector3& v0, const Vector3& v1, const Vector3& v2);
+    void Define(const Vector3& v0, const Vector3& v1, const Vector3& v2)
+    {
+        Vector3 dist1 = v1 - v0;
+        Vector3 dist2 = v2 - v0;
+        
+        Define(dist1.CrossProduct(dist2).Normalized(), v0);
+    }
 
     /// Define from a normal and a point.
-    void Define(const Vector3& normal, const Vector3& point);
+    void Define(const Vector3& normal, const Vector3& point)
+    {
+        normal_ = normal;
+        absNormal_ = normal.Abs();
+        intercept_ = normal.DotProduct(point);
+    }
     
     /// Return signed distance to a point.
-    float Distance(const Vector3& point) const;
+    float Distance(const Vector3& point) const { return normal_.DotProduct(point) - intercept_; }
     
     /// Plane normal.
     Vector3 normal_ @ normal;
-  
 	/// Plane absolute normal.
     Vector3 absNormal_ @ absNormal;
-    
 	/// Plane intercept parameter.
     float intercept_ @ intercept;
 };

+ 26 - 26
Extras/LuaScript/Pkgs/Math/Polyhedron.pkg

@@ -5,56 +5,56 @@ class Polyhedron
 {
 public:
     /// Construct empty.
-    Polyhedron();
+    Polyhedron()
+    {
+    }
     
     /// Copy-construct from another polyhedron.
-    Polyhedron(const Polyhedron& polyhedron);
+    Polyhedron(const Polyhedron& polyhedron) :
+        faces_(polyhedron.faces_)
+    {
+    }
     
     /// Construct from a bounding box.
-    Polyhedron(const BoundingBox& box);
+    Polyhedron(const BoundingBox& box)
+    {
+        Define(box);
+    }
     
     /// Construct from a frustum.
-    Polyhedron(const Frustum& frustum);
+    Polyhedron(const Frustum& frustum)
+    {
+        Define(frustum);
+    }
     
     /// Destruct.
     ~Polyhedron();
     
     /// Define from a bounding box.
     void Define(const BoundingBox& box);
-	
     /// Define from a frustum.
     void Define(const Frustum& frustum);
-    
-	/// Add a triangle face.
+    /// Add a triangle face.
     void AddFace(const Vector3& v0, const Vector3& v1, const Vector3& v2);
-    
-	/// Add a quadrilateral face.
+    /// Add a quadrilateral face.
     void AddFace(const Vector3& v0, const Vector3& v1, const Vector3& v2, const Vector3& v3);
-    
-	/// Clip with a plane.
+    /// Clip with a plane.
     void Clip(const Plane& plane);
-    
-	/// Clip with a bounding box.
+    /// Clip with a bounding box.
     void Clip(const BoundingBox& box);
-    
-	/// Clip with a frustum.
+    /// Clip with a frustum.
     void Clip(const Frustum& box);
-    
-	/// Clear all faces.
+    /// Clear all faces.
     void Clear();
-    
-	/// Transform with a 3x3 matrix.
+    /// Transform with a 3x3 matrix.
     void Transform(const Matrix3& transform);
-    
-	/// Transform with a 3x4 matrix.
+    /// Transform with a 3x4 matrix.
     void Transform(const Matrix3x4& transform);
     
     /// Return transformed with a 3x3 matrix.
     Polyhedron Transformed(const Matrix3& transform) const;
-    
-	/// Return transformed with a 3x4 matrix.
+    /// Return transformed with a 3x4 matrix.
     Polyhedron Transformed(const Matrix3x4& transform) const;
-    
-	/// Return whether is empty.
-    bool Empty() const;
+    /// Return whether is empty.
+    bool Empty() const { return faces_.Empty(); }
 };

+ 108 - 43
Extras/LuaScript/Pkgs/Math/Quaternion.pkg

@@ -5,28 +5,61 @@ class Quaternion
 {
 public:
     /// Construct identity quaternion.
-    Quaternion();
+    Quaternion() :
+        w_(1.0f),
+        x_(0.0f),
+        y_(0.0f),
+        z_(0.0f)
+    {
+    }
     
     /// Copy-construct from another quaternion.
-    Quaternion(const Quaternion& quat);
-    
-	/// Construct from values.
-    Quaternion(float w, float x, float y, float z);
+    Quaternion(const Quaternion& quat) :
+        w_(quat.w_),
+        x_(quat.x_),
+        y_(quat.y_),
+        z_(quat.z_)
+    {
+    }
+    
+    /// Construct from values.
+    Quaternion(float w, float x, float y, float z) :
+        w_(w),
+        x_(x),
+        y_(y),
+        z_(z)
+    {
+    }
     
     /// Construct from an angle (in degrees) and axis.
-    Quaternion(float angle, const Vector3& axis);
+    Quaternion(float angle, const Vector3& axis)
+    {
+        FromAngleAxis(angle, axis);
+    }
     
     /// Construct from Euler angles (in degrees.)
-    Quaternion(float x, float y, float z);
+    Quaternion(float x, float y, float z)
+    {
+        FromEulerAngles(x, y, z);
+    }
     
     /// Construct from the rotation difference between two vectors.
-    Quaternion(const Vector3& start, const Vector3& end);
+    Quaternion(const Vector3& start, const Vector3& end)
+    {
+        FromRotationTo(start, end);
+    }
     
     /// Construct from orthonormal axes.
-    Quaternion(const Vector3& xAxis, const Vector3& yAxis, const Vector3& zAxis);
+    Quaternion(const Vector3& xAxis, const Vector3& yAxis, const Vector3& zAxis)
+    {
+        FromAxes(xAxis, yAxis, zAxis);
+    }
 
     /// Construct from a rotation matrix.
-    Quaternion(const Matrix3& matrix);
+    Quaternion(const Matrix3& matrix)
+    {
+        FromRotationMatrix(matrix);
+    }
     
     /// Test for equality with another quaternion without epsilon.
     bool operator == (const Quaternion& rhs) const;
@@ -37,72 +70,104 @@ public:
 	/// Return negation.
     Quaternion operator - () const;
     
-	/// Add a quaternion.
-    Quaternion operator + (const Quaternion& rhs) const;
-	
+    /// Test for equality with another quaternion without epsilon.
+    bool operator == (const Quaternion& rhs) const { return w_ == rhs.w_ && x_ == rhs.x_ && y_ == rhs.y_ && z_ == rhs.z_; }
+    /// Multiply with a scalar.
+    Quaternion operator * (float rhs) const { return Quaternion(w_ * rhs, x_ * rhs, y_ * rhs, z_ * rhs); }
+    /// Return negation.
+    Quaternion operator - () const { return Quaternion(-w_, -x_, -y_, -z_); }
+    /// Add a quaternion.
+    Quaternion operator + (const Quaternion& rhs) const { return Quaternion(w_ + rhs.w_, x_ + rhs.x_, y_ + rhs.y_, z_ + rhs.z_); }
     /// Subtract a quaternion.
-    Quaternion operator - (const Quaternion& rhs) const;
+    Quaternion operator - (const Quaternion& rhs) const { return Quaternion(w_ - rhs.w_, x_ - rhs.x_, y_ - rhs.y_, z_ - rhs.z_); }
     
     /// Multiply a quaternion.
-    Quaternion operator * (const Quaternion& rhs) const;
+    Quaternion operator * (const Quaternion& rhs) const
+    {
+        return Quaternion(
+            w_ * rhs.w_ - x_ * rhs.x_ - y_ * rhs.y_ - z_ * rhs.z_,
+            w_ * rhs.x_ + x_ * rhs.w_ + y_ * rhs.z_ - z_ * rhs.y_,
+            w_ * rhs.y_ + y_ * rhs.w_ + z_ * rhs.x_ - x_ * rhs.z_,
+            w_ * rhs.z_ + z_ * rhs.w_ + x_ * rhs.y_ - y_ * rhs.x_
+        );
+    }
     
     /// Multiply a Vector3.
-    Vector3 operator * (const Vector3& rhs) const;
+    Vector3 operator * (const Vector3& rhs) const
+    {
+        Vector3 qVec(x_,y_,z_);
+        Vector3 cross1(qVec.CrossProduct(rhs));
+        Vector3 cross2(qVec.CrossProduct(cross1));
+        
+        return rhs + 2.0f * (cross1 * w_ + cross2);
+    }
     
-	
     /// Define from an angle (in degrees) and axis.
     void FromAngleAxis(float angle, const Vector3& axis);
-	
     /// Define from Euler angles (in degrees.)
     void FromEulerAngles(float x, float y, float z);
-    
-	/// Define from the rotation difference between two vectors.
+    /// Define from the rotation difference between two vectors.
     void FromRotationTo(const Vector3& start, const Vector3& end);
-    
-	/// Define from orthonormal axes.
+    /// Define from orthonormal axes.
     void FromAxes(const Vector3& xAxis, const Vector3& yAxis, const Vector3& zAxis);
-    
-	/// Define from a rotation matrix.
+    /// Define from a rotation matrix.
     void FromRotationMatrix(const Matrix3& matrix);
     
     /// Normalize to unit length and return the previous length.
-    float Normalize();
+    float Normalize()
+    {
+        float len = sqrtf(LengthSquared());
+        if (len >= M_EPSILON)
+            *this *= (1.0f / len);
+
+        return len;
+    }
     
     /// Return normalized to unit length.
-    Quaternion Normalized() const;
+    Quaternion Normalized() const
+    {
+        float lenSquared = LengthSquared();
+        if (lenSquared >= M_EPSILON * M_EPSILON)
+            return *this * (1.0f / sqrtf(lenSquared));
+        else
+            return IDENTITY;
+    }
     
     /// Return inverse.
-    Quaternion Inverse() const;
+    Quaternion Inverse() const
+    {
+        float lenSquared = LengthSquared();
+        if (lenSquared == 1.0f)
+            return Conjugate();
+        else if (lenSquared >= M_EPSILON)
+            return Conjugate() * (1.0f / lenSquared);
+        else
+            return IDENTITY;
+    }
     
     /// Return squared length.
-    float LengthSquared() const;
-	
+    float LengthSquared() const { return w_ * w_ + x_ * x_ + y_ * y_ + z_ * z_; }
     /// Calculate dot product.
-    float DotProduct(const Quaternion& rhs) const;
-	
+    float DotProduct(const Quaternion& rhs) const { return w_ * rhs.w_ + x_ * rhs.x_ + y_ * rhs.y_ + z_ * rhs.z_; }
     /// Test for equality with another quaternion with epsilon.
-    bool Equals(const Quaternion& rhs) const;
-	
+    bool Equals(const Quaternion& rhs) const { return Urho3D::Equals(w_, rhs.w_) && Urho3D::Equals(x_, rhs.x_) && Urho3D::Equals(y_, rhs.y_) && Urho3D::Equals(z_, rhs.z_); }
     /// Return conjugate.
-    Quaternion Conjugate() const;
+    Quaternion Conjugate() const { return Quaternion(w_, -x_, -y_, -z_); }
     
     /// Return Euler angles in degrees.
     Vector3 EulerAngles() const;
-	
     /// Return yaw angle in degrees.
     float YawAngle() const;
-    
-	/// Return pitch angle in degrees.
+    /// Return pitch angle in degrees.
     float PitchAngle() const;
-    
-	/// Return roll angle in degrees.
+    /// Return roll angle in degrees.
     float RollAngle() const;
-    
-	/// Return the rotation matrix that corresponds to this quaternion.
+    /// Return the rotation matrix that corresponds to this quaternion.
     Matrix3 RotationMatrix() const;
-    
-	/// Spherical interpolation with another quaternion.
+    /// Spherical interpolation with another quaternion.
     Quaternion Slerp(Quaternion rhs, float t) const;
+    /// Return as string.
+    String ToString() const;
     
 	/// W coordinate.
     float w_ @ w;

+ 29 - 26
Extras/LuaScript/Pkgs/Math/Ray.pkg

@@ -5,54 +5,57 @@ class Ray
 {
 public:
     /// Construct undefined.
-    Ray();
+    Ray()
+    {
+    }
     
     /// Construct from origin and direction. The direction must be normalized.
-    Ray(const Vector3& origin, const Vector3& direction);
+    Ray(const Vector3& origin, const Vector3& direction) :
+        origin_(origin),
+        direction_(direction)
+    {
+    }
     
     /// Copy-construct from another ray.
-    Ray(const Ray& ray);
+    Ray(const Ray& ray) :
+        origin_(ray.origin_),
+        direction_(ray.direction_)
+    {
+    }
     
     /// Check for equality with another ray.
-    bool operator == (const Ray& rhs) const;
+    bool operator == (const Ray& rhs) const { return origin_ == rhs.origin_ && direction_ == rhs.direction_; }
     
     /// Define from origin and direction. The direction will be normalized.
-    void Define(const Vector3& origin, const Vector3& direction);
+    void Define(const Vector3& origin, const Vector3& direction)
+    {
+        origin_ = origin;
+        direction_ = direction.Normalized();
+    }
     
     /// Project a point on the ray.
     Vector3 Project(const Vector3& point) const;
-	
     /// Return distance of a point from the ray
     float Distance(const Vector3& point) const;
-    
-	/// Return closest point to another ray.
+    /// Return closest point to another ray.
     Vector3 ClosestPoint(const Ray& ray) const;
-    
-	/// Return hit distance to a plane, or infinity if no hit.
+    /// Return hit distance to a plane, or infinity if no hit.
     float HitDistance(const Plane& plane) const;
-    
-	/// Return hit distance to a bounding box, or infinity if no hit.
+    /// Return hit distance to a bounding box, or infinity if no hit.
     float HitDistance(const BoundingBox& box) const;
-    
-	/// Return hit distance to a frustum, or infinity if no hit. If solidInside parameter is true (default) rays originating from inside return zero distance, otherwise the distance to the closest plane.
+    /// Return hit distance to a frustum, or infinity if no hit. If solidInside parameter is true (default) rays originating from inside return zero distance, otherwise the distance to the closest plane.
     float HitDistance(const Frustum& frustum, bool solidInside = true) const;
-    
-	/// Return hit distance to a sphere, or infinity if no hit.
+    /// Return hit distance to a sphere, or infinity if no hit.
     float HitDistance(const Sphere& sphere) const;
-    
-	/// Return hit distance to a triangle, or infinity if no hit.
+    /// Return hit distance to a triangle, or infinity if no hit.
     float HitDistance(const Vector3& v0, const Vector3& v1, const Vector3& v2) const;
-    
-	/// Return hit distance to non-indexed geometry data, or infinity if no hit.
+    /// Return hit distance to non-indexed geometry data, or infinity if no hit.
     float HitDistance(const void* vertexData, unsigned vertexSize, unsigned vertexStart, unsigned vertexCount) const;
-    
-	/// Return hit distance to indexed geometry data, or infinity if no hit.
+    /// Return hit distance to indexed geometry data, or infinity if no hit.
     float HitDistance(const void* vertexData, unsigned vertexSize, const void* indexData, unsigned indexSize, unsigned indexStart, unsigned indexCount) const;
-    
-	/// Return whether ray is inside non-indexed geometry.
+    /// Return whether ray is inside non-indexed geometry.
     bool InsideGeometry(const void* vertexData, unsigned vertexSize, unsigned vertexStart, unsigned vertexCount) const;
-    
-	/// Return whether ray is inside indexed geometry.
+    /// Return whether ray is inside indexed geometry.
     bool InsideGeometry(const void* vertexData, unsigned vertexSize, const void* indexData, unsigned indexSize, unsigned indexStart, unsigned indexCount) const;
     
     /// Ray origin.

+ 98 - 22
Extras/LuaScript/Pkgs/Math/Rect.pkg

@@ -5,58 +5,134 @@ class Rect
 {
 public:
     /// Construct an undefined rect.
-    Rect();
+    Rect() :
+        min_(Vector2::ZERO),
+        max_(Vector2::ZERO),
+        defined_(false)
+    {
+    }
     
     /// Copy-construct from another rect.
-    Rect(const Rect& rect);
+    Rect(const Rect& rect) :
+        min_(rect.min_),
+        max_(rect.max_),
+        defined_(rect.defined_)
+    {
+    }
     
     /// Construct from minimum and maximum vectors.
-    Rect(const Vector2& min, const Vector2& max);
+    Rect(const Vector2& min, const Vector2& max) :
+        min_(min),
+        max_(max),
+        defined_(true)
+    {
+    }
     
     /// Construct from coordinates.
-    Rect(float left, float top, float right, float bottom);
+    Rect(float left, float top, float right, float bottom) :
+        min_(left, top),
+        max_(right, bottom),
+        defined_(true)
+    {
+    }
     
     /// Construct from a Vector4.
-    Rect(const Vector4& vector);
+    Rect(const Vector4& vector) :
+        min_(vector.x_, vector.y_),
+        max_(vector.z_, vector.w_),
+        defined_(true)
+    {
+    }
 
     /// Test for equality with another rect.
-    bool operator == (const Rect& rhs) const;
+    bool operator == (const Rect& rhs) const { return min_ == rhs.min_ && max_ == rhs.max_; }
 	
     /// Define from another rect.
-    void Define(const Rect& rect);
+    void Define(const Rect& rect)
+    {
+        min_ = rect.min_;
+        max_ = rect.max_;
+        defined_ = true;
+    }
     
     /// Define from minimum and maximum vectors.
-    void Define(const Vector2& min, const Vector2& max);
+    void Define(const Vector2& min, const Vector2& max)
+    {
+        min_ = min;
+        max_ = max;
+        defined_ = true;
+    }
     
     /// Define from a point.
-    void Define(const Vector2& point);
+    void Define(const Vector2& point)
+    {
+        min_ = max_ = point;
+        defined_ = true;
+    }
     
     /// Merge a point.
-    void Merge(const Vector2& point);
+    void Merge(const Vector2& point)
+    {
+        if (!defined_)
+        {
+            min_ = max_ = point;
+            defined_ = true;
+        }
+        
+        if (point.x_ < min_.x_)
+            min_.x_ = point.x_;
+        if (point.x_ > max_.x_)
+            max_.x_ = point.x_;
+        if (point.y_ < min_.y_)
+            min_.y_ = point.y_;
+        if (point.y_ > max_.y_)
+            max_.y_ = point.y_;
+    }
     
     /// Merge a rect.
-    void Merge(const Rect& rect);
+    void Merge(const Rect& rect)
+    {
+        if (!defined_)
+        {
+            min_ = rect.min_;
+            max_ = rect.max_;
+            defined_ = true;
+        }
+        
+        if (rect.min_.x_ < min_.x_)
+            min_.x_ = rect.min_.x_;
+        if (rect.min_.y_ < min_.y_)
+            min_.y_ = rect.min_.y_;
+        if (rect.max_.x_ > max_.x_)
+            max_.x_ = rect.max_.x_;
+        if (rect.max_.y_ > max_.y_)
+            max_.y_ = rect.max_.y_;
+    }
     
     /// Clear to undefined state.
-    void Clear();
+    void Clear()
+    {
+        min_ = Vector2::ZERO;
+        max_ = Vector2::ZERO;
+        defined_ = false;
+    }
     
     /// Clip with another rect.
     void Clip(const Rect& rect);
     
     /// Return center.
-    Vector2 Center() const;
-    
-	/// Return size.    
-	Vector2 Size() const;
-    
-	/// Return half-size.
-    Vector2 HalfSize() const;
-	
+    Vector2 Center() const { return (max_ + min_) * 0.5f; }
+    /// Return size.
+    Vector2 Size() const { return max_ - min_; }
+    /// Return half-size.
+    Vector2 HalfSize() const { return (max_ - min_) * 0.5f; }
     /// Test for equality with another rect with epsilon.
-    bool Equals(const Rect& rhs) const;
+    bool Equals(const Rect& rhs) const { return min_.Equals(rhs.min_) && max_.Equals(rhs.max_); }
     
     /// Return as a vector.
-    Vector4 ToVector4() const;
+    Vector4 ToVector4() const { return Vector4(min_.x_, min_.y_, max_.x_, max_.y_); }
+    /// Return as string.
+    String ToString() const;
 	
     /// Minimum vector.
     Vector2 min_ @ min;

+ 110 - 30
Extras/LuaScript/Pkgs/Math/Sphere.pkg

@@ -5,85 +5,165 @@ class Sphere
 {
 public:
     /// Construct undefined.
-    Sphere();
+    Sphere() :
+        center_(Vector3::ZERO),
+        radius_(0.0f),
+        defined_(false)
+    {
+    }
     
     /// Copy-construct from another sphere.
-    Sphere(const Sphere& sphere);
+    Sphere(const Sphere& sphere) :
+        center_(sphere.center_),
+        radius_(sphere.radius_),
+        defined_(sphere.defined_)
+    {
+    }
     
     /// Construct from center and radius.
-    Sphere(const Vector3& center, float radius);
+    Sphere(const Vector3& center, float radius) :
+        center_(center),
+        radius_(radius),
+        defined_(true)
+    {
+    }
     
     /// Construct from an array of vertices.
-    Sphere(const Vector3* vertices, unsigned count);
+    Sphere(const Vector3* vertices, unsigned count) :
+        defined_(false)
+    {
+        Define(vertices, count);
+    }
     
     /// Construct from a bounding box.
-    Sphere(const BoundingBox& box);
+    Sphere(const BoundingBox& box) :
+        defined_(false)
+    {
+        Define(box);
+    }
     
     /// Construct from a frustum.
-    Sphere(const Frustum& frustum);
+    Sphere(const Frustum& frustum) :
+        defined_(false)
+    {
+        Define(frustum);
+    }
     
     /// Construct from a polyhedron.
-    Sphere(const Polyhedron& poly);
+    Sphere(const Polyhedron& poly) :
+        defined_(false)
+    {
+        Define(poly);
+    }
     
     /// Test for equality with another sphere.
-    bool operator == (const Sphere& rhs) const;
+    bool operator == (const Sphere& rhs) const { return center_ == rhs.center_ && radius_ == rhs.radius_; }
     
     /// Define from another sphere.
-    void Define(const Sphere& sphere);
+    void Define(const Sphere& sphere)
+    {
+        Define(sphere.center_, sphere.radius_);
+    }
     
     /// Define from center and radius.
-    void Define(const Vector3& center, float radius);
+    void Define(const Vector3& center, float radius)
+    {
+        center_ = center;
+        radius_ = radius;
+        defined_ = true;
+    }
     
     /// Define from an array of vertices.
     void Define(const Vector3* vertices, unsigned count);
-	
     /// Define from a bounding box.
     void Define(const BoundingBox& box);
-    
-	/// Define from a frustum.
+    /// Define from a frustum.
     void Define(const Frustum& frustum);
-    
-	/// Define from a polyhedron.
+    /// Define from a polyhedron.
     void Define(const Polyhedron& poly);
     
     /// Merge a point.
-    void Merge(const Vector3& point);
+    void Merge(const Vector3& point)
+    {
+        if (!defined_)
+        {
+            center_ = point;
+            radius_ = 0.0f;
+            defined_ = true;
+            return;
+        }
+        
+        Vector3 offset = point - center_;
+        float dist = offset.Length();
+        
+        if (dist > radius_)
+        {
+            float half = (dist - radius_) * 0.5f;
+            radius_ += half;
+            center_ += (half / dist) * offset;
+        }
+    }
     
     /// Merge an array of vertices.
     void Merge(const Vector3* vertices, unsigned count);
-    
-	/// Merge a bounding box.
+    /// Merge a bounding box.
     void Merge(const BoundingBox& box);
-    
-	/// Merge a frustum.
+    /// Merge a frustum.
     void Merge(const Frustum& frustum);
-    
-	/// Merge a polyhedron.
+    /// Merge a polyhedron.
     void Merge(const Polyhedron& poly);
-    
-	/// Merge a sphere.
+    /// Merge a sphere.
     void Merge(const Sphere& sphere);
     
     /// Clear to undefined state.
-    void Clear();
+    void Clear()
+    {
+        center_ = Vector3::ZERO;
+        radius_ = 0.0f;
+        defined_ = false;
+    }
     
     /// Test if a point is inside.
-    Intersection IsInside(const Vector3& point) const;
+    Intersection IsInside(const Vector3& point) const
+    {
+        float distSquared = (point - center_).LengthSquared();
+        if (distSquared < radius_ * radius_)
+            return INSIDE;
+        else
+            return OUTSIDE;
+    }
     
     /// Test if another sphere is inside, outside or intersects.
-    Intersection IsInside(const Sphere& sphere) const;
+    Intersection IsInside(const Sphere& sphere) const
+    {
+        float dist = (sphere.center_ - center_).Length();
+        if (dist >= sphere.radius_ + radius_)
+            return OUTSIDE;
+        else if (dist + sphere.radius_ < radius_)
+            return INSIDE;
+        else
+            return INTERSECTS;
+    }
     
     /// Test if another sphere is (partially) inside or outside.
-    Intersection IsInsideFast(const Sphere& sphere) const;
+    Intersection IsInsideFast(const Sphere& sphere) const
+    {
+        float distSquared = (sphere.center_ - center_).LengthSquared();
+        float combined = sphere.radius_ + radius_;
+        
+        if (distSquared >= combined * combined)
+            return OUTSIDE;
+        else
+            return INSIDE;
+    }
     
     /// Test if a bounding box is inside, outside or intersects.
     Intersection IsInside(const BoundingBox& box) const;
-	
     /// Test if a bounding box is (partially) inside or outside.
     Intersection IsInsideFast(const BoundingBox& box) const;
     
     /// Return distance of a point to the surface, or 0 if inside.
-    float Distance(const Vector3& point) const;
+    float Distance(const Vector3& point) const { return Max((point - center_).Length() - radius_, 0.0f); }
     
     /// Sphere center.
     Vector3 center_ @ center;

+ 28 - 11
Extras/LuaScript/Pkgs/Math/StringHash.pkg

@@ -5,32 +5,49 @@ class StringHash
 {
 public:
     /// Construct with zero value.
-    StringHash();
+    StringHash() :
+        value_(0)
+    {
+    }
     
     /// Copy-construct from another hash.
-    StringHash(const StringHash& rhs);
+    StringHash(const StringHash& rhs) :
+        value_(rhs.value_)
+    {
+    }
     
     /// Construct with an initial value.
-    explicit StringHash(unsigned value);
+    explicit StringHash(unsigned value) :
+        value_(value)
+    {
+    }
     
     /// Construct from a C string case-insensitively.
     StringHash(const char* str);
-	
     /// Construct from a string case-insensitively.
     StringHash(const String& str);
     
     /// Add a hash.
-    StringHash operator + (const StringHash& rhs) const;
+    StringHash operator + (const StringHash& rhs) const
+    {
+        StringHash ret;
+        ret.value_ = value_ + rhs.value_;
+        return ret;
+    }
     
     // Test for equality with another hash.
-    bool operator == (const StringHash& rhs) const;
-	
+    bool operator == (const StringHash& rhs) const { return value_ == rhs.value_; }
     /// Test if less than another hash.
-    bool operator < (const StringHash& rhs) const;
-	
+    bool operator < (const StringHash& rhs) const { return value_ < rhs.value_; }
+    /// Return true if nonzero hash value.
+    operator bool () const { return value_ != 0; }
     /// Return hash value.
-    unsigned Value() const;
-	
+    unsigned Value() const { return value_; }
+    /// Return as string.
+    String ToString() const;
+    /// Return hash value for HashSet & HashMap.
+    unsigned ToHash() const { return value_; }
+    
     /// Calculate hash value case-insensitively from a C string.
     static unsigned Calculate(const char* str);
     

+ 83 - 32
Extras/LuaScript/Pkgs/Math/Vector2.pkg

@@ -5,56 +5,90 @@ class Vector2
 {
 public:
     /// Construct undefined.
-    Vector2();
+    Vector2()
+    {
+    }
     
     /// Copy-construct from another vector.
-    Vector2(const Vector2& vector);
+    Vector2(const Vector2& vector) :
+        x_(vector.x_),
+        y_(vector.y_)
+    {
+    }
     
     /// Construct from coordinates.
-    Vector2(float x, float y);
+    Vector2(float x, float y) :
+        x_(x),
+        y_(y)
+    {
+    }
     
     /// Construct from a float array.
-    Vector2(const float* data);
+    Vector2(const float* data) :
+        x_(data[0]),
+        y_(data[1])
+    {
+    }
     
     /// Test for equality with another vector without epsilon.
-    bool operator == (const Vector2& rhs) const;
-    
-	/// Add a vector.
-    Vector2 operator + (const Vector2& rhs) const;
+    bool operator == (const Vector2& rhs) const { return x_ == rhs.x_ && y_ == rhs.y_; }
+    /// Add a vector.
+    Vector2 operator + (const Vector2& rhs) const { return Vector2(x_ + rhs.x_, y_ + rhs.y_); }
     /// Return negation.
-    Vector2 operator - () const;
+    Vector2 operator - () const { return Vector2(-x_, -y_); }
     /// Subtract a vector.
-    Vector2 operator - (const Vector2& rhs) const;
+    Vector2 operator - (const Vector2& rhs) const { return Vector2(x_ - rhs.x_, y_ - rhs.y_); }
     /// Multiply with a scalar.
-    Vector2 operator * (float rhs) const;
+    Vector2 operator * (float rhs) const { return Vector2(x_ * rhs, y_ * rhs); }
     /// Multiply with a vector.
-    Vector2 operator * (const Vector2& rhs) const;
+    Vector2 operator * (const Vector2& rhs) const { return Vector2(x_ * rhs.x_, y_ * rhs.y_); }
     /// Divide by a scalar.
-    Vector2 operator / (float rhs) const;
+    Vector2 operator / (float rhs) const { return Vector2(x_ / rhs, y_ / rhs); }
     /// Divide by a vector.
+    Vector2 operator / (const Vector2& rhs) const { return Vector2(x_ / rhs.x_, y_ / rhs.y_); }
     Vector2 operator / (const Vector2& rhs) const;
     
     /// Normalize to unit length and return the previous length.
-    float Normalize();
+    float Normalize()
+    {
+        float len = Length();
+        if (len >= M_EPSILON)
+        {
+            float invLen = 1.0f / len;
+            x_ *= invLen;
+            y_ *= invLen;
+        }
+        
+        return len;
+    }
     
     /// Return length.
-    float Length() const;
+    float Length() const { return sqrtf(x_ * x_ + y_ * y_); }
     /// Return squared length.
-    float LengthSquared() const;
+    float LengthSquared() const { return x_ * x_ + y_ * y_; }
     /// Calculate dot product.
-    float DotProduct(const Vector2& rhs) const;
+    float DotProduct(const Vector2& rhs) const { return x_ * rhs.x_ + y_ * rhs.y_; }
     /// Calculate absolute dot product.
-    float AbsDotProduct(const Vector2& rhs) const;
+    float AbsDotProduct(const Vector2& rhs) const { return Urho3D::Abs(x_ * rhs.x_) + Urho3D::Abs(y_ * rhs.y_); }
     /// Return absolute vector.
-    Vector2 Abs() const;
+    Vector2 Abs() const { return Vector2(Urho3D::Abs(x_), Urho3D::Abs(y_)); }
     /// Linear interpolation with another vector.
-    Vector2 Lerp(const Vector2& rhs, float t) const;
+    Vector2 Lerp(const Vector2& rhs, float t) const { return *this * (1.0f - t) + rhs * t; }
     /// Test for equality with another vector with epsilon.
-    bool Equals(const Vector2& rhs) const;
+    bool Equals(const Vector2& rhs) const { return Urho3D::Equals(x_, rhs.x_) && Urho3D::Equals(y_, rhs.y_); }
     
     /// Return normalized to unit length.
-    Vector2 Normalized() const;
-    
+    Vector2 Normalized() const
+    {
+        float len = Length();
+        if (len >= M_EPSILON)
+            return *this * (1.0f / len);
+        else
+            return *this;
+    }
+	    
+    /// Return as string.
+    String ToString() const;
     /// X coordinate.
     float x_ @ x;
     /// Y coordinate.
@@ -79,30 +113,47 @@ class IntVector2
 {
 public:
     /// Construct undefined.
-    IntVector2();
+    IntVector2()
+    {
+    }
     
     /// Construct from coordinates.
-    IntVector2(int x, int y);
+    IntVector2(int x, int y) :
+        x_(x),
+        y_(y)
+    {
+    }
     
     /// Construct from an int array.
-    IntVector2(const int* data);
+    IntVector2(const int* data) :
+        x_(data[0]),
+        y_(data[1])
+    {
+    }
     
     /// Copy-construct from another vector.
-    IntVector2(const IntVector2& rhs);
+    IntVector2(const IntVector2& rhs) :
+        x_(rhs.x_),
+        y_(rhs.y_)
+    {
+    }
     
     /// Test for equality with another vector.
-    bool operator == (const IntVector2& rhs) const;
+    bool operator == (const IntVector2& rhs) const { return x_ == rhs.x_ && y_ == rhs.y_; }
     /// Add a vector.
-    IntVector2 operator + (const IntVector2& rhs) const;
+    IntVector2 operator + (const IntVector2& rhs) const { return IntVector2(x_ + rhs.x_, y_ + rhs.y_); }
     /// Return negation.
-    IntVector2 operator - () const;
+    IntVector2 operator - () const { return IntVector2(-x_, -y_); }
     /// Subtract a vector.
-    IntVector2 operator - (const IntVector2& rhs) const;
+    IntVector2 operator - (const IntVector2& rhs) const { return IntVector2(x_ - rhs.x_, y_ - rhs.y_); }
     /// Multiply with a scalar.
-    IntVector2 operator * (int rhs) const;
+    IntVector2 operator * (int rhs) const { return IntVector2(x_ * rhs, y_ * rhs); }
     /// Divide by a scalar.
+    IntVector2 operator / (int rhs) const { return IntVector2(x_ / rhs, y_ / rhs); }
     IntVector2 operator / (int rhs) const;
     
+    /// Return as string.
+    String ToString() const;
     
     /// X coordinate.
     int x_ @ x;

+ 68 - 21
Extras/LuaScript/Pkgs/Math/Vector3.pkg

@@ -5,58 +5,105 @@ class Vector3
 {
 public:
     /// Construct undefined.
-    Vector3();
+    Vector3()
+    {
+    }
     
     /// Copy-construct from another vector.
-    Vector3(const Vector3& vector);
+    Vector3(const Vector3& vector) :
+        x_(vector.x_),
+        y_(vector.y_),
+        z_(vector.z_)
+    {
+    }
     
     /// Construct from a two-dimensional vector and the Z coordinate.
-    Vector3(const Vector2& vector, float z);
+    Vector3(const Vector2& vector, float z) :
+        x_(vector.x_),
+        y_(vector.y_),
+        z_(z)
+    {
+    }
     
     /// Construct from coordinates.
-    Vector3(float x, float y, float z);
+    Vector3(float x, float y, float z) :
+        x_(x),
+        y_(y),
+        z_(z)
+    {
+    }
     
     /// Test for equality with another vector without epsilon.
-    bool operator == (const Vector3& rhs) const;
+    bool operator == (const Vector3& rhs) const { return x_ == rhs.x_ && y_ == rhs.y_ && z_ == rhs.z_; }
     /// Add a vector.
-    Vector3 operator + (const Vector3& rhs) const;
+    Vector3 operator + (const Vector3& rhs) const { return Vector3(x_ + rhs.x_, y_ + rhs.y_, z_ + rhs.z_); }
     /// Return negation.
-    Vector3 operator - () const;
+    Vector3 operator - () const { return Vector3(-x_, -y_, -z_); }
     /// Subtract a vector.
-    Vector3 operator - (const Vector3& rhs) const;
+    Vector3 operator - (const Vector3& rhs) const { return Vector3(x_ - rhs.x_, y_ - rhs.y_, z_ - rhs.z_); }
     /// Multiply with a scalar.
-    Vector3 operator * (float rhs) const;
+    Vector3 operator * (float rhs) const { return Vector3(x_ * rhs, y_ * rhs, z_ * rhs); }
     /// Multiply with a vector.
-    Vector3 operator * (const Vector3& rhs) const;
+    Vector3 operator * (const Vector3& rhs) const { return Vector3(x_ * rhs.x_, y_ * rhs.y_, z_ * rhs.z_); }
     /// Divide by a scalar.
-    Vector3 operator / (float rhs) const;
+    Vector3 operator / (float rhs) const { return Vector3(x_ / rhs, y_ / rhs, z_ / rhs); }
     /// Divide by a vector.
+    Vector3 operator / (const Vector3& rhs) const { return Vector3(x_ / rhs.x_, y_ / rhs.y_, z_ / rhs.z_); }
     Vector3 operator / (const Vector3& rhs) const;
     
     /// Normalize to unit length and return the previous length.
-    float Normalize();
+    float Normalize()
+    {
+        float len = Length();
+        if (len >= M_EPSILON)
+        {
+            float invLen = 1.0f / len;
+            x_ *= invLen;
+            y_ *= invLen;
+            z_ *= invLen;
+        }
+        
+        return len;
+    }
     
     /// Return length.
-    float Length() const;
+    float Length() const { return sqrtf(x_ * x_ + y_ * y_ + z_ * z_); }
     /// Return squared length.
-    float LengthSquared() const;
+    float LengthSquared() const { return x_ * x_ + y_ * y_ + z_ * z_; }
     /// Calculate dot product.
-    float DotProduct(const Vector3& rhs) const;
+    float DotProduct(const Vector3& rhs) const { return x_ * rhs.x_ + y_ * rhs.y_ + z_ * rhs.z_; }
     /// Calculate absolute dot product.
-    float AbsDotProduct(const Vector3& rhs) const;
+    float AbsDotProduct(const Vector3& rhs) const { return Urho3D::Abs(x_ * rhs.x_) + Urho3D::Abs(y_ * rhs.y_) + Urho3D::Abs(z_ * rhs.z_); }
     
     /// Calculate cross product.
-    Vector3 CrossProduct(const Vector3& rhs) const;
+    Vector3 CrossProduct(const Vector3& rhs) const
+    {
+        return Vector3(
+            y_ * rhs.z_ - z_ * rhs.y_,
+            z_ * rhs.x_ - x_ * rhs.z_,
+            x_ * rhs.y_ - y_ * rhs.x_
+        );
+    }
     
     /// Return absolute vector.
-    Vector3 Abs() const;
+    Vector3 Abs() const { return Vector3(Urho3D::Abs(x_), Urho3D::Abs(y_), Urho3D::Abs(z_)); }
     /// Linear interpolation with another vector.
-    Vector3 Lerp(const Vector3& rhs, float t) const;
+    Vector3 Lerp(const Vector3& rhs, float t) const { return *this * (1.0f - t) + rhs * t; }
     /// Test for equality with another vector with epsilon.
-    bool Equals(const Vector3& rhs) const;
+    bool Equals(const Vector3& rhs) const { return Urho3D::Equals(x_, rhs.x_) && Urho3D::Equals(y_, rhs.y_) && Urho3D::Equals(z_, rhs.z_); }
     
     /// Return normalized to unit length.
-    Vector3 Normalized() const;
+    Vector3 Normalized() const
+    {
+        float len = Length();
+        if (len >= M_EPSILON)
+            return *this * (1.0f / len);
+        else
+            return *this;
+    }
+    
+    /// Return as string.
+    String ToString() const;
     
 	/// X coordinate.
     float x_ @ x;

+ 41 - 16
Extras/LuaScript/Pkgs/Math/Vector4.pkg

@@ -5,45 +5,70 @@ class Vector4
 {
 public:
     /// Construct undefined.
-    Vector4();
+    Vector4()
+    {
+    }
     
     /// Copy-construct from another vector.
-    Vector4(const Vector4& vector);
+    Vector4(const Vector4& vector) :
+        x_(vector.x_),
+        y_(vector.y_),
+        z_(vector.z_),
+        w_(vector.w_)
+    {
+    }
     
     /// Construct from a 3-dimensional vector and the W coordinate.
-    Vector4(const Vector3& vector, float w);
+    Vector4(const Vector3& vector, float w) :
+        x_(vector.x_),
+        y_(vector.y_),
+        z_(vector.z_),
+        w_(w)
+    {
+    }
     
     /// Construct from coordinates.
-    Vector4(float x, float y, float z, float w);
+    Vector4(float x, float y, float z, float w) :
+        x_(x),
+        y_(y),
+        z_(z),
+        w_(w)
+    {
+    }
     
     /// Test for equality with another vector without epsilon.
-    bool operator == (const Vector4& rhs) const;
+    bool operator == (const Vector4& rhs) const { return x_ == rhs.x_ && y_ == rhs.y_ && z_ == rhs.z_ && w_ == rhs.w_; }
 
 	/// Add a vector.
-    Vector4 operator + (const Vector4& rhs) const;
+    Vector4 operator + (const Vector4& rhs) const { return Vector4(x_ + rhs.x_, y_ + rhs.y_, z_ + rhs.z_, w_ + rhs.w_); }
     /// Return negation.
-    Vector4 operator - () const;
+    Vector4 operator - () const { return Vector4(-x_, -y_, -z_, -w_); }
     /// Subtract a vector.
-    Vector4 operator - (const Vector4& rhs) const;
+    Vector4 operator - (const Vector4& rhs) const { return Vector4(x_ - rhs.x_, y_ - rhs.y_, z_ - rhs.z_, w_ - rhs.w_); }
     /// Multiply with a scalar.
-    Vector4 operator * (float rhs) const;
+    Vector4 operator * (float rhs) const { return Vector4(x_ * rhs, y_ * rhs, z_ * rhs, w_ * rhs); }
     /// Multiply with a vector.
-    Vector4 operator * (const Vector4& rhs) const;
+    Vector4 operator * (const Vector4& rhs) const { return Vector4(x_ * rhs.x_, y_ * rhs.y_, z_ * rhs.z_, w_ * rhs.w_); }
     /// Divide by a scalar.
-    Vector4 operator / (float rhs) const;
+    Vector4 operator / (float rhs) const { return Vector4(x_ / rhs, y_ / rhs, z_ / rhs, w_ / rhs); }
     /// Divide by a vector.
+    Vector4 operator / (const Vector4& rhs) const { return Vector4(x_ / rhs.x_, y_ / rhs.y_, z_ / rhs.z_, w_ / rhs.w_); }
     Vector4 operator / (const Vector4& rhs) const;
     
     /// Calculate dot product.
-    float DotProduct(const Vector4& rhs) const;
+    float DotProduct(const Vector4& rhs) const { return x_ * rhs.x_ + y_ * rhs.y_ + z_ * rhs.z_ + w_ * rhs.w_; }
     /// Calculate absolute dot product.
-    float AbsDotProduct(const Vector4& rhs) const;
+    float AbsDotProduct(const Vector4& rhs) const { return Urho3D::Abs(x_ * rhs.x_) + Urho3D::Abs(y_ * rhs.y_) + Urho3D::Abs(z_ * rhs.z_) + Urho3D::Abs(w_ * rhs.w_); }
     /// Return absolute vector.
-    Vector4 Abs() const;
+    Vector4 Abs() const { return Vector4(Urho3D::Abs(x_), Urho3D::Abs(y_), Urho3D::Abs(z_), Urho3D::Abs(w_)); }
     /// Linear interpolation with another vector.
-    Vector4 Lerp(const Vector4& rhs, float t) const;
+    Vector4 Lerp(const Vector4& rhs, float t) const { return *this * (1.0f - t) + rhs * t; }
     /// Test for equality with another vector with epsilon.
-    bool Equals(const Vector4& rhs) const;
+    bool Equals(const Vector4& rhs) const { return Urho3D::Equals(x_, rhs.x_) && Urho3D::Equals(y_, rhs.y_) && Urho3D::Equals(z_, rhs.z_) && Urho3D::Equals(w_, rhs.w_); }
+    
+
+    /// Return as string.
+    String ToString() const;
     
     /// X coordinate.
     float x_ @ x;

+ 1 - 1
Extras/LuaScript/Pkgs/Navigation/Navigable.pkg

@@ -7,5 +7,5 @@ public:
     /// Set whether geometry is automatically collected from child nodes. Default true.
     void SetRecursive(bool enable);
     /// Return whether geometry is automatically collected from child nodes.
-    bool IsRecursive() const;
+    bool IsRecursive() const { return recursive_; }
 };

+ 22 - 18
Extras/LuaScript/Pkgs/Navigation/NavigationMesh.pkg

@@ -49,8 +49,11 @@ public:
     bool Build();
     /// Rebuild part of the navigation mesh contained by the world-space bounding box. Return true if successful.
     bool Build(const BoundingBox& boundingBox);
+    
     /// Find a path between world space points. Return non-empty list of points if successful. Extents specifies how far off the navigation mesh the points can be.
-    void FindPath(PODVector<Vector3>& dest, const Vector3& start, const Vector3& end, const Vector3& extents = Vector3::ONE);
+    // void FindPath(PODVector<Vector3>& dest, const Vector3& start, const Vector3& end, const Vector3& extents = Vector3::ONE);
+    tolua_outside PODVector<Vector3> NavigationMeshFindPath @ FindPath(const Vector3& start, const Vector3& end, const Vector3& extents = Vector3::ONE);
+    
     /// Return a random point on the navigation mesh.
     Vector3 GetRandomPoint();
     /// Return a random point on the navigation mesh within a circle. The circle radius is only a guideline and in practice the returned point may be further away.
@@ -61,39 +64,40 @@ public:
     Vector3 Raycast(const Vector3& start, const Vector3& end, const Vector3& extents = Vector3::ONE);
 
     /// Return tile size.
-    int GetTileSize() const;
+    int GetTileSize() const { return tileSize_; }
     /// Return cell size.
-    float GetCellSize() const;
+    float GetCellSize() const { return cellSize_; }
     /// Return cell height.
-    float GetCellHeight() const;
+    float GetCellHeight() const { return cellHeight_; }
     /// Return navigation agent height.
-    float GetAgentHeight() const;
+    float GetAgentHeight() const { return agentHeight_; }
     /// Return navigation agent radius.
-    float GetAgentRadius() const;
+    float GetAgentRadius() const { return agentRadius_; }
     /// Return navigation agent max vertical climb.
-    float GetAgentMaxClimb() const;
+    float GetAgentMaxClimb() const { return agentMaxClimb_; }
     /// Return navigation agent max slope.
-    float GetAgentMaxSlope() const;
+    float GetAgentMaxSlope() const { return agentMaxSlope_; }
     /// Return region minimum size.
-    float GetRegionMinSize() const;
+    float GetRegionMinSize() const { return regionMinSize_; }
     /// Return region merge size.
-    float GetRegionMergeSize() const;
+    float GetRegionMergeSize() const { return regionMergeSize_; }
     /// Return edge max length.
-    float GetEdgeMaxLength() const;
+    float GetEdgeMaxLength() const { return edgeMaxLength_; }
     /// Return edge max error.
-    float GetEdgeMaxError() const;
+    float GetEdgeMaxError() const { return edgeMaxError_; }
     /// Return detail sampling distance.
-    float GetDetailSampleDistance() const;
+    float GetDetailSampleDistance() const { return detailSampleDistance_; }
     /// Return detail sampling maximum error.
-    float GetDetailSampleMaxError() const;
+    float GetDetailSampleMaxError() const { return detailSampleMaxError_; }
     /// Return navigation mesh bounding box padding.
-    const Vector3& GetPadding() const;
+    const Vector3& GetPadding() const { return padding_; }
     /// Return whether has been initialized with valid navigation data.
-    bool IsInitialized() const;
+    bool IsInitialized() const { return navMesh_ != 0; }
     /// Return local space bounding box of the navigation mesh.
-    const BoundingBox& GetBoundingBox() const;
+    const BoundingBox& GetBoundingBox() const { return boundingBox_; }
     /// Return world space bounding box of the navigation mesh.
     BoundingBox GetWorldBoundingBox() const;
     /// Return number of tiles.
-    IntVector2 GetNumTiles() const;    
+    IntVector2 GetNumTiles() const { return IntVector2(numTilesX_, numTilesZ_); }
+
 };

+ 3 - 2
Extras/LuaScript/Pkgs/Navigation/OffMeshConnection.pkg

@@ -14,7 +14,8 @@ public:
     /// Return endpoint node.
     Node* GetEndPoint() const;
     /// Return radius.
-    float GetRadius() const;
+    float GetRadius() const { return radius_; }
     /// Return whether is bidirectional.
-    bool IsBidirectional() const;
+    bool IsBidirectional() const { return bidirectional_; }
+
 };

+ 7 - 7
Extras/LuaScript/Pkgs/Network/Connection.pkg

@@ -53,23 +53,23 @@ public:
     bool ProcessMessage(int msgID, MemoryBuffer& msg);
     
     /// Return client identity.
-    const VariantMap& GetIdentity() const;
+    const VariantMap& GetIdentity() const { return identity_; }
     /// Return the scene used by this connection.
     Scene* GetScene() const;
     /// Return the client controls of this connection.
-    const Controls& GetControls() const;
+    const Controls& GetControls() const { return controls_; }
     /// Return the observer position for interest management.
-    const Vector3& GetPosition() const;
+    const Vector3& GetPosition() const { return position_; }
     /// Return whether is a client connection.
-    bool IsClient() const;
+    bool IsClient() const { return isClient_; }
     /// Return whether is fully connected.
     bool IsConnected() const;
     /// Return whether connection is pending.
-    bool IsConnectPending() const;
+    bool IsConnectPending() const { return connectPending_; }
     /// Return whether the scene is loaded and ready to receive server updates.
-    bool IsSceneLoaded() const;
+    bool IsSceneLoaded() const { return sceneLoaded_; }
     /// Return whether to log data in/out statistics.
-    bool GetLogStatistics() const;
+    bool GetLogStatistics() const { return logStatistics_; }
     /// Return remote address.
     String GetAddress() const;
     /// Return remote port.

+ 13 - 4
Extras/LuaScript/Pkgs/Network/Controls.pkg

@@ -8,13 +8,22 @@ public:
     void Reset();
     
     /// Set or release buttons.
-    void Set(unsigned buttons, bool down = true);
+    void Set(unsigned buttons, bool down = true)
+    {
+        if (down)
+            buttons_ |= buttons;
+        else
+            buttons_ &= ~buttons;
+    }
     
     /// Check if a button is held down.
-    bool IsDown(unsigned button) const;
-	
+    bool IsDown(unsigned button) const
+    {
+        return (buttons_ & button) != 0;
+    }
+    
     /// Check if a button was pressed on this frame. Requires previous frame's controls.
-    bool IsPressed(unsigned button, const Controls& previousControls) const;
+    bool IsPressed(unsigned button, const Controls& previousControls) const { return (buttons_ & button) != 0 && (previousControls.buttons_ & button) == 0; }
     
     /// Button state.
     unsigned buttons_ @ buttons;

+ 2 - 2
Extras/LuaScript/Pkgs/Network/Network.pkg

@@ -34,7 +34,7 @@ public:
     void SetPackageCacheDir(const String& path);
     
     /// Return network update FPS.
-    int GetUpdateFps() const;
+    int GetUpdateFps() const { return updateFps_; }
     /// Return the connection to the server. Null if not connected.
     Connection* GetServerConnection() const;
     /// Return whether the server is running.
@@ -42,7 +42,7 @@ public:
     /// Return whether a remote event is allowed to be sent and received. If no events are registered, all are allowed.
     bool CheckRemoteEvent(StringHash eventType) const;
     /// Return the package download cache directory.
-    const String& GetPackageCacheDir() const;
+    const String& GetPackageCacheDir() const { return packageCacheDir_; }
 };
 
 Network* GetNetwork();

+ 4 - 4
Extras/LuaScript/Pkgs/Network/NetworkPriority.pkg

@@ -14,13 +14,13 @@ public:
     void SetAlwaysUpdateOwner(bool enable);
     
     /// Return base priority.
-    float GetBasePriority() const;
+    float GetBasePriority() const { return basePriority_; }
     /// Return priority reduction distance factor.
-    float GetDistanceFactor() const;
+    float GetDistanceFactor() const { return distanceFactor_; }
     /// Return minimum priority.
-    float GetMinPriority() const;
+    float GetMinPriority() const { return minPriority_; }
     /// Return whether updates to owner should be sent always at full rate.
-    bool GetAlwaysUpdateOwner() const;
+    bool GetAlwaysUpdateOwner() const { return alwaysUpdateOwner_; }
     
     /// Increment and check priority accumulator. Return true if should update. Called by Connection.
     bool CheckUpdate(float distance, float& accumulator);

+ 8 - 8
Extras/LuaScript/Pkgs/Physics/CollisionShape.pkg

@@ -54,21 +54,21 @@ public:
     void SetLodLevel(unsigned lodLevel);
     
     /// Return physics world.
-    PhysicsWorld* GetPhysicsWorld() const;
+    PhysicsWorld* GetPhysicsWorld() const { return physicsWorld_; }
     /// Return shape type.
-    ShapeType GetShapeType() const;
+    ShapeType GetShapeType() const { return shapeType_; }
     /// Return shape size.
-    const Vector3& GetSize() const;
+    const Vector3& GetSize() const { return size_; }
     /// Return offset position.
-    const Vector3& GetPosition() const;
+    const Vector3& GetPosition() const { return position_; }
     /// Return offset rotation.
-    const Quaternion& GetRotation() const;
+    const Quaternion& GetRotation() const { return rotation_; }
     /// Return collision margin.
-    float GetMargin() const;
+    float GetMargin() const { return margin_; }
     /// Return triangle mesh / convex hull model.
-    Model* GetModel() const;
+    Model* GetModel() const { return model_; }
     /// Return model LOD level.
-    unsigned GetLodLevel() const;
+    unsigned GetLodLevel() const { return lodLevel_; }
     /// Return world-space bounding box.
     BoundingBox GetWorldBoundingBox() const;
     

+ 13 - 13
Extras/LuaScript/Pkgs/Physics/Constraint.pkg

@@ -43,33 +43,33 @@ public:
     void SetDisableCollision(bool disable);
     
     /// Return physics world.
-    PhysicsWorld* GetPhysicsWorld() const;
+    PhysicsWorld* GetPhysicsWorld() const { return physicsWorld_; }
     /// Return constraint type.
-    ConstraintType GetConstraintType() const;
+    ConstraintType GetConstraintType() const { return constraintType_; }
     /// Return rigid body in own scene node.
-    RigidBody* GetOwnBody() const;
+    RigidBody* GetOwnBody() const { return ownBody_; }
     /// Return the other rigid body. May be null if connected to the static world.
-    RigidBody* GetOtherBody() const;
+    RigidBody* GetOtherBody() const { return otherBody_; }
     /// Return constraint position relative to own body.
-    const Vector3& GetPosition() const;
+    const Vector3& GetPosition() const { return position_; }
     /// Return constraint rotation relative to own body.
-    const Quaternion& GetRotation() const;
+    const Quaternion& GetRotation() const { return rotation_; }
     /// Return constraint position relative to other body.
-    const Vector3& GetOtherPosition() const;
+    const Vector3& GetOtherPosition() const { return otherPosition_; }
     /// Return constraint rotation relative to other body.
-    const Quaternion& GetOtherRotation() const;
+    const Quaternion& GetOtherRotation() const { return otherRotation_; }
     /// Return constraint world position, calculated from own body.
     Vector3 GetWorldPosition() const;
     /// Return high limit.
-    const Vector2& GetHighLimit() const;
+    const Vector2& GetHighLimit() const { return highLimit_; }
     /// Return low limit.
-    const Vector2& GetLowLimit() const;
+    const Vector2& GetLowLimit() const { return lowLimit_; }
     /// Return constraint error reduction parameter.
-    float GetERP() const;
+    float GetERP() const { return erp_; }
     /// Return constraint force mixing parameter.
-    float GetCFM() const;
+    float GetCFM() const { return cfm_; }
     /// Return whether collisions between connected bodies are disabled.
-    bool GetDisableCollision() const;
+    bool GetDisableCollision() const { return disableCollision_; }
     
     /// Release the constraint.
     void ReleaseConstraint();

+ 12 - 12
Extras/LuaScript/Pkgs/Physics/RigidBody.pkg

@@ -82,9 +82,9 @@ public:
     void ReAddBodyToWorld();
     
     /// Return physics world.
-    PhysicsWorld* GetPhysicsWorld() const;
+    PhysicsWorld* GetPhysicsWorld() const { return physicsWorld_; }
     /// Return mass.
-    float GetMass() const;
+    float GetMass() const { return mass_; }
     /// Return rigid body world-space position.
     Vector3 GetPosition() const;
     /// Return rigid body world-space rotation.
@@ -98,7 +98,7 @@ public:
     /// Return linear velocity deactivation threshold.
     float GetLinearRestThreshold() const;
     /// Return linear velocity damping threshold.
-    // float GetLinearDamping() const;
+    float GetLinearDamping() const;
     /// Return linear velocity damping scale.
     // float GetLinearDampingScale() const;
     /// Return angular velocity.
@@ -108,7 +108,7 @@ public:
     /// Return angular velocity deactivation threshold.
     float GetAngularRestThreshold() const;
     /// Return angular velocity damping threshold.
-    // float GetAngularDamping() const;
+    float GetAngularDamping() const;
     /// Return angular velocity damping scale.
     // float GetAngularDampingScale() const;
     /// Return friction coefficient.
@@ -122,23 +122,23 @@ public:
     /// Return continuous collision detection motion-per-simulation-step threshold.
     float GetCcdMotionThreshold() const;
     /// Return whether rigid body uses gravity.
-    bool GetUseGravity() const;
+    bool GetUseGravity() const { return useGravity_; }
     /// Return gravity override. If zero (default), uses the physics world's gravity.
-    const Vector3& GetGravityOverride() const;
+    const Vector3& GetGravityOverride() const { return gravityOverride_; }
     /// Return center of mass offset.
-    const Vector3& GetCenterOfMass() const;
+    const Vector3& GetCenterOfMass() const { return centerOfMass_; }
     /// Return kinematic mode flag.
-    bool IsKinematic() const;
+    bool IsKinematic() const { return kinematic_; }
     /// Return phantom mode flag.
-    bool IsPhantom() const;
+    bool IsPhantom() const { return phantom_; }
     /// Return whether rigid body is active (not sleeping.)
     bool IsActive() const;
     /// Return collision layer.
-    unsigned GetCollisionLayer() const;
+    unsigned GetCollisionLayer() const { return collisionLayer_; }
     /// Return collision mask.
-    unsigned GetCollisionMask() const;
+    unsigned GetCollisionMask() const { return collisionMask_; }
     /// Return collision event signaling mode.
-    CollisionEventMode GetCollisionEventMode() const;
+    CollisionEventMode GetCollisionEventMode() const { return collisionEventMode_; }
     
     /// Apply new world transform after a simulation step. Called internally.
     void ApplyWorldTransform(const Vector3& newWorldPosition, const Quaternion& newWorldRotation);

+ 8 - 5
Extras/LuaScript/Pkgs/Resource/Image.pkg

@@ -30,14 +30,17 @@ public:
     bool SaveJPG(const char* fileName, int quality);
     
     /// Return width.
-    int GetWidth() const;
+    int GetWidth() const { return width_; }
     /// Return height.
-    int GetHeight() const;
+    int GetHeight() const { return height_; }
     /// Return number of color components.
-    unsigned GetComponents() const;
+    unsigned GetComponents() const { return components_; }
     /// Return whether is compressed.
-    bool IsCompressed() const;
+    bool IsCompressed() const { return compressedFormat_ != CF_NONE; }
     /// Return compressed format.
-    CompressedFormat GetCompressedFormat() const;
+    CompressedFormat GetCompressedFormat() const { return compressedFormat_; }
+    /// Return number of compressed mip levels.
+    unsigned GetNumCompressedLevels() const { return numCompressedLevels_; }
+
 };
 

+ 4 - 5
Extras/LuaScript/Pkgs/Resource/Resource.pkg

@@ -4,12 +4,11 @@ $#include "Resource.h"
 class Resource
 {    
 public:
-    /// Set name.
-    void SetName(const String& name);
+
     /// Return name.
-    const String& GetName() const;
+    const String& GetName() const { return name_; }
     /// Return name hash.
-    StringHash GetNameHash() const;
+    StringHash GetNameHash() const { return nameHash_; }
     /// Return memory use in bytes, possibly approximate.
-    unsigned GetMemoryUse() const;
+    unsigned GetMemoryUse() const { return memoryUse_; }
 };

+ 7 - 3
Extras/LuaScript/Pkgs/Scene/Component.pkg

@@ -10,11 +10,15 @@ public:
     void Remove();
     
     /// Return ID.
-    unsigned GetID() const;
+    unsigned GetID() const { return id_; }
     /// Return scene node.
-    Node* GetNode() const;
+    Node* GetNode() const { return node_; }
     /// Return the scene the node belongs to.
     Scene* GetScene() const;
     /// Return whether is enabled.
-    bool IsEnabled() const;    
+    bool IsEnabled() const { return enabled_; }
+    /// Return whether is effectively enabled (node is also enabled.)
+    bool IsEnabledEffective() const;
+    /// Return component in the same scene node by type. If there are several, returns the first.
+    Component* GetComponent(ShortStringHash type) const;
 };

+ 51 - 21
Extras/LuaScript/Pkgs/Scene/Node.pkg

@@ -102,45 +102,75 @@ public:
     /// Remove listener component.
     void RemoveListener(Component* component);
     
-	/// Return ID.
-    unsigned GetID() const;
+    /// Return ID.
+    unsigned GetID() const { return id_; }
     /// Return name.
-    const String& GetName() const;
+    const String& GetName() const { return name_; }
     /// Return name hash.
-    StringHash GetNameHash() const;
+    StringHash GetNameHash() const { return nameHash_; }
     /// Return parent scene node.
-    Node* GetParent() const;
+    Node* GetParent() const { return parent_; }
     /// Return scene.
-    Scene* GetScene() const;
+    Scene* GetScene() const { return scene_; }
     /// Return whether is enabled. Disables nodes effectively disable all their components.
-    bool IsEnabled() const;
+    bool IsEnabled() const { return enabled_; }
     /// Return owner connection in networking.
-    Connection* GetOwner() const;
+    Connection* GetOwner() const { return owner_; }
     /// Return position relative to parent node.
-    const Vector3& GetPosition() const;
+    const Vector3& GetPosition() const { return position_; }
     /// Return rotation relative to parent node.
-    const Quaternion& GetRotation() const;
+    const Quaternion& GetRotation() const { return rotation_; }
     /// Return direction relative to parent node. Identity rotation equals positive Z.
-    Vector3 GetDirection() const;
+    Vector3 GetDirection() const { return rotation_ * Vector3::FORWARD; }
     /// Return scale relative to parent node.
-    const Vector3& GetScale() const;
+    const Vector3& GetScale() const { return scale_; }
     /// Return transform matrix relative to parent node.
-    Matrix3x4 GetTransform() const;
+    Matrix3x4 GetTransform() const { return Matrix3x4(position_, rotation_, scale_); }
 
     /// Return position in world space.
-    Vector3 GetWorldPosition() const;
+    Vector3 GetWorldPosition() const
+    {
+        if (dirty_)
+            UpdateWorldTransform();
+        
+        return worldTransform_.Translation();
+    }
 
     /// Return rotation in world space.
-    Quaternion GetWorldRotation() const;
+    Quaternion GetWorldRotation() const
+    {
+        if (dirty_)
+            UpdateWorldTransform();
+        
+        return worldRotation_;
+    }
 
     /// Return direction in world space.
-    Vector3 GetWorldDirection() const;
-	
+    Vector3 GetWorldDirection() const
+    {
+        if (dirty_)
+            UpdateWorldTransform();
+        
+        return worldRotation_ * Vector3::FORWARD;
+    }
+
     /// Return scale in world space.
-    Vector3 GetWorldScale() const;
+    Vector3 GetWorldScale() const
+    {
+        if (dirty_)
+            UpdateWorldTransform();
+        
+        return worldTransform_.Scale();
+    }
 
     /// Return transform matrix in world space.
-    const Matrix3x4& GetWorldTransform() const;
+    const Matrix3x4& GetWorldTransform() const
+    {
+        if (dirty_)
+            UpdateWorldTransform();
+        
+        return worldTransform_;
+    }
 
     /// Convert a local space position to world space.
     Vector3 LocalToWorld(const Vector3& position) const;
@@ -151,7 +181,7 @@ public:
     /// Convert a world space position or rotation to local space.
     Vector3 WorldToLocal(const Vector4& vector) const;
     /// Return whether transform has changed and world transform needs recalculation.
-    bool IsDirty() const;
+    bool IsDirty() const { return dirty_; }
     /// Return number of child scene nodes.
     unsigned GetNumChildren(bool recursive = false) const;
     /// Return child scene node by index.
@@ -163,7 +193,7 @@ public:
     /// Return child scene node by name hash.
     Node* GetChild(StringHash nameHash, bool recursive = false) const;
     /// Return number of components.
-    unsigned GetNumComponents() const;
+    unsigned GetNumComponents() const { return components_.Size(); }
     /// Return number of non-local components.
     unsigned GetNumNetworkComponents() const;
     /// Return component by type. If there are several, returns the first.

+ 9 - 9
Extras/LuaScript/Pkgs/Scene/Scene.pkg

@@ -33,23 +33,23 @@ public:
     /// Return component from the whole scene by ID, or null if not found.
     Component* GetComponent(unsigned id) const;
     /// Return whether updates are enabled.
-    bool IsUpdateEnabled() const;
+    bool IsUpdateEnabled() const { return updateEnabled_; }
     /// Return asynchronous loading flag.
-    bool IsAsyncLoading() const;
+    bool IsAsyncLoading() const { return asyncLoading_; }
     /// Return asynchronous loading progress between 0.0 and 1.0, or 1.0 if not in progress.
     float GetAsyncProgress() const;
     /// Return source file name.
-    const String& GetFileName() const;
+    const String& GetFileName() const { return fileName_; }
     /// Return source file checksum.
-    unsigned GetChecksum() const;
+    unsigned GetChecksum() const { return checksum_; }
     /// Return update time scale.
-    float GetTimeScale() const;
+    float GetTimeScale() const { return timeScale_; }
     /// Return elapsed time in seconds.
-    float GetElapsedTime() const;
+    float GetElapsedTime() const { return elapsedTime_; }
     /// Return motion smoothing constant.
-    float GetSmoothingConstant() const;
+    float GetSmoothingConstant() const { return smoothingConstant_; }
     /// Return motion smoothing snap threshold.
-    float GetSnapThreshold() const;
+    float GetSnapThreshold() const { return snapThreshold_; }
     /// Return a node user variable name, or empty if not registered.
     const String& GetVarName(ShortStringHash hash) const;
 
@@ -62,7 +62,7 @@ public:
     /// Add a component to the delayed dirty notify queue. Is thread-safe.
     void DelayedMarkedDirty(Component* component);
     /// Return threaded update flag.
-    bool IsThreadedUpdate() const;
+    bool IsThreadedUpdate() const { return threadedUpdate_; }
     /// Get free node ID, either non-local or local.
     unsigned GetFreeNodeID(CreateMode mode);
     /// Get free component ID, either non-local or local.

+ 11 - 9
Extras/LuaScript/Pkgs/UI/BorderImage.pkg

@@ -24,15 +24,17 @@ public:
     void SetTiled(bool enable);
     
     /// Return texture.
-    Texture* GetTexture() const;
+    Texture* GetTexture() const { return texture_; }
     /// Return image rectangle.
-    const IntRect& GetImageRect() const;
-	/// Return image border dimensions.
-    const IntRect& GetBorder() const;
-	/// Return offset to image rectangle used on hover.
-    const IntVector2& GetHoverOffset() const;
-	/// Return blend mode.
-    BlendMode GetBlendMode() const;
+    const IntRect& GetImageRect() const { return imageRect_; }
+    /// Return image border dimensions.
+    const IntRect& GetBorder() const { return border_; }
+    /// Return offset to image rectangle used on hover.
+    const IntVector2& GetHoverOffset() const { return hoverOffset_; }
+    /// Return blend mode.
+    BlendMode GetBlendMode() const { return blendMode_; }
     /// Return whether is tiled.
-    bool IsTiled() const;
+    bool IsTiled() const { return tiled_; }
 };
+
+BorderImage* NewBorderImage @ BorderImage();

+ 6 - 4
Extras/LuaScript/Pkgs/UI/Button.pkg

@@ -20,11 +20,13 @@ public:
     void SetRepeatRate(float rate);
     
     /// Return pressed image offset.
-    const IntVector2& GetPressedOffset() const;
+    const IntVector2& GetPressedOffset() const { return pressedOffset_; }
     /// Return pressed label offset.
-    const IntVector2& GetLabelOffset() const;
+    const IntVector2& GetLabelOffset() const { return labelOffset_; }
     /// Return repeat delay.
-    float GetRepeatDelay() const;
+    float GetRepeatDelay() const { return repeatDelay_; }
     /// Return repeat rate.
-    float GetRepeatRate() const;
+    float GetRepeatRate() const { return repeatRate_; }
 };
+
+Button* NewButton @ Button();

+ 4 - 2
Extras/LuaScript/Pkgs/UI/CheckBox.pkg

@@ -12,7 +12,9 @@ public:
     void SetCheckedOffset(int x, int y);
     
     /// Return whether is checked.
-    bool IsChecked() const;
+    bool IsChecked() const { return checked_; }
     /// Return checked image offset.
-    const IntVector2& GetCheckedOffset() const;
+    const IntVector2& GetCheckedOffset() const { return checkedOffset_; }
 };
+
+CheckBox* NewCheckBox @ CheckBox();

+ 3 - 2
Extras/LuaScript/Pkgs/UI/Cursor.pkg

@@ -21,9 +21,10 @@ public:
     /// Define a shape.
     void DefineShape(CursorShape shape, Image* image, const IntRect& imageRect, const IntVector2& hotSpot, bool osMouseVisible = false);
     /// Set current shape.
-    void SetShape(CursorShape shape);    
+    void SetShape(CursorShape shape);
+    
     /// Get current shape.
-    CursorShape GetShape() const;
+    CursorShape GetShape() const { return shape_; }
 };
 
 Cursor* NewCursor @ Cursor();

+ 6 - 4
Extras/LuaScript/Pkgs/UI/DropDownList.pkg

@@ -30,11 +30,13 @@ public:
     /// Return selected item, or null if none selected.
     UIElement* GetSelectedItem() const;
     /// Return listview element.
-    ListView* GetListView() const;
+    ListView* GetListView() const { return listView_; }
     /// Return selected item placeholder element.
-    UIElement* GetPlaceholder() const;
+    UIElement* GetPlaceholder() const { return placeholder_; }
     /// Return place holder text.
     const String& GetPlaceholderText() const;
     /// Return whether popup should be automatically resized.
-    bool GetResizePopup() const;
-};
+    bool GetResizePopup() const { return resizePopup_; }
+};
+
+DropDownList* NewDropDownList @ DropDownList();

+ 14 - 12
Extras/LuaScript/Pkgs/UI/FileSelector.pkg

@@ -33,27 +33,27 @@ public:
     /// Return the UI style file.
     XMLFile* GetDefaultStyle() const;
     /// Return fileselector window.
-    Window* GetWindow() const;
+    Window* GetWindow() const { return window_; }
     /// Return window title text element.
-    Text* GetTitleText() const;
+    Text* GetTitleText() const { return titleText_; }
     /// Return file list.
-    ListView* GetFileList() const;
+    ListView* GetFileList() const { return fileList_; }
     /// Return path editor.
-    LineEdit* GetPathEdit() const;
+    LineEdit* GetPathEdit() const { return pathEdit_; }
     /// Return filename editor.
-    LineEdit* GetFileNameEdit() const;
+    LineEdit* GetFileNameEdit() const { return fileNameEdit_; }
     /// Return filter dropdown.
-    DropDownList* GetFilterList() const;
+    DropDownList* GetFilterList() const { return filterList_; }
     /// Return OK button.
-    Button* GetOKButton() const;
+    Button* GetOKButton() const { return okButton_; }
     /// Return cancel button.
-    Button* GetCancelButton() const;
+    Button* GetCancelButton() const { return cancelButton_; }
     /// Return close button.
-    Button* GetCloseButton() const;
+    Button* GetCloseButton() const { return closeButton_; }
     /// Return window title.
     const String& GetTitle() const;
     /// Return current path.
-    const String& GetPath() const;
+    const String& GetPath() const { return path_; }
     /// Return current filename.
     const String& GetFileName() const;
     /// Return current filter.
@@ -61,5 +61,7 @@ public:
     /// Return current filter index.
     unsigned GetFilterIndex() const;
     /// Return directory mode flag.
-    bool GetDirectoryMode() const;
-};
+    bool GetDirectoryMode() const { return directoryMode_; }
+};
+
+FileSelector* NewFileSelector @ FileSelector();

+ 2 - 0
Extras/LuaScript/Pkgs/UI/Font.pkg

@@ -5,3 +5,5 @@ class Font : public Resource
 {
 public:    
 };
+
+Font* NewFont @ Font();

+ 13 - 11
Extras/LuaScript/Pkgs/UI/LineEdit.pkg

@@ -24,25 +24,27 @@ public:
     void SetDoubleClickInterval(float interval);
 
     /// Return text.
-    const String& GetText() const;
+    const String& GetText() const { return line_; }
     /// Return cursor position.
-    unsigned GetCursorPosition() const;
+    unsigned GetCursorPosition() const { return cursorPosition_; }
     /// Return cursor blink rate.
-    float GetCursorBlinkRate() const;
+    float GetCursorBlinkRate() const { return cursorBlinkRate_; }
     /// Return maximum text length.
-    unsigned GetMaxLength() const;
+    unsigned GetMaxLength() const { return maxLength_; }
     /// Return echo character.
-    unsigned GetEchoCharacter() const;
+    unsigned GetEchoCharacter() const { return echoCharacter_; }
     /// Return whether can move cursor with arrows or mouse.
-    bool IsCursorMovable() const;
+    bool IsCursorMovable() const { return cursorMovable_; }
     /// Return whether selections are allowed.
-    bool IsTextSelectable() const;
+    bool IsTextSelectable() const { return textSelectable_; }
     /// Return whether copy-paste operations are allowed.
-    bool IsTextCopyable() const;
+    bool IsTextCopyable() const { return textCopyable_; }
     /// Return text element.
-    Text* GetTextElement() const;
+    Text* GetTextElement() const { return text_; }
     /// Return cursor element.
-    BorderImage* GetCursor() const;
+    BorderImage* GetCursor() const { return cursor_; }
     /// Return text selection doubleclick interval in seconds.
     float GetDoubleClickInterval() const;
-};
+};
+
+LineEdit* NewLineEdit @ LineEdit();

+ 8 - 6
Extras/LuaScript/Pkgs/UI/ListView.pkg

@@ -74,15 +74,17 @@ public:
     /// Return whether an item at index has its children expanded (in hierachy mode only).
     bool IsExpanded(unsigned index) const;
     /// Return highlight mode.
-    HighlightMode GetHighlightMode() const;
+    HighlightMode GetHighlightMode() const { return highlightMode_; }
     /// Return whether multiselect enabled.
-    bool GetMultiselect() const;
+    bool GetMultiselect() const { return multiselect_; }
     /// Return whether selection is cleared on defocus.
-    bool GetClearSelectionOnDefocus() const;
+    bool GetClearSelectionOnDefocus() const { return clearSelectionOnDefocus_; }
     /// Return whether hierarchy mode enabled.
-    bool GetHierarchyMode() const;
+    bool GetHierarchyMode() const { return hierarchyMode_; }
     /// Return base indent.
-    int GetBaseIndent() const;
+    int GetBaseIndent() const { return baseIndent_; }
     /// Return item doubleclick interval in seconds.
     float GetDoubleClickInterval() const;
-};
+};
+
+ListView* NewListView @ ListView();

+ 7 - 4
Extras/LuaScript/Pkgs/UI/Menu.pkg

@@ -16,13 +16,16 @@ public:
     void SetAccelerator(int key, int qualifiers);
 
     /// Return popup element.
-    UIElement* GetPopup() const;
+    UIElement* GetPopup() const { return popup_; }
     /// Return popup element offset.
-    const IntVector2& GetPopupOffset() const;
+    const IntVector2& GetPopupOffset() const { return popupOffset_; }
     /// Return whether popup is open.
-    bool GetShowPopup() const;
+    bool GetShowPopup() const { return showPopup_; }
     /// Return accelerator key code, 0 if disabled.
-    int GetAcceleratorKey() const;
+    int GetAcceleratorKey() const { return acceleratorKey_; }
     /// Return accelerator qualifiers.
+    int GetAcceleratorQualifiers() const { return acceleratorQualifiers_; }
     int GetAcceleratorQualifiers() const;
 };
+
+Menu* NewMenu @ Menu();

+ 7 - 5
Extras/LuaScript/Pkgs/UI/ScrollBar.pkg

@@ -28,15 +28,17 @@ public:
     /// Return slider current value.
     float GetValue() const;
     /// Return button scroll step.
-    float GetScrollStep() const;
+    float GetScrollStep() const { return scrollStep_; }
     /// Return button step factor.
-    float GetStepFactor() const;
+    float GetStepFactor() const { return stepFactor_; }
     /// Return scroll step multiplied by factor.
     float GetEffectiveScrollStep() const;
     /// Return back button element.
-    Button* GetBackButton() const;
+    Button* GetBackButton() const { return backButton_; }
     /// Return forward button element.
-    Button* GetForwardButton() const;
+    Button* GetForwardButton() const { return forwardButton_; }
     /// Return slider element.
-    Slider* GetSlider() const;
+    Slider* GetSlider() const { return slider_; }
 };
+
+ScrollBar* NewScrollBar @ ScrollBar();

+ 10 - 8
Extras/LuaScript/Pkgs/UI/ScrollView.pkg

@@ -20,22 +20,24 @@ public:
     void SetPageStep(float step);
 
     /// Return view offset from the top-left corner.
-    const IntVector2& GetViewPosition() const;
+    const IntVector2& GetViewPosition() const { return viewPosition_; }
     /// Return content element.
-    UIElement* GetContentElement() const;
+    UIElement* GetContentElement() const { return contentElement_; }
     /// Return horizontal scroll bar.
-    ScrollBar* GetHorizontalScrollBar() const;
+    ScrollBar* GetHorizontalScrollBar() const { return horizontalScrollBar_; }
     /// Return vertical scroll bar.
-    ScrollBar* GetVerticalScrollBar() const;
+    ScrollBar* GetVerticalScrollBar() const { return verticalScrollBar_; }
     /// Return scroll panel.
-    BorderImage* GetScrollPanel() const;
+    BorderImage* GetScrollPanel() const { return scrollPanel_; }
     /// Return whether scrollbars are automatically shown/hidden.
-    bool GetScrollBarsAutoVisible() const;
+    bool GetScrollBarsAutoVisible() const { return scrollBarsAutoVisible_; }
     /// Return arrow key scroll step.
     float GetScrollStep() const;
     /// Return arrow key page step.
-    float GetPageStep() const;
+    float GetPageStep() const { return pageStep_; }
 
     /// Set view position attribute.
     void SetViewPositionAttr(const IntVector2& value);
-};
+};
+
+ScrollView* NewScrollView @ ScrollView();

+ 8 - 6
Extras/LuaScript/Pkgs/UI/Slider.pkg

@@ -16,13 +16,15 @@ public:
     void SetRepeatRate(float rate);
 
     /// Return orientation type.
-    Orientation GetOrientation() const;
+    Orientation GetOrientation() const { return orientation_; }
     /// Return slider range.
-    float GetRange() const;
+    float GetRange() const { return range_; }
     /// Return slider current value.
-    float GetValue() const;
+    float GetValue() const { return value_; }
     /// Return knob element.
-    BorderImage* GetKnob() const;
+    BorderImage* GetKnob() const { return knob_; }
     /// Return paging minimum repeat rate (number of events per second).
-    float GetRepeatRate() const;
-};
+    float GetRepeatRate() const { return repeatRate_; }
+};
+
+Slider* NewSlider @ Slider();

+ 7 - 8
Extras/LuaScript/Pkgs/UI/Sprite.pkg

@@ -32,19 +32,19 @@ public:
     void SetBlendMode(BlendMode mode);
     
     /// Return floating point position.
-    const Vector2& GetPosition() const;
+    const Vector2& GetPosition() const { return floatPosition_; }
     /// Return hotspot.
-    const IntVector2& GetHotSpot() const;
+    const IntVector2& GetHotSpot() const { return hotSpot_; }
     /// Return scale.
-    const Vector2& GetScale() const;
+    const Vector2& GetScale() const { return scale_; }
     /// Return rotation angle.
-    float GetRotation() const;
+    float GetRotation() const { return rotation_; }
     /// Return texture.
-    Texture* GetTexture() const;
+    Texture* GetTexture() const { return texture_; }
     /// Return image rectangle.
-    const IntRect& GetImageRect() const;
+    const IntRect& GetImageRect() const { return imageRect_; }
     /// Return blend mode.
-    BlendMode GetBlendMode() const;
+    BlendMode GetBlendMode() const { return blendMode_; }
     
     /// Set texture attribute.
     void SetTextureAttr(ResourceRef value);
@@ -55,4 +55,3 @@ public:
 };
 
 Sprite* NewSprite @ Sprite();
-

+ 15 - 13
Extras/LuaScript/Pkgs/UI/Text.pkg

@@ -26,27 +26,29 @@ public:
     void SetHoverColor(const Color& color);
     
     /// Return font.
-    Font* GetFont() const;
+    Font* GetFont() const { return font_; }
     /// Return font size.
-    int GetFontSize() const;
+    int GetFontSize() const { return fontSize_; }
     /// Return text.
-    const String& GetText() const;
+    const String& GetText() const { return text_; }
     /// Return row alignment.
-    HorizontalAlignment GetTextAlignment() const;
+    HorizontalAlignment GetTextAlignment() const { return textAlignment_; }
     /// Return row spacing.
-    float GetRowSpacing() const;
+    float GetRowSpacing() const { return rowSpacing_; }
     /// Return wordwrap mode.
-    bool GetWordwrap() const;
+    bool GetWordwrap() const { return wordWrap_; }
     /// Return selection start.
-    unsigned GetSelectionStart() const;
+    unsigned GetSelectionStart() const { return selectionStart_; }
     /// Return selection length.
-    unsigned GetSelectionLength() const;
+    unsigned GetSelectionLength() const { return selectionLength_; }
     /// Return selection background color.
-    const Color& GetSelectionColor() const;
+    const Color& GetSelectionColor() const { return selectionColor_; }
     /// Return hover background color.
-    const Color& GetHoverColor() const;
+    const Color& GetHoverColor() const { return hoverColor_; }
     /// Return row height.
-    int GetRowHeight() const;
+    int GetRowHeight() const { return rowHeight_; }
     /// Return number of rows.
-    unsigned GetNumRows() const;
-};
+    unsigned GetNumRows() const { return rowWidths_.Size(); }
+};
+
+Text* NewText @ Text();

+ 4 - 4
Extras/LuaScript/Pkgs/UI/Text3D.pkg

@@ -59,12 +59,12 @@ public:
     int GetRowHeight() const;
     /// Return number of rows.
     unsigned GetNumRows() const;
-    /// Return width of each row.
-    const PODVector<int>& GetRowWidths() const;
     /// Return corner color.
     const Color& GetColor(Corner corner) const;
     /// Return opacity.
     float GetOpacity() const;
     /// Return whether faces camera automatically.
-    bool GetFaceCamera() const;
-};
+    bool GetFaceCamera() const { return faceCamera_; }
+};
+
+Text3D* NewText3D @ Text3D();

+ 6 - 6
Extras/LuaScript/Pkgs/UI/UI.pkg

@@ -32,25 +32,25 @@ public:
     void SetNonFocusedMouseWheel(bool nonFocusedMouseWheel);
 
     /// Return root UI element.
-    UIElement* GetRoot() const;
+    UIElement* GetRoot() const { return rootElement_; }
     /// Return root modal element.
-    UIElement* GetRootModalElement() const;
+    UIElement* GetRootModalElement() const { return rootModalElement_; }
     /// Return cursor.
-    Cursor* GetCursor() const;
+    Cursor* GetCursor() const { return cursor_; }
     /// Return UI element at screen coordinates.
     UIElement* GetElementAt(const IntVector2& position, bool enabledOnly = true);
     /// Return UI element at screen coordinates.
     UIElement* GetElementAt(int x, int y, bool enabledOnly = true);
     /// Return focused element.
-    UIElement* GetFocusElement() const;
+    UIElement* GetFocusElement() const { return focusElement_; }
     /// Return topmost enabled root-level non-modal element.
     UIElement* GetFrontElement() const;
     /// Return cursor position.
     IntVector2 GetCursorPosition() const;
     /// Return clipboard text.
-    const String& GetClipBoardText() const;
+    const String& GetClipBoardText() const { return clipBoard_; }
     /// Return mouse wheel handling flag.
-    bool IsNonFocusedMouseWheel() const;
+    bool IsNonFocusedMouseWheel() const { return nonFocusedMouseWheel_; }
     /// Return true when UI has modal element(s).
     bool HasModalElement() const;
 };

+ 48 - 49
Extras/LuaScript/Pkgs/UI/UIElement.pkg

@@ -211,87 +211,87 @@ public:
     void SetElementEventSender(bool flag);
 	
     /// Return name.
-    const String& GetName() const;
+    const String& GetName() const { return name_; }
     /// Return position.
-    const IntVector2& GetPosition() const;
+    const IntVector2& GetPosition() const { return position_; }
     /// Return size.
-    const IntVector2& GetSize() const;
+    const IntVector2& GetSize() const { return size_; }
     /// Return width.
-    int GetWidth() const;
+    int GetWidth() const { return size_.x_; }
     /// Return height.
-    int GetHeight() const;
+    int GetHeight() const { return size_.y_; }
     /// Return minimum size.
-    const IntVector2& GetMinSize() const;
+    const IntVector2& GetMinSize() const { return minSize_; }
     /// Return minimum width.
-    int GetMinWidth() const;
+    int GetMinWidth() const { return minSize_.x_; }
     /// Return minimum height.
-    int GetMinHeight() const;
+    int GetMinHeight() const { return minSize_.y_; }
     /// Return maximum size.
-    const IntVector2& GetMaxSize() const;
+    const IntVector2& GetMaxSize() const { return maxSize_; }
     /// Return minimum width.
-    int GetMaxWidth() const;
+    int GetMaxWidth() const { return maxSize_.x_; }
     /// Return minimum height.
-    int GetMaxHeight() const;
+    int GetMaxHeight() const { return maxSize_.y_; }
     /// Return true if size is fixed.
-    bool IsFixedSize() const;
+    bool IsFixedSize() const { return minSize_ == maxSize_; }
     /// Return true if width is fixed.
-    bool IsFixedWidth() const;
+    bool IsFixedWidth() const { return minSize_.x_ == maxSize_.x_; }
     /// Return true if height is fixed.
-    bool IsFixedHeight() const;
+    bool IsFixedHeight() const { return minSize_.y_ == maxSize_.y_; }
     /// Return child element offset.
-    const IntVector2& GetChildOffset() const;
+    const IntVector2& GetChildOffset() const { return childOffset_; }
     /// Return horizontal alignment.
-    HorizontalAlignment GetHorizontalAlignment() const;
+    HorizontalAlignment GetHorizontalAlignment() const { return horizontalAlignment_; }
     /// Return vertical alignment.
-    VerticalAlignment GetVerticalAlignment() const;
+    VerticalAlignment GetVerticalAlignment() const { return verticalAlignment_; }
     /// Return child element clipping border.
-    const IntRect& GetClipBorder() const;
+    const IntRect& GetClipBorder() const { return clipBorder_; }
     /// Return corner color.
-    const Color& GetColor(Corner corner) const;
+    const Color& GetColor(Corner corner) const { return color_[corner]; }
     /// Return priority.
-    int GetPriority() const;
+    int GetPriority() const { return priority_; }
     /// Return opacity.
-    float GetOpacity() const;
+    float GetOpacity() const { return opacity_; }
     /// Return derived opacity (affected by parent elements.) If UseDerivedOpacity is false, returns same as element's own opacity.
     float GetDerivedOpacity() const;
     /// Return whether should be brought to front when focused.
-    bool GetBringToFront() const;
+    bool GetBringToFront() const { return bringToFront_; }
     /// Return whether should be put to background when another element is focused.
-    bool GetBringToBack() const;
+    bool GetBringToBack() const { return bringToBack_; }
     /// Return whether should clip child elements.
-    bool GetClipChildren() const;
+    bool GetClipChildren() const { return clipChildren_; }
     /// Return whether should sort child elements according to priority.
-    bool GetSortChildren() const;
+    bool GetSortChildren() const { return sortChildren_; }
     /// Return whether parent elements' opacity affects opacity.
-    bool GetUseDerivedOpacity() const;
+    bool GetUseDerivedOpacity() const { return useDerivedOpacity_; }
     /// Return whether has focus.
     bool HasFocus() const;
     /// Return whether reacts to input.
-    bool IsEnabled() const;
+    bool IsEnabled() const { return enabled_; }
     /// Return whether is selected. Actual meaning is element dependent.
-    bool IsSelected() const;
+    bool IsSelected() const { return selected_; }
     /// Return whether is visible.
-    bool IsVisible() const;
+    bool IsVisible() const { return visible_; }
     /// Return whether the cursor is hovering on this element.
-    bool IsHovering() const;
+    bool IsHovering() const { return hovering_; }
     /// Return whether is internally created.
-    bool IsInternal() const;
+    bool IsInternal() const { return internal_; }
     /// Return whether has different color in at least one corner.
-    bool HasColorGradient() const;
+    bool HasColorGradient() const { return colorGradient_; }
     /// Return focus mode.
-    FocusMode GetFocusMode() const;
+    FocusMode GetFocusMode() const { return focusMode_; }
     /// Return drag and drop flags.
-    unsigned GetDragDropMode() const;
+    unsigned GetDragDropMode() const { return dragDropMode_; }
     /// Return applied style name. Return an empty string when the applied style is an 'auto' style (i.e. style derived from instance's type).
     const String& GetAppliedStyle() const;
     /// Return default style.
     XMLFile* GetDefaultStyle(bool recursiveUp = true) const;
     /// Return layout mode.
-    LayoutMode GetLayoutMode() const;
+    LayoutMode GetLayoutMode() const { return layoutMode_; }
     /// Return layout spacing.
-    int GetLayoutSpacing() const;
+    int GetLayoutSpacing() const { return layoutSpacing_; }
     /// Return layout border.
-    const IntRect& GetLayoutBorder() const;
+    const IntRect& GetLayoutBorder() const { return layoutBorder_; }
     /// Return number of child elements.
     unsigned GetNumChildren(bool recursive = false) const;
     /// Return child element by index.
@@ -301,7 +301,7 @@ public:
     /// Return child element by variable. If only key is provided, return the first child having the matching variable key. If value is also provided then the actual variable value would also be checked against.
     UIElement* GetChild(const ShortStringHash& key, const Variant& value = Variant::EMPTY, bool recursive = false) const;
     /// Return parent element.
-    UIElement* GetParent() const;
+    UIElement* GetParent() const { return parent_; }
     /// Return root element.
     UIElement* GetRoot() const;
     /// Return derived color. Only valid when no gradient.
@@ -319,13 +319,13 @@ public:
     /// Sort child elements if sorting enabled and order dirty. Called by UI.
     void SortChildren();
     /// Return minimum layout element size in the layout direction. Only valid after layout has been calculated.
-    int GetLayoutMinSize() const;
+    int GetLayoutMinSize() const { return layoutMinSize_; }
     /// Return horizontal indentation.
-    int GetIndent() const;
+    int GetIndent() const { return indent_; }
     /// Return indent spacing (number of pixels per indentation level).
-    int GetIndentSpacing() const;
+    int GetIndentSpacing() const { return indentSpacing_; }
     /// Return indent width in pixels.
-    int GetIndentWidth() const;
+    int GetIndentWidth() const { return indent_ * indentSpacing_; }
 
     /// Set child offset.
     void SetChildOffset(const IntVector2& offset);
@@ -335,16 +335,15 @@ public:
     void SetTempVisible(bool enable);
     /// Adjust scissor for rendering.
     void AdjustScissor(IntRect& currentScissor);
-    /// Get UI rendering batches with a specified offset. Also recurses to child elements.
-    void GetBatchesWithOffset(IntVector2& offset, PODVector<UIBatch>& batches, PODVector<float>& vertexData, IntRect
-        currentScissor);
     /// Get color attribute. Uses just the top-left color.
-    const Color& GetColorAttr() const;
+    const Color& GetColorAttr() const { return color_[0]; }
     /// Get traversal mode.
-    TraversalMode GetTraversalMode() const;
+    TraversalMode GetTraversalMode() const { return traversalMode_; }
     /// Get element event sender flag.
-    bool IsElementEventSender() const;
+    bool IsElementEventSender() const { return elementEventSender_; }
     /// Get element event sender.
     UIElement* GetElementEventSender() const;
-
 };
+
+UIElement* NewUIElement @ UIElement();
+

+ 9 - 7
Extras/LuaScript/Pkgs/UI/Window.pkg

@@ -35,17 +35,19 @@ public:
     void SetModalFrameSize(const IntVector2& size);
 
     /// Return whether is movable.
-    bool IsMovable() const;
+    bool IsMovable() const { return movable_; }
     /// Return whether is resizable.
-    bool IsResizable() const;
+    bool IsResizable() const { return resizable_; }
     /// Return resize area width at edges.
-    const IntRect& GetResizeBorder() const;
+    const IntRect& GetResizeBorder() const { return resizeBorder_; }
     /// Return modal flag.
-    bool IsModal() const;
+    bool IsModal() const { return modal_; }
     /// Get modal shade color.
-    const Color& GetModalShadeColor() const;
+    const Color& GetModalShadeColor() const { return modalShadeColor_; }
     /// Get modal frame color.
-    const Color& GetModalFrameColor() const;
+    const Color& GetModalFrameColor() const { return modalFrameColor_; }
     /// Get modal frame size.
-    const IntVector2& GetModalFrameSize() const;
+    const IntVector2& GetModalFrameSize() const { return modalFrameSize_; }
 };
+
+Window* NewWindow @ Window();

+ 13 - 14
Extras/LuaScript/ResourceLuaAPI.cpp

@@ -1,6 +1,6 @@
 /*
 ** Lua binding: Resource
-** Generated automatically by tolua++-1.0.92 on 06/30/13 11:31:51.
+** Generated automatically by tolua++-1.0.92 on 07/02/13 20:27:50.
 */
 
 //
@@ -506,34 +506,33 @@ static int tolua_Resource_Image_GetCompressedFormat00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
-/* method: SetName of class  Resource */
-#ifndef TOLUA_DISABLE_tolua_Resource_Resource_SetName00
-static int tolua_Resource_Resource_SetName00(lua_State* tolua_S)
+/* method: GetNumCompressedLevels of class  Image */
+#ifndef TOLUA_DISABLE_tolua_Resource_Image_GetNumCompressedLevels00
+static int tolua_Resource_Image_GetNumCompressedLevels00(lua_State* tolua_S)
 {
 #ifndef TOLUA_RELEASE
  tolua_Error tolua_err;
  if (
-     !tolua_isusertype(tolua_S,1,"Resource",0,&tolua_err) ||
-     (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const String",0,&tolua_err)) ||
-     !tolua_isnoobj(tolua_S,3,&tolua_err)
+     !tolua_isusertype(tolua_S,1,"const Image",0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,2,&tolua_err)
  )
   goto tolua_lerror;
  else
 #endif
  {
-  Resource* self = (Resource*)  tolua_tousertype(tolua_S,1,0);
-  const String* name = ((const String*)  tolua_tousertype(tolua_S,2,0));
+  const Image* self = (const Image*)  tolua_tousertype(tolua_S,1,0);
 #ifndef TOLUA_RELEASE
-  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetName'", NULL);
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetNumCompressedLevels'", NULL);
 #endif
   {
-   self->SetName(*name);
+   unsigned tolua_ret = (unsigned)  self->GetNumCompressedLevels();
+   tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
   }
  }
- return 0;
+ return 1;
 #ifndef TOLUA_RELEASE
  tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'SetName'.",&tolua_err);
+ tolua_error(tolua_S,"#ferror in function 'GetNumCompressedLevels'.",&tolua_err);
  return 0;
 #endif
 }
@@ -2732,10 +2731,10 @@ TOLUA_API int tolua_Resource_open (lua_State* tolua_S)
    tolua_function(tolua_S,"GetComponents",tolua_Resource_Image_GetComponents00);
    tolua_function(tolua_S,"IsCompressed",tolua_Resource_Image_IsCompressed00);
    tolua_function(tolua_S,"GetCompressedFormat",tolua_Resource_Image_GetCompressedFormat00);
+   tolua_function(tolua_S,"GetNumCompressedLevels",tolua_Resource_Image_GetNumCompressedLevels00);
   tolua_endmodule(tolua_S);
   tolua_cclass(tolua_S,"Resource","Resource","",NULL);
   tolua_beginmodule(tolua_S,"Resource");
-   tolua_function(tolua_S,"SetName",tolua_Resource_Resource_SetName00);
    tolua_function(tolua_S,"GetName",tolua_Resource_Resource_GetName00);
    tolua_function(tolua_S,"GetNameHash",tolua_Resource_Resource_GetNameHash00);
    tolua_function(tolua_S,"GetMemoryUse",tolua_Resource_Resource_GetMemoryUse00);

+ 71 - 3
Extras/LuaScript/SceneLuaAPI.cpp

@@ -1,6 +1,6 @@
 /*
 ** Lua binding: Scene
-** Generated automatically by tolua++-1.0.92 on 06/30/13 11:31:52.
+** Generated automatically by tolua++-1.0.92 on 07/02/13 20:27:50.
 */
 
 //
@@ -86,7 +86,7 @@ static void tolua_reg_types (lua_State* tolua_S)
  tolua_usertype(tolua_S,"Connection");
  tolua_usertype(tolua_S,"Quaternion");
  tolua_usertype(tolua_S,"Scene");
- tolua_usertype(tolua_S,"ShortStringHash");
+ tolua_usertype(tolua_S,"Vector3");
  tolua_usertype(tolua_S,"StringHash");
  tolua_usertype(tolua_S,"Component");
  tolua_usertype(tolua_S,"Vector4");
@@ -95,7 +95,7 @@ static void tolua_reg_types (lua_State* tolua_S)
  tolua_usertype(tolua_S,"String");
  tolua_usertype(tolua_S,"File");
  tolua_usertype(tolua_S,"Node");
- tolua_usertype(tolua_S,"Vector3");
+ tolua_usertype(tolua_S,"ShortStringHash");
 }
 
 /* method: SetEnabled of class  Component */
@@ -290,6 +290,72 @@ static int tolua_Scene_Component_IsEnabled00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* method: IsEnabledEffective of class  Component */
+#ifndef TOLUA_DISABLE_tolua_Scene_Component_IsEnabledEffective00
+static int tolua_Scene_Component_IsEnabledEffective00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertype(tolua_S,1,"const Component",0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,2,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  const Component* self = (const Component*)  tolua_tousertype(tolua_S,1,0);
+#ifndef TOLUA_RELEASE
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'IsEnabledEffective'", NULL);
+#endif
+  {
+   bool tolua_ret = (bool)  self->IsEnabledEffective();
+   tolua_pushboolean(tolua_S,(bool)tolua_ret);
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'IsEnabledEffective'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
+/* method: GetComponent of class  Component */
+#ifndef TOLUA_DISABLE_tolua_Scene_Component_GetComponent00
+static int tolua_Scene_Component_GetComponent00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertype(tolua_S,1,"const Component",0,&tolua_err) ||
+     (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"ShortStringHash",0,&tolua_err)) ||
+     !tolua_isnoobj(tolua_S,3,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  const Component* self = (const Component*)  tolua_tousertype(tolua_S,1,0);
+  ShortStringHash type = *((ShortStringHash*)  tolua_tousertype(tolua_S,2,0));
+#ifndef TOLUA_RELEASE
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetComponent'", NULL);
+#endif
+  {
+   Component* tolua_ret = (Component*)  self->GetComponent(type);
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"Component");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'GetComponent'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: SetName of class  Node */
 #ifndef TOLUA_DISABLE_tolua_Scene_Node_SetName00
 static int tolua_Scene_Node_SetName00(lua_State* tolua_S)
@@ -4288,6 +4354,8 @@ TOLUA_API int tolua_Scene_open (lua_State* tolua_S)
    tolua_function(tolua_S,"GetNode",tolua_Scene_Component_GetNode00);
    tolua_function(tolua_S,"GetScene",tolua_Scene_Component_GetScene00);
    tolua_function(tolua_S,"IsEnabled",tolua_Scene_Component_IsEnabled00);
+   tolua_function(tolua_S,"IsEnabledEffective",tolua_Scene_Component_IsEnabledEffective00);
+   tolua_function(tolua_S,"GetComponent",tolua_Scene_Component_GetComponent00);
   tolua_endmodule(tolua_S);
   tolua_constant(tolua_S,"REPLICATED",REPLICATED);
   tolua_constant(tolua_S,"LOCAL",LOCAL);

+ 480 - 80
Extras/LuaScript/UILuaAPI.cpp

@@ -1,6 +1,6 @@
 /*
 ** Lua binding: UI
-** Generated automatically by tolua++-1.0.92 on 06/30/13 11:31:52.
+** Generated automatically by tolua++-1.0.92 on 07/02/13 20:27:51.
 */
 
 //
@@ -99,24 +99,21 @@ static void tolua_reg_types (lua_State* tolua_S)
  tolua_usertype(tolua_S,"IntVector2");
  tolua_usertype(tolua_S,"String");
  tolua_usertype(tolua_S,"Resource");
- tolua_usertype(tolua_S,"PODVector<float>");
  tolua_usertype(tolua_S,"Color");
  tolua_usertype(tolua_S,"Window");
  tolua_usertype(tolua_S,"Cursor");
- tolua_usertype(tolua_S,"PODVector<UIBatch>");
- tolua_usertype(tolua_S,"Variant");
  tolua_usertype(tolua_S,"Image");
  tolua_usertype(tolua_S,"Drawable");
- tolua_usertype(tolua_S,"ShortStringHash");
+ tolua_usertype(tolua_S,"Variant");
  tolua_usertype(tolua_S,"Button");
  tolua_usertype(tolua_S,"Material");
- tolua_usertype(tolua_S,"XMLElement");
+ tolua_usertype(tolua_S,"ShortStringHash");
  tolua_usertype(tolua_S,"ScrollView");
+ tolua_usertype(tolua_S,"XMLElement");
  tolua_usertype(tolua_S,"Slider");
  tolua_usertype(tolua_S,"UIElement");
  tolua_usertype(tolua_S,"Serializer");
  tolua_usertype(tolua_S,"UI");
- tolua_usertype(tolua_S,"PODVector<int>");
  tolua_usertype(tolua_S,"Text");
  tolua_usertype(tolua_S,"XMLFile");
  tolua_usertype(tolua_S,"Text3D");
@@ -581,6 +578,33 @@ static int tolua_UI_BorderImage_IsTiled00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* function: NewBorderImage */
+#ifndef TOLUA_DISABLE_tolua_UI_BorderImage00
+static int tolua_UI_BorderImage00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isnoobj(tolua_S,1,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  {
+   BorderImage* tolua_ret = (BorderImage*)  NewBorderImage();
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"BorderImage");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'BorderImage'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: SetPressedOffset of class  Button */
 #ifndef TOLUA_DISABLE_tolua_UI_Button_SetPressedOffset00
 static int tolua_UI_Button_SetPressedOffset00(lua_State* tolua_S)
@@ -936,6 +960,33 @@ static int tolua_UI_Button_GetRepeatRate00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* function: NewButton */
+#ifndef TOLUA_DISABLE_tolua_UI_Button00
+static int tolua_UI_Button00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isnoobj(tolua_S,1,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  {
+   Button* tolua_ret = (Button*)  NewButton();
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"Button");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'Button'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: SetChecked of class  CheckBox */
 #ifndef TOLUA_DISABLE_tolua_UI_CheckBox_SetChecked00
 static int tolua_UI_CheckBox_SetChecked00(lua_State* tolua_S)
@@ -1096,6 +1147,33 @@ static int tolua_UI_CheckBox_GetCheckedOffset00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* function: NewCheckBox */
+#ifndef TOLUA_DISABLE_tolua_UI_CheckBox00
+static int tolua_UI_CheckBox00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isnoobj(tolua_S,1,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  {
+   CheckBox* tolua_ret = (CheckBox*)  NewCheckBox();
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"CheckBox");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'CheckBox'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: DefineShape of class  Cursor */
 #ifndef TOLUA_DISABLE_tolua_UI_Cursor_DefineShape00
 static int tolua_UI_Cursor_DefineShape00(lua_State* tolua_S)
@@ -1746,6 +1824,33 @@ static int tolua_UI_DropDownList_GetResizePopup00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* function: NewDropDownList */
+#ifndef TOLUA_DISABLE_tolua_UI_DropDownList00
+static int tolua_UI_DropDownList00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isnoobj(tolua_S,1,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  {
+   DropDownList* tolua_ret = (DropDownList*)  NewDropDownList();
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"DropDownList");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'DropDownList'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* get function: name_ of class  FileSelectorEntry */
 #ifndef TOLUA_DISABLE_tolua_get_FileSelectorEntry_name_
 static int tolua_get_FileSelectorEntry_name_(lua_State* tolua_S)
@@ -2584,6 +2689,60 @@ static int tolua_UI_FileSelector_GetDirectoryMode00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* function: NewFileSelector */
+#ifndef TOLUA_DISABLE_tolua_UI_FileSelector00
+static int tolua_UI_FileSelector00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isnoobj(tolua_S,1,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  {
+   FileSelector* tolua_ret = (FileSelector*)  NewFileSelector();
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"FileSelector");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'FileSelector'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
+/* function: NewFont */
+#ifndef TOLUA_DISABLE_tolua_UI_Font00
+static int tolua_UI_Font00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isnoobj(tolua_S,1,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  {
+   Font* tolua_ret = (Font*)  NewFont();
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"Font");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'Font'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: SetText of class  LineEdit */
 #ifndef TOLUA_DISABLE_tolua_UI_LineEdit_SetText00
 static int tolua_UI_LineEdit_SetText00(lua_State* tolua_S)
@@ -3233,6 +3392,33 @@ static int tolua_UI_LineEdit_GetDoubleClickInterval00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* function: NewLineEdit */
+#ifndef TOLUA_DISABLE_tolua_UI_LineEdit00
+static int tolua_UI_LineEdit00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isnoobj(tolua_S,1,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  {
+   LineEdit* tolua_ret = (LineEdit*)  NewLineEdit();
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"LineEdit");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'LineEdit'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: AddItem of class  ListView */
 #ifndef TOLUA_DISABLE_tolua_UI_ListView_AddItem00
 static int tolua_UI_ListView_AddItem00(lua_State* tolua_S)
@@ -4289,6 +4475,33 @@ static int tolua_UI_ListView_GetDoubleClickInterval00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* function: NewListView */
+#ifndef TOLUA_DISABLE_tolua_UI_ListView00
+static int tolua_UI_ListView00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isnoobj(tolua_S,1,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  {
+   ListView* tolua_ret = (ListView*)  NewListView();
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"ListView");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'ListView'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: SetPopup of class  Menu */
 #ifndef TOLUA_DISABLE_tolua_UI_Menu_SetPopup00
 static int tolua_UI_Menu_SetPopup00(lua_State* tolua_S)
@@ -4613,6 +4826,60 @@ static int tolua_UI_Menu_GetAcceleratorQualifiers00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* method: GetAcceleratorQualifiers of class  Menu */
+#ifndef TOLUA_DISABLE_tolua_UI_Menu_GetAcceleratorQualifiers01
+static int tolua_UI_Menu_GetAcceleratorQualifiers01(lua_State* tolua_S)
+{
+ tolua_Error tolua_err;
+ if (
+     !tolua_isusertype(tolua_S,1,"const Menu",0,&tolua_err) ||
+     !tolua_isnoobj(tolua_S,2,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+ {
+  const Menu* self = (const Menu*)  tolua_tousertype(tolua_S,1,0);
+#ifndef TOLUA_RELEASE
+  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetAcceleratorQualifiers'", NULL);
+#endif
+  {
+   int tolua_ret = (int)  self->GetAcceleratorQualifiers();
+   tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
+  }
+ }
+ return 1;
+tolua_lerror:
+ return tolua_UI_Menu_GetAcceleratorQualifiers00(tolua_S);
+}
+#endif //#ifndef TOLUA_DISABLE
+
+/* function: NewMenu */
+#ifndef TOLUA_DISABLE_tolua_UI_Menu00
+static int tolua_UI_Menu00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isnoobj(tolua_S,1,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  {
+   Menu* tolua_ret = (Menu*)  NewMenu();
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"Menu");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'Menu'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: SetOrientation of class  ScrollBar */
 #ifndef TOLUA_DISABLE_tolua_UI_ScrollBar_SetOrientation00
 static int tolua_UI_ScrollBar_SetOrientation00(lua_State* tolua_S)
@@ -5161,6 +5428,33 @@ static int tolua_UI_ScrollBar_GetSlider00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* function: NewScrollBar */
+#ifndef TOLUA_DISABLE_tolua_UI_ScrollBar00
+static int tolua_UI_ScrollBar00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isnoobj(tolua_S,1,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  {
+   ScrollBar* tolua_ret = (ScrollBar*)  NewScrollBar();
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"ScrollBar");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'ScrollBar'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: SetContentElement of class  ScrollView */
 #ifndef TOLUA_DISABLE_tolua_UI_ScrollView_SetContentElement00
 static int tolua_UI_ScrollView_SetContentElement00(lua_State* tolua_S)
@@ -5680,6 +5974,33 @@ static int tolua_UI_ScrollView_SetViewPositionAttr00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* function: NewScrollView */
+#ifndef TOLUA_DISABLE_tolua_UI_ScrollView00
+static int tolua_UI_ScrollView00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isnoobj(tolua_S,1,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  {
+   ScrollView* tolua_ret = (ScrollView*)  NewScrollView();
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"ScrollView");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'ScrollView'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: SetOrientation of class  Slider */
 #ifndef TOLUA_DISABLE_tolua_UI_Slider_SetOrientation00
 static int tolua_UI_Slider_SetOrientation00(lua_State* tolua_S)
@@ -6005,6 +6326,33 @@ static int tolua_UI_Slider_GetRepeatRate00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* function: NewSlider */
+#ifndef TOLUA_DISABLE_tolua_UI_Slider00
+static int tolua_UI_Slider00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isnoobj(tolua_S,1,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  {
+   Slider* tolua_ret = (Slider*)  NewSlider();
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"Slider");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'Slider'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: SetPosition of class  Sprite */
 #ifndef TOLUA_DISABLE_tolua_UI_Sprite_SetPosition00
 static int tolua_UI_Sprite_SetPosition00(lua_State* tolua_S)
@@ -7458,6 +7806,33 @@ static int tolua_UI_Text_GetNumRows00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* function: NewText */
+#ifndef TOLUA_DISABLE_tolua_UI_Text00
+static int tolua_UI_Text00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isnoobj(tolua_S,1,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  {
+   Text* tolua_ret = (Text*)  NewText();
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"Text");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'Text'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: SetFont of class  Text3D */
 #ifndef TOLUA_DISABLE_tolua_UI_Text3D_SetFont00
 static int tolua_UI_Text3D_SetFont00(lua_State* tolua_S)
@@ -8337,38 +8712,6 @@ static int tolua_UI_Text3D_GetNumRows00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
-/* method: GetRowWidths of class  Text3D */
-#ifndef TOLUA_DISABLE_tolua_UI_Text3D_GetRowWidths00
-static int tolua_UI_Text3D_GetRowWidths00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
-     !tolua_isusertype(tolua_S,1,"const Text3D",0,&tolua_err) ||
-     !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
-  goto tolua_lerror;
- else
-#endif
- {
-  const Text3D* self = (const Text3D*)  tolua_tousertype(tolua_S,1,0);
-#ifndef TOLUA_RELEASE
-  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetRowWidths'", NULL);
-#endif
-  {
-   const PODVector<int>& tolua_ret = (const PODVector<int>&)  self->GetRowWidths();
-    tolua_pushusertype(tolua_S,(void*)&tolua_ret,"const PODVector<int>");
-  }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'GetRowWidths'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
 /* method: GetColor of class  Text3D */
 #ifndef TOLUA_DISABLE_tolua_UI_Text3D_GetColor00
 static int tolua_UI_Text3D_GetColor00(lua_State* tolua_S)
@@ -8467,6 +8810,33 @@ static int tolua_UI_Text3D_GetFaceCamera00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* function: NewText3D */
+#ifndef TOLUA_DISABLE_tolua_UI_Text3D00
+static int tolua_UI_Text3D00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isnoobj(tolua_S,1,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  {
+   Text3D* tolua_ret = (Text3D*)  NewText3D();
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"Text3D");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'Text3D'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: SetCursor of class  UI */
 #ifndef TOLUA_DISABLE_tolua_UI_UI_SetCursor00
 static int tolua_UI_UI_SetCursor00(lua_State* tolua_S)
@@ -13520,45 +13890,6 @@ static int tolua_UI_UIElement_AdjustScissor00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
-/* method: GetBatchesWithOffset of class  UIElement */
-#ifndef TOLUA_DISABLE_tolua_UI_UIElement_GetBatchesWithOffset00
-static int tolua_UI_UIElement_GetBatchesWithOffset00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
-     !tolua_isusertype(tolua_S,1,"UIElement",0,&tolua_err) ||
-     (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"IntVector2",0,&tolua_err)) ||
-     (tolua_isvaluenil(tolua_S,3,&tolua_err) || !tolua_isusertype(tolua_S,3,"PODVector<UIBatch>",0,&tolua_err)) ||
-     (tolua_isvaluenil(tolua_S,4,&tolua_err) || !tolua_isusertype(tolua_S,4,"PODVector<float>",0,&tolua_err)) ||
-     (tolua_isvaluenil(tolua_S,5,&tolua_err) || !tolua_isusertype(tolua_S,5,"IntRect",0,&tolua_err)) ||
-     !tolua_isnoobj(tolua_S,6,&tolua_err)
- )
-  goto tolua_lerror;
- else
-#endif
- {
-  UIElement* self = (UIElement*)  tolua_tousertype(tolua_S,1,0);
-  IntVector2* offset = ((IntVector2*)  tolua_tousertype(tolua_S,2,0));
-  PODVector<UIBatch>* batches = ((PODVector<UIBatch>*)  tolua_tousertype(tolua_S,3,0));
-  PODVector<float>* vertexData = ((PODVector<float>*)  tolua_tousertype(tolua_S,4,0));
-  IntRect currentScissor = *((IntRect*)  tolua_tousertype(tolua_S,5,0));
-#ifndef TOLUA_RELEASE
-  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetBatchesWithOffset'", NULL);
-#endif
-  {
-   self->GetBatchesWithOffset(*offset,*batches,*vertexData,currentScissor);
-  }
- }
- return 0;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'GetBatchesWithOffset'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
 /* method: GetColorAttr of class  UIElement */
 #ifndef TOLUA_DISABLE_tolua_UI_UIElement_GetColorAttr00
 static int tolua_UI_UIElement_GetColorAttr00(lua_State* tolua_S)
@@ -13687,6 +14018,33 @@ static int tolua_UI_UIElement_GetElementEventSender00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* function: NewUIElement */
+#ifndef TOLUA_DISABLE_tolua_UI_UIElement00
+static int tolua_UI_UIElement00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isnoobj(tolua_S,1,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  {
+   UIElement* tolua_ret = (UIElement*)  NewUIElement();
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"UIElement");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'UIElement'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* method: SetMovable of class  Window */
 #ifndef TOLUA_DISABLE_tolua_UI_Window_SetMovable00
 static int tolua_UI_Window_SetMovable00(lua_State* tolua_S)
@@ -14142,6 +14500,33 @@ static int tolua_UI_Window_GetModalFrameSize00(lua_State* tolua_S)
 }
 #endif //#ifndef TOLUA_DISABLE
 
+/* function: NewWindow */
+#ifndef TOLUA_DISABLE_tolua_UI_Window00
+static int tolua_UI_Window00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+     !tolua_isnoobj(tolua_S,1,&tolua_err)
+ )
+  goto tolua_lerror;
+ else
+#endif
+ {
+  {
+   Window* tolua_ret = (Window*)  NewWindow();
+    tolua_pushusertype(tolua_S,(void*)tolua_ret,"Window");
+  }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'Window'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
 /* Open function */
 TOLUA_API int tolua_UI_open (lua_State* tolua_S)
 {
@@ -14166,6 +14551,7 @@ TOLUA_API int tolua_UI_open (lua_State* tolua_S)
    tolua_function(tolua_S,"GetBlendMode",tolua_UI_BorderImage_GetBlendMode00);
    tolua_function(tolua_S,"IsTiled",tolua_UI_BorderImage_IsTiled00);
   tolua_endmodule(tolua_S);
+  tolua_function(tolua_S,"BorderImage",tolua_UI_BorderImage00);
   tolua_cclass(tolua_S,"Button","Button","BorderImage",NULL);
   tolua_beginmodule(tolua_S,"Button");
    tolua_function(tolua_S,"SetPressedOffset",tolua_UI_Button_SetPressedOffset00);
@@ -14180,6 +14566,7 @@ TOLUA_API int tolua_UI_open (lua_State* tolua_S)
    tolua_function(tolua_S,"GetRepeatDelay",tolua_UI_Button_GetRepeatDelay00);
    tolua_function(tolua_S,"GetRepeatRate",tolua_UI_Button_GetRepeatRate00);
   tolua_endmodule(tolua_S);
+  tolua_function(tolua_S,"Button",tolua_UI_Button00);
   tolua_cclass(tolua_S,"CheckBox","CheckBox","BorderImage",NULL);
   tolua_beginmodule(tolua_S,"CheckBox");
    tolua_function(tolua_S,"SetChecked",tolua_UI_CheckBox_SetChecked00);
@@ -14188,6 +14575,7 @@ TOLUA_API int tolua_UI_open (lua_State* tolua_S)
    tolua_function(tolua_S,"IsChecked",tolua_UI_CheckBox_IsChecked00);
    tolua_function(tolua_S,"GetCheckedOffset",tolua_UI_CheckBox_GetCheckedOffset00);
   tolua_endmodule(tolua_S);
+  tolua_function(tolua_S,"CheckBox",tolua_UI_CheckBox00);
   tolua_constant(tolua_S,"CS_NORMAL",CS_NORMAL);
   tolua_constant(tolua_S,"CS_RESIZEVERTICAL",CS_RESIZEVERTICAL);
   tolua_constant(tolua_S,"CS_RESIZEDIAGONAL_TOPRIGHT",CS_RESIZEDIAGONAL_TOPRIGHT);
@@ -14223,6 +14611,7 @@ TOLUA_API int tolua_UI_open (lua_State* tolua_S)
    tolua_function(tolua_S,"GetPlaceholderText",tolua_UI_DropDownList_GetPlaceholderText00);
    tolua_function(tolua_S,"GetResizePopup",tolua_UI_DropDownList_GetResizePopup00);
   tolua_endmodule(tolua_S);
+  tolua_function(tolua_S,"DropDownList",tolua_UI_DropDownList00);
   tolua_cclass(tolua_S,"FileSelectorEntry","FileSelectorEntry","",NULL);
   tolua_beginmodule(tolua_S,"FileSelectorEntry");
    tolua_variable(tolua_S,"name_",tolua_get_FileSelectorEntry_name_,tolua_set_FileSelectorEntry_name_);
@@ -14255,9 +14644,11 @@ TOLUA_API int tolua_UI_open (lua_State* tolua_S)
    tolua_function(tolua_S,"GetFilterIndex",tolua_UI_FileSelector_GetFilterIndex00);
    tolua_function(tolua_S,"GetDirectoryMode",tolua_UI_FileSelector_GetDirectoryMode00);
   tolua_endmodule(tolua_S);
+  tolua_function(tolua_S,"FileSelector",tolua_UI_FileSelector00);
   tolua_cclass(tolua_S,"Font","Font","Resource",NULL);
   tolua_beginmodule(tolua_S,"Font");
   tolua_endmodule(tolua_S);
+  tolua_function(tolua_S,"Font",tolua_UI_Font00);
   tolua_cclass(tolua_S,"LineEdit","LineEdit","BorderImage",NULL);
   tolua_beginmodule(tolua_S,"LineEdit");
    tolua_function(tolua_S,"SetText",tolua_UI_LineEdit_SetText00);
@@ -14281,6 +14672,7 @@ TOLUA_API int tolua_UI_open (lua_State* tolua_S)
    tolua_function(tolua_S,"GetCursor",tolua_UI_LineEdit_GetCursor00);
    tolua_function(tolua_S,"GetDoubleClickInterval",tolua_UI_LineEdit_GetDoubleClickInterval00);
   tolua_endmodule(tolua_S);
+  tolua_function(tolua_S,"LineEdit",tolua_UI_LineEdit00);
   tolua_constant(tolua_S,"HM_NEVER",HM_NEVER);
   tolua_constant(tolua_S,"HM_FOCUS",HM_FOCUS);
   tolua_constant(tolua_S,"HM_ALWAYS",HM_ALWAYS);
@@ -14319,6 +14711,7 @@ TOLUA_API int tolua_UI_open (lua_State* tolua_S)
    tolua_function(tolua_S,"GetBaseIndent",tolua_UI_ListView_GetBaseIndent00);
    tolua_function(tolua_S,"GetDoubleClickInterval",tolua_UI_ListView_GetDoubleClickInterval00);
   tolua_endmodule(tolua_S);
+  tolua_function(tolua_S,"ListView",tolua_UI_ListView00);
   tolua_cclass(tolua_S,"Menu","Menu","Button",NULL);
   tolua_beginmodule(tolua_S,"Menu");
    tolua_function(tolua_S,"SetPopup",tolua_UI_Menu_SetPopup00);
@@ -14331,7 +14724,9 @@ TOLUA_API int tolua_UI_open (lua_State* tolua_S)
    tolua_function(tolua_S,"GetShowPopup",tolua_UI_Menu_GetShowPopup00);
    tolua_function(tolua_S,"GetAcceleratorKey",tolua_UI_Menu_GetAcceleratorKey00);
    tolua_function(tolua_S,"GetAcceleratorQualifiers",tolua_UI_Menu_GetAcceleratorQualifiers00);
+   tolua_function(tolua_S,"GetAcceleratorQualifiers",tolua_UI_Menu_GetAcceleratorQualifiers01);
   tolua_endmodule(tolua_S);
+  tolua_function(tolua_S,"Menu",tolua_UI_Menu00);
   tolua_cclass(tolua_S,"ScrollBar","ScrollBar","UIElement",NULL);
   tolua_beginmodule(tolua_S,"ScrollBar");
    tolua_function(tolua_S,"SetOrientation",tolua_UI_ScrollBar_SetOrientation00);
@@ -14352,6 +14747,7 @@ TOLUA_API int tolua_UI_open (lua_State* tolua_S)
    tolua_function(tolua_S,"GetForwardButton",tolua_UI_ScrollBar_GetForwardButton00);
    tolua_function(tolua_S,"GetSlider",tolua_UI_ScrollBar_GetSlider00);
   tolua_endmodule(tolua_S);
+  tolua_function(tolua_S,"ScrollBar",tolua_UI_ScrollBar00);
   tolua_cclass(tolua_S,"ScrollView","ScrollView","UIElement",NULL);
   tolua_beginmodule(tolua_S,"ScrollView");
    tolua_function(tolua_S,"SetContentElement",tolua_UI_ScrollView_SetContentElement00);
@@ -14371,6 +14767,7 @@ TOLUA_API int tolua_UI_open (lua_State* tolua_S)
    tolua_function(tolua_S,"GetPageStep",tolua_UI_ScrollView_GetPageStep00);
    tolua_function(tolua_S,"SetViewPositionAttr",tolua_UI_ScrollView_SetViewPositionAttr00);
   tolua_endmodule(tolua_S);
+  tolua_function(tolua_S,"ScrollView",tolua_UI_ScrollView00);
   tolua_cclass(tolua_S,"Slider","Slider","BorderImage",NULL);
   tolua_beginmodule(tolua_S,"Slider");
    tolua_function(tolua_S,"SetOrientation",tolua_UI_Slider_SetOrientation00);
@@ -14384,6 +14781,7 @@ TOLUA_API int tolua_UI_open (lua_State* tolua_S)
    tolua_function(tolua_S,"GetKnob",tolua_UI_Slider_GetKnob00);
    tolua_function(tolua_S,"GetRepeatRate",tolua_UI_Slider_GetRepeatRate00);
   tolua_endmodule(tolua_S);
+  tolua_function(tolua_S,"Slider",tolua_UI_Slider00);
   tolua_cclass(tolua_S,"Sprite","Sprite","UIElement",NULL);
   tolua_beginmodule(tolua_S,"Sprite");
    tolua_function(tolua_S,"SetPosition",tolua_UI_Sprite_SetPosition00);
@@ -14435,6 +14833,7 @@ TOLUA_API int tolua_UI_open (lua_State* tolua_S)
    tolua_function(tolua_S,"GetRowHeight",tolua_UI_Text_GetRowHeight00);
    tolua_function(tolua_S,"GetNumRows",tolua_UI_Text_GetNumRows00);
   tolua_endmodule(tolua_S);
+  tolua_function(tolua_S,"Text",tolua_UI_Text00);
   tolua_cclass(tolua_S,"Text3D","Text3D","Drawable",NULL);
   tolua_beginmodule(tolua_S,"Text3D");
    tolua_function(tolua_S,"SetFont",tolua_UI_Text3D_SetFont00);
@@ -14464,11 +14863,11 @@ TOLUA_API int tolua_UI_open (lua_State* tolua_S)
    tolua_function(tolua_S,"GetWidth",tolua_UI_Text3D_GetWidth00);
    tolua_function(tolua_S,"GetRowHeight",tolua_UI_Text3D_GetRowHeight00);
    tolua_function(tolua_S,"GetNumRows",tolua_UI_Text3D_GetNumRows00);
-   tolua_function(tolua_S,"GetRowWidths",tolua_UI_Text3D_GetRowWidths00);
    tolua_function(tolua_S,"GetColor",tolua_UI_Text3D_GetColor00);
    tolua_function(tolua_S,"GetOpacity",tolua_UI_Text3D_GetOpacity00);
    tolua_function(tolua_S,"GetFaceCamera",tolua_UI_Text3D_GetFaceCamera00);
   tolua_endmodule(tolua_S);
+  tolua_function(tolua_S,"Text3D",tolua_UI_Text3D00);
   tolua_cclass(tolua_S,"UI","UI","Object",NULL);
   tolua_beginmodule(tolua_S,"UI");
    tolua_function(tolua_S,"SetCursor",tolua_UI_UI_SetCursor00);
@@ -14653,12 +15052,12 @@ TOLUA_API int tolua_UI_open (lua_State* tolua_S)
    tolua_function(tolua_S,"SetHovering",tolua_UI_UIElement_SetHovering00);
    tolua_function(tolua_S,"SetTempVisible",tolua_UI_UIElement_SetTempVisible00);
    tolua_function(tolua_S,"AdjustScissor",tolua_UI_UIElement_AdjustScissor00);
-   tolua_function(tolua_S,"GetBatchesWithOffset",tolua_UI_UIElement_GetBatchesWithOffset00);
    tolua_function(tolua_S,"GetColorAttr",tolua_UI_UIElement_GetColorAttr00);
    tolua_function(tolua_S,"GetTraversalMode",tolua_UI_UIElement_GetTraversalMode00);
    tolua_function(tolua_S,"IsElementEventSender",tolua_UI_UIElement_IsElementEventSender00);
    tolua_function(tolua_S,"GetElementEventSender",tolua_UI_UIElement_GetElementEventSender00);
   tolua_endmodule(tolua_S);
+  tolua_function(tolua_S,"UIElement",tolua_UI_UIElement00);
   tolua_constant(tolua_S,"DRAG_NONE",DRAG_NONE);
   tolua_constant(tolua_S,"DRAG_MOVE",DRAG_MOVE);
   tolua_constant(tolua_S,"DRAG_RESIZE_TOPLEFT",DRAG_RESIZE_TOPLEFT);
@@ -14686,6 +15085,7 @@ TOLUA_API int tolua_UI_open (lua_State* tolua_S)
    tolua_function(tolua_S,"GetModalFrameColor",tolua_UI_Window_GetModalFrameColor00);
    tolua_function(tolua_S,"GetModalFrameSize",tolua_UI_Window_GetModalFrameSize00);
   tolua_endmodule(tolua_S);
+  tolua_function(tolua_S,"Window",tolua_UI_Window00);
  tolua_endmodule(tolua_S);
  return 1;
 }

+ 109 - 12
Extras/LuaScript/UILuaAPI.h

@@ -22,26 +22,123 @@
 
 #pragma once
 
+#include "BorderImage.h"
+#include "Button.h"
+#include "CheckBox.h"
 #include "Context.h"
 #include "Cursor.h"
+#include "DropDownList.h"
+#include "FileSelector.h"
+#include "Font.h"
+#include "LineEdit.h"
+#include "ListView.h"
 #include "LuaScript.h"
+#include "Menu.h"
+#include "ScrollBar.h"
+#include "ScrollView.h"
+#include "Slider.h"
 #include "Sprite.h"
+#include "Text.h"
+#include "Text3D.h"
 #include "UI.h"
+#include "UIElement.h"
+#include "Window.h"
+
 
 namespace Urho3D
 {
-    UI* GetUI()
-    {
-        return GetLuaScriptContext()->GetSubsystem<UI>();
-    }
+    BorderImage* NewBorderImage()
+	{
+		return new BorderImage(GetLuaScriptContext());
+	}
+	
+	Button* NewButton()
+	{
+		return new Button(GetLuaScriptContext());
+	}
+
+	CheckBox* NewCheckBox()
+	{
+		return new CheckBox(GetLuaScriptContext());
+	}
+	
+	Cursor* NewCursor()
+	{
+		return new Cursor(GetLuaScriptContext());
+	}
+	
+	DropDownList* NewDropDownList()
+	{
+		return new DropDownList(GetLuaScriptContext());
+	}
+	
+	FileSelector* NewFileSelector()
+	{
+		return new FileSelector(GetLuaScriptContext());
+	}
+	
+	Font* NewFont()
+	{
+		return new Font(GetLuaScriptContext());
+	}
+	
+	LineEdit* NewLineEdit()
+	{
+		return new LineEdit(GetLuaScriptContext());
+	}
+	
+	ListView* NewListView()
+	{
+		return new ListView(GetLuaScriptContext());
+	}
+	
+	Menu* NewMenu()
+	{
+		return new Menu(GetLuaScriptContext());
+	}
+	
+	ScrollBar* NewScrollBar()
+	{
+		return new ScrollBar(GetLuaScriptContext());
+	}
+	
+	ScrollView* NewScrollView()
+	{
+		return new ScrollView(GetLuaScriptContext());
+	}
+	
+	Slider* NewSlider()
+	{
+		return new Slider(GetLuaScriptContext());
+	}
 
-    Cursor* NewCursor()
-    {
-        return new Cursor(GetLuaScriptContext());
-    }
+	Sprite* NewSprite()
+	{
+		return new Sprite(GetLuaScriptContext());
+	}
+	
+	Text* NewText()
+	{
+		return new Text(GetLuaScriptContext());
+	}
+	
+	Text3D* NewText3D()
+	{
+		return new Text3D(GetLuaScriptContext());
+	}
 
-    Sprite* NewSprite()
-    {
-        return new Sprite(GetLuaScriptContext());
-    }
+	UI* GetUI()
+	{
+		return GetLuaScriptContext()->GetSubsystem<UI>();
+	}
+	
+	UIElement* NewUIElement()
+	{
+		return new UIElement(GetLuaScriptContext());
+	}
+	
+	Window* NewWindow()
+	{
+		return new Window(GetLuaScriptContext());
+	}
 }

部分文件因文件數量過多而無法顯示