Browse Source

Update Lua API. In SpriteTest.lua replace some function with property to make the code clean.

Aster Jian 12 years ago
parent
commit
ad5bf73d10

+ 28 - 27
Bin/Data/LuaScripts/SpriteTest.lua

@@ -10,7 +10,7 @@ local graphics = GetGraphics()
 local ui = GetUI()
 
 function Start()
-    if engine:IsHeadless() then
+    if engine.headless then
         ErrorDialog("SpriteTest", "Headless mode is not supported. The program will now exit.")
         engine:Exit()
         return
@@ -30,42 +30,42 @@ function InitUI()
     local uiStyle = cache:GetXMLFile("UI/DefaultStyle.xml")
     
     local debugHud = engine:CreateDebugHud()
-    debugHud:SetDefaultStyle(uiStyle)
-    debugHud:SetMode(DEBUGHUD_SHOW_ALL)
+    debugHud.defaultStyle = uiStyle
+    debugHud.mode = DEBUGHUD_SHOW_ALL
     
     local console = engine:CreateConsole()
-    console:SetDefaultStyle(uiStyle)
+    console.defaultStyle = uiStyle
     
     local cursor = Cursor:new(context)
-    cursor:SetStyleAuto(uiStyle)    
-    cursor:SetPosition(graphics:GetWidth() / 2, graphics:GetHeight() / 2)
-    ui:SetCursor(cursor)
+    cursor.styleAuto = uiStyle
+    cursor.position = IntVector2(graphics:GetWidth() / 2, graphics:GetHeight() / 2)
+    ui.cursor = cursor
     
     if GetPlatform():Eq("Android") or GetPlatform():Eq("iOS") then
-        ui:GetCursor():SetVisible(false)
+        ui.cursor.visible = false
     end
 end
 
 function InitSprites()
     local decalTex = cache:GetTexture2D("Textures/UrhoDecal.dds")
     
-    local width = graphics:GetWidth()
-    local height = graphics:GetHeight()
+    local width = graphics.width
+    local height = graphics.height
     
     for i = 1, numSprites do
         local sprite = Sprite:new(context)
-        sprite:SetTexture(decalTex)
+        sprite.texture = decalTex
         sprite:SetFullImageRect()
-        sprite:SetPosition(Random(width), Random(height))
-        sprite:SetSize(128, 128)        
-        sprite:SetHotSpot(64, 64)        
-        sprite:SetRotation(Random(360))        
-        sprite:SetScale(Random(1) + 0.5)
+        sprite.position = Vector2(Random(width), Random(height))
+        sprite:SetSize(128, 128)
+        sprite.hotSpot = IntVector2(64, 64)
+        sprite.rotation = Random(360)
+        sprite.scale = Vector2(1, 1) * (Random(1) + 0.5)
         
-        sprite:SetColor(Color(Random(0.5) + 0.5, Random(0.5) + 0.5, Random(0.5) + 0.5, 1.0))        
-        sprite:SetBlendMode(BLEND_ADD)
+        sprite:SetColor(Color(Random(0.5) + 0.5, Random(0.5) + 0.5, Random(0.5) + 0.5, 1.0))
+        sprite.blendMode = BLEND_ADD
         
-        ui:GetRoot():AddChild(sprite)
+        ui.root:AddChild(sprite)
         
         table.insert(sprites, sprite)
         table.insert(speeds, Vector2(Random(200) - 100, Random(200) - 100))        
@@ -75,16 +75,16 @@ end
 function HandleUpdate(eventType, eventData)
     local timeStep = eventData:GetFloat("TimeStep")
     
-    local width = graphics:GetWidth()
-    local height = graphics:GetHeight()
+    local width = graphics.width
+    local height = graphics.height
     
     for i = 1, numSprites do
         local sprite = sprites[i]
-        sprite:SetRotation(sprite:GetRotation() + timeStep * 30)
-        
-        local newPos = sprite:GetPosition()
+        sprite.rotation = sprite.rotation + timeStep * 30
         
+        local newPos = sprite.position
         newPos = newPos + speeds[i] * timeStep
+        
         if newPos.x >= width then
             newPos.x = newPos.x - width
         elseif newPos.x < 0 then
@@ -95,7 +95,7 @@ function HandleUpdate(eventType, eventData)
         elseif newPos.y < 0 then
             newPos.y = newPos.y + height
         end
-        sprite:SetPosition(newPos)
+        sprite.position = newPos
     end
 end
 
@@ -103,10 +103,11 @@ function HandleKeyDown(eventType, eventData)
     local key = eventData:GetInt("Key")
     
     if key == KEY_ESC then
-        if ui:GetFocusElement() == nil then
+        if ui.focusElement == nil then
             engine:Exit();
         else
-            GetConsole():SetVisible(false)
+            local console = GetConsole()
+            console.visible = false
         end
     end
     

+ 8 - 38
Extras/LuaScript/pkgs/Engine/Console.pkg

@@ -1,58 +1,28 @@
 $#include "Console.h"
 
-/// %Console window with log history and AngelScript prompt.
 class Console
 {
-public:
-    // Methods:
-    /// Set UI elements' style from an XML file.
     void SetDefaultStyle(XMLFile* style);
-
-    /// Show or hide. Showing automatically focuses the line edit.
     void SetVisible(bool enable);
-    
-    /// Toggle visibility.
     void Toggle();
-    
-    /// Set number of displayed rows.
     void SetNumRows(unsigned rows);
-    
-    /// Set command history maximum size, 0 disables history.
     void SetNumHistoryRows(unsigned rows);
-    
-    /// Update elements to layout properly. Call this after manually adjusting the sub-elements.
     void UpdateElements();
-
-    /// Return the UI style file.
-    XMLFile* GetDefaultStyle() const;
-    
-    /// Return the background element.
-    BorderImage* GetBackground() const { return background_; }
-    
-    /// Return the line edit element.
-    LineEdit* GetLineEdit() const { return lineEdit_; }
     
-    /// Return whether is visible.
+    XMLFile* GetDefaultStyle() const;
+    BorderImage* GetBackground() const;
+    LineEdit* GetLineEdit() const;
     bool IsVisible() const;
-    
-    /// Return number of displayed rows.
-    unsigned GetNumRows() const { return rows_.Size(); }
-    
-    /// Return history maximum size.
-    unsigned GetNumHistoryRows() const { return historyRows_; }
-    
-    /// Return current history position.
-    unsigned GetHistoryPosition() const { return historyPosition_; }
-    
-    /// Return history row at index.
+    unsigned GetNumRows() const;
+    unsigned GetNumHistoryRows() const;
+    unsigned GetHistoryPosition() const;
     const String& GetHistoryRow(unsigned index) const;
     
-    // Properties:
     tolua_property__get_set XMLFile* defaultStyle;
+    tolua_readonly tolua_property__get_set BorderImage* background;
+    tolua_readonly tolua_property__get_set LineEdit* lineEdit;
     tolua_property__is_set bool visible;
     tolua_property__get_set unsigned numRows;
     tolua_property__get_set unsigned numHistoryRows;
     tolua_readonly tolua_property__get_set unsigned historyPosition;
-    tolua_readonly tolua_property__get_set BorderImage* background;
-    tolua_readonly tolua_property__get_set LineEdit* lineEdit;
 };

+ 4 - 45
Extras/LuaScript/pkgs/Engine/DebugHud.pkg

@@ -6,77 +6,36 @@ static const unsigned DEBUGHUD_SHOW_MODE;
 static const unsigned DEBUGHUD_SHOW_PROFILER;
 static const unsigned DEBUGHUD_SHOW_ALL;
 
-/// Displays rendering stats and profiling information.
 class DebugHud : public Object
 {
-public:
-    /// Update. Called by HandleUpdate().
-    void Update();
-    
-    /// Set UI elements' style from an XML file.
     void SetDefaultStyle(XMLFile* style);
-    
-    /// Set elements to show.
     void SetMode(unsigned mode);
-    
-    /// Set maximum profiler block depth, default unlimited.
     void SetProfilerMaxDepth(unsigned depth);
-    
-    /// Set profiler accumulation interval in seconds.
     void SetProfilerInterval(float interval);
-    
-    /// Set whether to show 3D geometry primitive/batch count only. Default false.
     void SetUseRendererStats(bool enable);
-    
-    /// Toggle elements.
     void Toggle(unsigned mode);
-    
-    /// Toggle all elements.
     void ToggleAll();
-
-    /// Return the UI style file.
-    XMLFile* GetDefaultStyle() const;
     
-    /// Return rendering stats text.
+    XMLFile* GetDefaultStyle() const;
     Text* GetStatsText() const;
-    
-    /// Return rendering mode text.
     Text* GetModeText() const;
-    
-    /// Return profiler text.
     Text* GetProfilerText() const;
-    
-    /// Return currently shown elements.
     unsigned GetMode() const;
-    
-    /// Return maximum profiler block depth.
     unsigned GetProfilerMaxDepth() const;
-    
-    /// Return profiler accumulation interval in seconds
     float GetProfilerInterval() const;
-
-    /// Return whether showing 3D geometry primitive/batch count only.
     bool GetUseRendererStats() const;
     
-    /// Set application-specific stats.
     void SetAppStats(const String& label, const Variant& stats);
-    
-    /// Set application-specific stats.
     void SetAppStats(const String& label, const String& stats);
-    
-    /// Reset application-specific stats. Return true if it was erased successfully.
     bool ResetAppStats(const String& label);
-    
-    /// Clear all application-specific stats.
     void ClearAppStats();
     
-    // Properties:
     tolua_property__get_set XMLFile* defaultStyle;
+    tolua_readonly tolua_property__get_set Text* statsText;
+    tolua_readonly tolua_property__get_set Text* modeText;
+    tolua_readonly tolua_property__get_set Text* profilerText;
     tolua_property__get_set unsigned mode;
     tolua_property__get_set unsigned profilerMaxDepth;
     tolua_property__get_set float profilerInterval;
     tolua_property__get_set bool useRendererStats;
-    tolua_readonly tolua_property__get_set Text* statsText;
-    tolua_readonly tolua_property__get_set Text* modeText;
-    tolua_readonly tolua_property__get_set Text* profilerText;
 };

+ 1 - 42
Extras/LuaScript/pkgs/Engine/Engine.pkg

@@ -1,70 +1,29 @@
 $#include "Engine.h"
 
-/// Urho3D engine. Creates the other subsystems.
 class Engine : public Object
 {
-public:
-    /// Run one frame.
     void RunFrame();
-    
-    /// Create the console and return it. May return null if engine configuration does not allow creation (headless mode.)
     Console* CreateConsole();
-    
-    /// Create the debug hud.
     DebugHud* CreateDebugHud();
-    
-    /// Set minimum frames per second. If FPS goes lower than this, time will appear to slow down.
     void SetMinFps(int fps);
-    
-    /// Set maximum frames per second. The engine will sleep if FPS is higher than this.
     void SetMaxFps(int fps);
-    
-    /// Set maximum frames per second when the application does not have input focus.
     void SetMaxInactiveFps(int fps);
-    
-    /// Set whether to pause update events and audio when minimized.
     void SetPauseMinimized(bool enable);
-    
-    /// Set whether to exit automatically on exit request (window close button.)
     void SetAutoExit(bool enable);
-
-    /// Close the application window and set the exit flag.
     void Exit();
-    
-    /// Dump profiling information to the log.
     void DumpProfiler();
-    
-    /// Dump information of all resources to the log.
     void DumpResources();
-    
-    /// Dump information of all memory allocations to the log. Supported in MSVC debug mode only.
     void DumpMemory();
-    
-    /// Return the minimum frames per second.
+
     int GetMinFps() const;
-    
-    /// Return the maximum frames per second.
     int GetMaxFps() const;
-    
-    /// Return the maximum frames per second when the application does not have input focus.
     int GetMaxInactiveFps() const;
-    
-    /// Return whether to pause update events and audio when minimized.
     bool GetPauseMinimized() const;
-    
-    /// Return whether to exit automatically on exit request.
     bool GetAutoExit() const;
-
-    /// Return whether engine has been initialized.
     bool IsInitialized() const;
-    
-    /// Return whether exit has been requested.
     bool IsExiting() const;
-    
-    /// Return whether the engine has been created in headless mode.
     bool IsHeadless() const;
     
-    // Properties:
     tolua_property__get_set int minFps;
     tolua_property__get_set int maxFps;
     tolua_property__get_set int maxInactiveFps;

+ 11 - 26
Extras/LuaScript/pkgs/Graphics/Graphics.pkg

@@ -1,45 +1,30 @@
 $#include "Graphics.h"
 
-/// %Graphics subsystem. Manages the application window, rendering state and GPU resources.
 class Graphics : public Object
-{    
-public:    
-    /// Set window title.
+{
     void SetWindowTitle(const char* windowTitle);
-    
-    /// Set whether the main window uses sRGB conversion on write.
     void SetSRGB(bool enable);
-    
-    /// Toggle between full screen and windowed mode. Return true if successful.
     bool ToggleFullscreen();
-    
-    /// Take a screenshot. Return true if successful.
     bool TakeScreenShot(Image& destImage);
     
-    /// Return whether rendering initialized.
     bool IsInitialized() const;
     
-    /// Return window width.
     int GetWidth() const;
-    
-    /// Return window height.
     int GetHeight() const;
-    
-    /// Return multisample mode (1 = no multisampling.)
     int GetMultiSample() const;
-    
-    /// Return whether window is fullscreen.
     bool GetFullscreen() const;
-    
-    /// Return whether window is resizable.
     bool GetResizable() const;
-    
-    /// Return whether vertical sync is on.
     bool GetVSync() const;
-    
-    /// Return whether triple buffering is enabled.
     bool GetTripleBuffer() const;
-    
-    /// Return whether the main window is using sRGB conversion on write.
     bool GetSRGB() const;
+    
+    tolua_readonly tolua_property__is_set bool initialized;
+    tolua_readonly tolua_property__get_set int width;
+    tolua_readonly tolua_property__get_set int height;
+    tolua_readonly tolua_property__get_set int multiSample;
+    tolua_readonly tolua_property__get_set bool fullscreen;
+    tolua_readonly tolua_property__get_set bool resizable;
+    tolua_readonly tolua_property__get_set bool vSync;
+    tolua_readonly tolua_property__get_set bool tripleBuffer;
+    tolua_property__get_set bool sRGB;
 };

+ 2 - 2
Extras/LuaScript/pkgs/Navigation/NavigationMesh.pkg

@@ -114,9 +114,9 @@ public:
     tolua_property__get_set float edgeMaxError;
     tolua_property__get_set float detailSampleDistance;
     tolua_property__get_set float detailSampleMaxError;
-    tolua_property__get_set const Vector3& padding;
+    tolua_property__get_set Vector3& padding;
     tolua_readonly tolua_property__is_set bool initialized;
-    tolua_readonly tolua_property__get_set const BoundingBox& boundingBox;
+    tolua_readonly tolua_property__get_set BoundingBox& boundingBox;
     tolua_readonly tolua_property__get_set BoundingBox worldBoundingBox;
     tolua_readonly tolua_property__get_set IntVector2 numTiles;
 };

+ 46 - 46
Extras/LuaScript/pkgs/Physics/CollisionShape.pkg

@@ -1,6 +1,5 @@
 $#include "CollisionShape.h"
 
-/// Collision shape type.
 enum ShapeType
 {
     SHAPE_BOX = 0,
@@ -14,80 +13,81 @@ enum ShapeType
     SHAPE_TERRAIN
 };
 
-/// Physics collision shape component.
 class CollisionShape : public Component
 {
-public:
-    /// Set as a box.
     void SetBox(const Vector3& size, const Vector3& position = Vector3::ZERO, const Quaternion& rotation = Quaternion::IDENTITY);
-    /// Set as a sphere.
+    void SetBox(const Vector3& size, const Vector3& position = Vector3::ZERO);
+    void SetBox(const Vector3& size);
+    
     void SetSphere(float diameter, const Vector3& position = Vector3::ZERO, const Quaternion& rotation = Quaternion::IDENTITY);
-    /// Set as a static plane.
+    void SetSphere(float diameter, const Vector3& position = Vector3::ZERO);
+    void SetSphere(float diameter);
+    
     void SetStaticPlane(const Vector3& position = Vector3::ZERO, const Quaternion& rotation = Quaternion::IDENTITY);
-    /// Set as a cylinder.
+    void SetStaticPlane(const Vector3& position = Vector3::ZERO);
+    void SetStaticPlane();
+    
     void SetCylinder(float diameter, float height, const Vector3& position = Vector3::ZERO, const Quaternion& rotation = Quaternion::IDENTITY);
-    /// Set as a capsule.
+    void SetCylinder(float diameter, float height, const Vector3& position = Vector3::ZERO);
+    void SetCylinder(float diameter, float height);
+    
     void SetCapsule(float diameter, float height, const Vector3& position = Vector3::ZERO, const Quaternion& rotation = Quaternion::IDENTITY);
-    /// Set as a cone.
+    void SetCapsule(float diameter, float height, const Vector3& position = Vector3::ZERO);
+    void SetCapsule(float diameter, float height);
+    
     void SetCone(float diameter, float height, const Vector3& position = Vector3::ZERO, const Quaternion& rotation = Quaternion::IDENTITY);
-    /// Set as a triangle mesh.
+    void SetCone(float diameter, float height, const Vector3& position = Vector3::ZERO);
+    void SetCone(float diameter, float height);
+    
     void SetTriangleMesh(Model* model, unsigned lodLevel = 0, const Vector3& scale = Vector3::ONE, const Vector3& position = Vector3::ZERO, const Quaternion& rotation = Quaternion::IDENTITY);
-    /// Set as a convex hull from Model.
+    void SetTriangleMesh(Model* model, unsigned lodLevel = 0, const Vector3& scale = Vector3::ONE, const Vector3& position = Vector3::ZERO);
+    void SetTriangleMesh(Model* model, unsigned lodLevel = 0, const Vector3& scale = Vector3::ONE);
+    void SetTriangleMesh(Model* model, unsigned lodLevel = 0);
+    void SetTriangleMesh(Model* model);
+    
     void SetConvexHull(Model* model, unsigned lodLevel = 0, const Vector3& scale = Vector3::ONE, const Vector3& position = Vector3::ZERO, const Quaternion& rotation = Quaternion::IDENTITY);
-    /// Set as a terrain. Only works if the same scene node contains a Terrain component.
+    void SetConvexHull(Model* model, unsigned lodLevel = 0, const Vector3& scale = Vector3::ONE, const Vector3& position = Vector3::ZERO);
+    void SetConvexHull(Model* model, unsigned lodLevel = 0, const Vector3& scale = Vector3::ONE);
+    void SetConvexHull(Model* model, unsigned lodLevel = 0);
+    void SetConvexHull(Model* model);
+    
     void SetTerrain();
-    /// Set shape type.
     void SetShapeType(ShapeType type);
-    /// Set shape size.
     void SetSize(const Vector3& size);
-    /// Set offset position.
     void SetPosition(const Vector3& position);
-    /// Set offset rotation.
     void SetRotation(const Quaternion& rotation);
-    /// Set offset transform.
     void SetTransform(const Vector3& position, const Quaternion& rotation);
-    /// Set collision margin.
     void SetMargin(float margin);
-    /// Set triangle mesh / convex hull model.
     void SetModel(Model* model);
-    /// Set model LOD level.
     void SetLodLevel(unsigned lodLevel);
-    
-    /// Return physics world.
-    PhysicsWorld* GetPhysicsWorld() const { return physicsWorld_; }
-    /// Return shape type.
-    ShapeType GetShapeType() const { return shapeType_; }
-    /// Return shape size.
-    const Vector3& GetSize() const { return size_; }
-    /// Return offset position.
-    const Vector3& GetPosition() const { return position_; }
-    /// Return offset rotation.
-    const Quaternion& GetRotation() const { return rotation_; }
-    /// Return collision margin.
-    float GetMargin() const { return margin_; }
-    /// Return triangle mesh / convex hull model.
-    Model* GetModel() const { return model_; }
-    /// Return model LOD level.
-    unsigned GetLodLevel() const { return lodLevel_; }
-    /// Return world-space bounding box.
+
+    PhysicsWorld* GetPhysicsWorld() const;
+    ShapeType GetShapeType() const;
+    const Vector3& GetSize() const;
+    const Vector3& GetPosition() const;
+    const Quaternion& GetRotation() const;
+    float GetMargin() const;
+    Model* GetModel() const;
+    unsigned GetLodLevel() const;
     BoundingBox GetWorldBoundingBox() const;
     
-    /// Update the new collision shape to the RigidBody.
     void NotifyRigidBody(bool updateMass = true);
-    /// Set model attribute.
+    void NotifyRigidBody();
+    
     void SetModelAttr(ResourceRef value);
-    /// Return model attribute.
     ResourceRef GetModelAttr() const;
-    /// Release the collision shape.
+    
     void ReleaseShape();
     
     // Properties:
+    tolua_readonly tolua_property__get_set PhysicsWorld* physicsWorld;
     tolua_property__get_set ShapeType shapeType;
-    tolua_property__get_set const Vector3& size;
-    tolua_property__get_set const Vector3& position;
-    tolua_property__get_set const Quaternion& rotation;
+    tolua_property__get_set Vector3& size;
+    tolua_property__get_set Vector3& position;
+    tolua_property__get_set Quaternion& rotation;
     tolua_property__get_set float margin;
     tolua_property__get_set Model* model;
     tolua_property__get_set unsigned lodLevel;
-    tolua_readonly tolua_property__get_set BoundingBox worldBoundingBox;
+    tolua_readonlytolua_property__get_set BoundingBox worldBoundingBox;
+    tolua_property__get_set ResourceRef modelAttr;
 };

+ 24 - 57
Extras/LuaScript/pkgs/Physics/Constraint.pkg

@@ -1,6 +1,5 @@
 $#include "Constraint.h"
 
-/// Supported constraint types.
 enum ConstraintType
 {
     CONSTRAINT_POINT = 0,
@@ -9,85 +8,53 @@ enum ConstraintType
     CONSTRAINT_CONETWIST
 };
 
-/// Physics constraint component. Connects two rigid bodies together, or one rigid body to a static point.
 class Constraint : public Component
 {
-public:
-    /// Set constraint type and recreate the constraint.
     void SetConstraintType(ConstraintType type);
-    /// Set other body to connect to. Set to null to connect to the static world.
     void SetOtherBody(RigidBody* body);
-    /// Set constraint position relative to own body.
     void SetPosition(const Vector3& position);
-    /// Set constraint rotation relative to own body.
     void SetRotation(const Quaternion& rotation);
-    /// Set constraint rotation relative to own body by specifying the axis.
     void SetAxis(const Vector3& axis);
-    /// Set constraint position relative to the other body. If connected to the static world, is a world-space position.
     void SetOtherPosition(const Vector3& position);
-    /// Set constraint rotation relative to the other body. If connected to the static world, is a world-space rotation.
     void SetOtherRotation(const Quaternion& rotation);
-    /// Set constraint rotation relative to the other body by specifying the axis.
     void SetOtherAxis(const Vector3& axis);
-    /// Set constraint world-space position. Resets both own and other body relative position, ie. zeroes the constraint error.
     void SetWorldPosition(const Vector3& position);
-    /// Set high limit. Interpretation is constraint type specific.
     void SetHighLimit(const Vector2& limit);
-    /// Set low limit. Interpretation is constraint type specific.
     void SetLowLimit(const Vector2& limit);
-    /// Set constraint error reduction parameter. Zero = leave to default.
     void SetERP(float erp);
-    /// Set constraint force mixing parameter. Zero = leave to default.
     void SetCFM(float cfm);
-    /// Set whether to disable collisions between connected bodies.
     void SetDisableCollision(bool disable);
-    
-    /// Return physics world.
-    PhysicsWorld* GetPhysicsWorld() const { return physicsWorld_; }
-    /// Return constraint type.
-    ConstraintType GetConstraintType() const { return constraintType_; }
-    /// Return rigid body in own scene node.
-    RigidBody* GetOwnBody() const { return ownBody_; }
-    /// Return the other rigid body. May be null if connected to the static world.
-    RigidBody* GetOtherBody() const { return otherBody_; }
-    /// Return constraint position relative to own body.
-    const Vector3& GetPosition() const { return position_; }
-    /// Return constraint rotation relative to own body.
-    const Quaternion& GetRotation() const { return rotation_; }
-    /// Return constraint position relative to other body.
-    const Vector3& GetOtherPosition() const { return otherPosition_; }
-    /// Return constraint rotation relative to other body.
-    const Quaternion& GetOtherRotation() const { return otherRotation_; }
-    /// Return constraint world position, calculated from own body.
+
+    PhysicsWorld* GetPhysicsWorld() const;
+    ConstraintType GetConstraintType() const;
+    RigidBody* GetOwnBody() const;
+    RigidBody* GetOtherBody() const;
+    const Vector3& GetPosition() const;
+    const Quaternion& GetRotation() const;
+    const Vector3& GetOtherPosition() const;
+    const Quaternion& GetOtherRotation() const;
     Vector3 GetWorldPosition() const;
-    /// Return high limit.
-    const Vector2& GetHighLimit() const { return highLimit_; }
-    /// Return low limit.
-    const Vector2& GetLowLimit() const { return lowLimit_; }
-    /// Return constraint error reduction parameter.
-    float GetERP() const { return erp_; }
-    /// Return constraint force mixing parameter.
-    float GetCFM() const { return cfm_; }
-    /// Return whether collisions between connected bodies are disabled.
-    bool GetDisableCollision() const { return disableCollision_; }
+    const Vector2& GetHighLimit() const;
+    const Vector2& GetLowLimit() const;
+    float GetERP() const;
+    float GetCFM() const;
+    bool GetDisableCollision() const;
     
-    /// Release the constraint.
     void ReleaseConstraint();
-    /// Apply constraint frames.
-    void ApplyFrames();    
+    void ApplyFrames();
     
-    // Properties:
+    tolua_readonly tolua_property__get_set PhysicsWorld* physicsWorld;
     tolua_property__get_set ConstraintType constraintType;
-    tolua_property__get_set const Vector3& position;
-    tolua_property__get_set const Quaternion& rotation;
-    tolua_property__get_set const Vector3& otherPosition;
-    tolua_property__get_set const Quaternion& otherRotation;
+    tolua_readonly tolua_property__get_set RigidBody* ownBody;
+    tolua_property__get_set RigidBody* otherBody;
+    tolua_property__get_set Vector3& position;
+    tolua_property__get_set Quaternion& rotation;
+    tolua_property__get_set Vector3& otherPosition;
+    tolua_property__get_set Quaternion& otherRotation;
     tolua_property__get_set Vector3 worldPosition;
-    tolua_property__get_set const Vector2& highLimit;
-    tolua_property__get_set const Vector2& lowLimit;
+    tolua_property__get_set Vector2& highLimit;
+    tolua_property__get_set Vector2& lowLimit;
     tolua_property__get_set float ERP;
     tolua_property__get_set float CFM;
     tolua_property__get_set bool disableCollision;
-    tolua_readonly tolua_property__get_set RigidBody* ownBody;
-    tolua_property__get_set RigidBody* otherBody;
 };

+ 12 - 52
Extras/LuaScript/pkgs/Physics/PhysicsWorld.pkg

@@ -1,110 +1,70 @@
 $#include "PhysicsWorld.h"
 
-/// Physics raycast hit.
 struct PhysicsRaycastResult
 {
     PhysicsRaycastResult();
-    
-    /// Hit position.
     Vector3 position_ @ position;
-    /// Hit normal.
     Vector3 normal_ @ normal;
-    /// Hit distance from ray origin.
     float distance_ @ distance;
-    /// Rigid body that was hit.
     RigidBody* body_ @ body;
 };
 
-/// Delayed world transform assignment for parented rigidbodies.
 struct DelayedWorldTransform
 {
-    /// Rigid body.
     RigidBody* rigidBody_ @ rigidBody;
-    /// Parent rigid body.
     RigidBody* parentRigidBody_ @ parentRigidBody;
-    /// New world position.
     Vector3 worldPosition_ @ worldPosition;
-    /// New world rotation.
     Quaternion worldRotation_ @ worldRotation;
 };
 
-
-/// Physics simulation world component. Should be added only to the root scene node.
 class PhysicsWorld : public Component
 {
-public:
-    /// Step the simulation forward.
     void Update(float timeStep);
-    /// Refresh collisions only without updating dynamics.
     void UpdateCollisions();
-    /// Set simulation steps per second.
     void SetFps(int fps);
-    /// Set gravity.
     void SetGravity(Vector3 gravity);
-    /// Set number of constraint solver iterations.
     void SetNumIterations(int num);
-    /// Set whether to interpolate between simulation steps.
     void SetInterpolation(bool enable);
-    /// Set whether to use Bullet's internal edge utility for trimesh collisions. Disabled by default.
     void SetInternalEdge(bool enable);
-    /// Set split impulse collision mode. This is more accurate, but slower. Disabled by default.
     void SetSplitImpulse(bool enable);
-    /// Set maximum angular velocity for network replication.
     void SetMaxNetworkAngularVelocity(float velocity);
-    /// Perform a physics world raycast and return all hits.
-    /// Perform a physics world raycast and return the closest hit.
+
     void RaycastSingle(PhysicsRaycastResult& result, const Ray& ray, float maxDistance, unsigned collisionMask = M_MAX_UNSIGNED);
-    /// Perform a physics world swept sphere test and return the closest hit.
+    void RaycastSingle(PhysicsRaycastResult& result, const Ray& ray, float maxDistance);
+    
     void SphereCast(PhysicsRaycastResult& result, const Ray& ray, float radius, float maxDistance, unsigned collisionMask = M_MAX_UNSIGNED);
+    void SphereCast(PhysicsRaycastResult& result, const Ray& ray, float radius, float maxDistance);
     
-    /// Return gravity.
     Vector3 GetGravity() const;
-    /// Return number of constraint solver iterations.
     int GetNumIterations() const;
-    /// Return whether interpolation between simulation steps is enabled.
-    bool GetInterpolation() const { return interpolation_; }
-    /// Return whether Bullet's internal edge utility for trimesh collisions is enabled.
-    bool GetInternalEdge() const { return internalEdge_; }
-    /// Return whether split impulse collision mode is enabled.
+    bool GetInterpolation() const;
+    bool GetInternalEdge() const;
     bool GetSplitImpulse() const;
-    /// Return simulation steps per second.
-    int GetFps() const { return fps_; }
-    /// Return maximum angular velocity for network replication.
-    float GetMaxNetworkAngularVelocity() const { return maxNetworkAngularVelocity_; }
+    int GetFps() const;
+    float GetMaxNetworkAngularVelocity() const;
 
-    /// Add a rigid body to keep track of. Called by RigidBody.
     void AddRigidBody(RigidBody* body);
-    /// Remove a rigid body. Called by RigidBody.
     void RemoveRigidBody(RigidBody* body);
-    /// Add a collision shape to keep track of. Called by CollisionShape.
     void AddCollisionShape(CollisionShape* shape);
-    /// Remove a collision shape. Called by CollisionShape.
     void RemoveCollisionShape(CollisionShape* shape);
-    /// Add a constraint to keep track of. Called by Constraint.
     void AddConstraint(Constraint* joint);
-    /// Remove a constraint. Called by Constraint.
     void RemoveConstraint(Constraint* joint);
-    /// Add a delayed world transform assignment. Called by RigidBody.
     void AddDelayedWorldTransform(const DelayedWorldTransform& transform);
-    /// Add debug geometry to the debug renderer.
     void DrawDebugGeometry(bool depthTest);
-    /// Set debug renderer to use. Called both by PhysicsWorld itself and physics components.
     void SetDebugRenderer(DebugRenderer* debug);
-    /// Set debug geometry depth test mode. Called both by PhysicsWorld itself and physics components.
     void SetDebugDepthTest(bool enable);
-
-    /// Clean up the geometry cache.
+    
     void CleanupGeometryCache();
-    /// Set node dirtying to be disregarded.
     void SetApplyingTransforms(bool enable);
-    /// Return whether node dirtying should be disregarded.
     bool IsApplyingTransforms() const;
     
     // Properties:
     tolua_property__get_set Vector3 gravity;
     tolua_property__get_set int numIterations;
-    tolua_property__get_set int fps;
     tolua_property__get_set bool interpolation;
     tolua_property__get_set bool internalEdge;
     tolua_property__get_set bool splitImpulse;
+    tolua_property__get_set int fps;
+    tolua_property__get_set float maxNetworkAngularVelocity;
+    tolua_property__is_set bool applyingTransforms;
 };

+ 17 - 86
Extras/LuaScript/pkgs/Physics/RigidBody.pkg

@@ -1,6 +1,5 @@
 $#include "RigidBody.h"
 
-/// Rigid body collision event signaling mode.
 enum CollisionEventMode
 {
     COLLISION_NEVER = 0,
@@ -8,152 +7,82 @@ enum CollisionEventMode
     COLLISION_ALWAYS
 };
 
-/// Physics rigid body component.
 class RigidBody : public Component
-{   
-public:
-    /// Set mass. Zero mass makes the body static.
+{
     void SetMass(float mass);
-    /// Set rigid body world-space position.
     void SetPosition(Vector3 position);
-    /// Set rigid body world-space rotation.
     void SetRotation(Quaternion rotation);
-    /// Set rigid body world-space position and rotation.
     void SetTransform(const Vector3& position, const Quaternion& rotation);
-    /// Set linear velocity.
     void SetLinearVelocity(Vector3 velocity);
-    /// Set linear degrees of freedom.
     void SetLinearFactor(Vector3 factor);
-    /// Set linear velocity deactivation threshold.
     void SetLinearRestThreshold(float threshold);
-    /// Set linear velocity damping factor.
     void SetLinearDamping(float damping);
-    /// Set angular velocity.
     void SetAngularVelocity(Vector3 angularVelocity);
-    /// Set angular degrees of freedom.
     void SetAngularFactor(Vector3 factor);
-    /// Set angular velocity deactivation threshold.
     void SetAngularRestThreshold(float threshold);
-    /// Set angular velocity damping factor.
     void SetAngularDamping(float factor);
-    /// Set friction coefficient.
     void SetFriction(float friction);
-    /// Set restitution coefficient.
     void SetRestitution(float restitution);
-    /// Set contact processing threshold.
     void SetContactProcessingThreshold(float threshold);
-    /// Set continuous collision detection swept sphere radius.
     void SetCcdRadius(float radius);
-    /// Set continuous collision detection motion-per-simulation-step threshold. 0 disables, which is the default.
     void SetCcdMotionThreshold(float threshold);
-    /// Set whether gravity is applied to rigid body.
     void SetUseGravity(bool enable);
-    /// Set gravity override. If zero, uses physics world's gravity.
     void SetGravityOverride(const Vector3& gravity);
-    /// Set rigid body kinematic mode. In kinematic mode forces are not applied to the rigid body.
     void SetKinematic(bool enable);
-    /// Set rigid body phantom mode. In phantom mode collisions are reported but do not apply forces.
     void SetPhantom(bool enable);
-    /// Set collision layer.
     void SetCollisionLayer(unsigned layer);
-    /// Set collision mask.
     void SetCollisionMask(unsigned mask);
-    /// Set collision group and mask.
     void SetCollisionLayerAndMask(unsigned layer, unsigned mask);
-    /// Set collision event signaling mode. Default is to signal when rigid bodies are active.
     void SetCollisionEventMode(CollisionEventMode mode);
-    /// Apply force to center of mass.
+
     void ApplyForce(const Vector3& force);
-    /// Apply force at local position.
     void ApplyForce(const Vector3& force, const Vector3& position);
-    /// Apply torque.
     void ApplyTorque(const Vector3& torque);
-    /// Apply impulse to center of mass.
     void ApplyImpulse(const Vector3& impulse);
-    /// Apply impulse at local position.
     void ApplyImpulse(const Vector3& impulse, const Vector3& position);
-    /// Apply torque impulse.
     void ApplyTorqueImpulse(const Vector3& torque);
-    /// Reset accumulated forces.
     void ResetForces();
-    /// Activate rigid body if it was resting.
     void Activate();
-    /// Readd rigid body to the physics world to clean up internal state like stale contacts.
     void ReAddBodyToWorld();
     
-    /// Return physics world.
-    PhysicsWorld* GetPhysicsWorld() const { return physicsWorld_; }
-    /// Return mass.
-    float GetMass() const { return mass_; }
-    /// Return rigid body world-space position.
+    PhysicsWorld* GetPhysicsWorld() const;
+    float GetMass() const;
     Vector3 GetPosition() const;
-    /// Return rigid body world-space rotation.
     Quaternion GetRotation() const;
-    /// Return linear velocity.
     Vector3 GetLinearVelocity() const;
-    /// Return linear degrees of freedom.
     Vector3 GetLinearFactor() const;
-    /// Return linear velocity at local point.
     Vector3 GetVelocityAtPoint(const Vector3& position) const;
-    /// Return linear velocity deactivation threshold.
     float GetLinearRestThreshold() const;
-    /// Return linear velocity damping threshold.
     float GetLinearDamping() const;
-    /// Return linear velocity damping scale.
     // float GetLinearDampingScale() const;
-    /// Return angular velocity.
     Vector3 GetAngularVelocity() const;
-    /// Return angular degrees of freedom.
     Vector3 GetAngularFactor() const;
-    /// Return angular velocity deactivation threshold.
     float GetAngularRestThreshold() const;
-    /// Return angular velocity damping threshold.
     float GetAngularDamping() const;
-    /// Return angular velocity damping scale.
     // float GetAngularDampingScale() const;
-    /// Return friction coefficient.
     float GetFriction() const;
-    /// Return restitution coefficient.
     float GetRestitution() const;
-    /// Return contact processing threshold.
     float GetContactProcessingThreshold() const;
-    /// Return continuous collision detection swept sphere radius.
     float GetCcdRadius() const;
-    /// Return continuous collision detection motion-per-simulation-step threshold.
     float GetCcdMotionThreshold() const;
-    /// Return whether rigid body uses gravity.
-    bool GetUseGravity() const { return useGravity_; }
-    /// Return gravity override. If zero (default), uses the physics world's gravity.
-    const Vector3& GetGravityOverride() const { return gravityOverride_; }
-    /// Return center of mass offset.
-    const Vector3& GetCenterOfMass() const { return centerOfMass_; }
-    /// Return kinematic mode flag.
-    bool IsKinematic() const { return kinematic_; }
-    /// Return phantom mode flag.
-    bool IsPhantom() const { return phantom_; }
-    /// Return whether rigid body is active (not sleeping.)
+    bool GetUseGravity() const;
+    const Vector3& GetGravityOverride() const;
+    const Vector3& GetCenterOfMass() const;
+    bool IsKinematic() const;
+    bool IsPhantom() const;
     bool IsActive() const;
-    /// Return collision layer.
-    unsigned GetCollisionLayer() const { return collisionLayer_; }
-    /// Return collision mask.
-    unsigned GetCollisionMask() const { return collisionMask_; }
-    /// Return collision event signaling mode.
-    CollisionEventMode GetCollisionEventMode() const { return collisionEventMode_; }
+    unsigned GetCollisionLayer() const;
+    unsigned GetCollisionMask() const;
+    CollisionEventMode GetCollisionEventMode() const;
     
-    /// Apply new world transform after a simulation step. Called internally.
     void ApplyWorldTransform(const Vector3& newWorldPosition, const Quaternion& newWorldRotation);
-    /// Update mass and inertia to the Bullet rigid body.
     void UpdateMass();
-    /// Update gravity parameters to the Bullet rigid body.
     void UpdateGravity();
-    /// Add a constraint that refers to this rigid body.
     void AddConstraint(Constraint* constraint);
-    /// Remove a constraint that refers to this rigid body.
     void RemoveConstraint(Constraint* constraint);
-    /// Remove the rigid body.
     void ReleaseBody();
     
-    // Properties:
+    tolua_readonly tolua_property__get_set PhysicsWorld* physicsWorld;
     tolua_property__get_set float mass;
     tolua_property__get_set Vector3 position;
     tolua_property__get_set Quaternion rotation;
@@ -161,18 +90,20 @@ public:
     tolua_property__get_set Vector3 linearFactor;
     tolua_property__get_set float linearRestThreshold;
     tolua_property__get_set float linearDamping;
+    // tolua_readonly tolua_property__get_set float linearDampingScale;
     tolua_property__get_set Vector3 angularVelocity;
     tolua_property__get_set Vector3 angularFactor;
     tolua_property__get_set float angularRestThreshold;
     tolua_property__get_set float angularDamping;
+    // tolua_readonly tolua_property__get_set float angularDampingScale;
     tolua_property__get_set float friction;
     tolua_property__get_set float restitution;
     tolua_property__get_set float contactProcessingThreshold;
     tolua_property__get_set float ccdRadius;
     tolua_property__get_set float ccdMotionThreshold;
     tolua_property__get_set bool useGravity;
-    tolua_property__get_set const Vector3& gravityOverride;
-    tolua_readonly tolua_property__get_set const Vector3& centerOfMass;
+    tolua_property__get_set Vector3& gravityOverride;
+    tolua_readonly tolua_property__get_set Vector3& centerOfMass;
     tolua_property__is_set bool kinematic;
     tolua_property__is_set bool phantom;
     tolua_readonly tolua_property__is_set bool active;

+ 3 - 5
Extras/LuaScript/pkgs/UI/BorderImage.pkg

@@ -4,8 +4,6 @@ enum BlendMode{};
 
 class BorderImage : public UIElement
 {
-public:
-    // Method:
     BorderImage(Context* context);
     virtual ~BorderImage();
     
@@ -27,9 +25,9 @@ public:
     
     // Properties:
     tolua_property__get_set Texture* texture;
-    tolua_property__get_set const IntRect& imageRect;
-    tolua_property__get_set const IntRect& border;
-    tolua_property__get_set const IntVector2& hoverOffset;
+    tolua_property__get_set IntRect& imageRect;
+    tolua_property__get_set IntRect& border;
+    tolua_property__get_set IntVector2& hoverOffset;
     tolua_property__get_set BlendMode blendMode;
     tolua_property__is_set bool tiled;
 };

+ 4 - 4
Extras/LuaScript/pkgs/UI/Button.pkg

@@ -21,8 +21,8 @@ public:
     float GetRepeatRate() const;
     
     // Properties:
-    tolua_property__get_set const IntVector2& pressedOffset;
-    tolua_property__get_set const IntVector2& labelOffset;
-    tolua_property__get_set const float repeatDelay;
-    tolua_property__get_set const float repeatRate;
+    tolua_property__get_set IntVector2& pressedOffset;
+    tolua_property__get_set IntVector2& labelOffset;
+    tolua_property__get_set float repeatDelay;
+    tolua_property__get_set float repeatRate;
 };

+ 1 - 1
Extras/LuaScript/pkgs/UI/CheckBox.pkg

@@ -16,5 +16,5 @@ public:
     
     // Properties:
     tolua_property__is_set bool checked;
-    tolua_property__get_set const IntVector2& checkedOffset;
+    tolua_property__get_set IntVector2& checkedOffset;
 };

+ 0 - 3
Extras/LuaScript/pkgs/UI/Cursor.pkg

@@ -15,8 +15,6 @@ enum CursorShape
 
 class Cursor : public BorderImage
 {
-public:
-    // Methods:
     Cursor(Context* context);
     virtual ~Cursor();
     
@@ -26,6 +24,5 @@ public:
     void SetShape(CursorShape shape);
     CursorShape GetShape() const;
     
-    // Properties:
     tolua_property__get_set CursorShape shape;
 };

+ 1 - 1
Extras/LuaScript/pkgs/UI/DropDownList.pkg

@@ -31,6 +31,6 @@ public:
     tolua_readonly tolua_property__get_set UIElement* selectedItem;
     tolua_readonly tolua_property__get_set ListView* listView;
     tolua_readonly tolua_property__get_set UIElement* placeholder;
-    tolua_property__get_set const String& placeholderText;
+    tolua_property__get_set String& placeholderText;
     tolua_property__get_set bool resizePopup;
 };

+ 4 - 4
Extras/LuaScript/pkgs/UI/FileSelector.pkg

@@ -51,10 +51,10 @@ public:
     tolua_readonly tolua_property__get_set Button* cancelButton;
     tolua_readonly tolua_property__get_set Button* closeButton;
     
-    tolua_property__get_set const String& title;
-    tolua_property__get_set const String& path;
-    tolua_property__get_set const String& fileName;
-    tolua_readonly tolua_property__get_set const String& filter;
+    tolua_property__get_set String& title;
+    tolua_property__get_set String& path;
+    tolua_property__get_set String& fileName;
+    tolua_readonly tolua_property__get_set String& filter;
     tolua_readonly tolua_property__get_set unsigned filterIndex;
     tolua_property__get_set bool directoryMode;
 };

+ 1 - 1
Extras/LuaScript/pkgs/UI/LineEdit.pkg

@@ -30,7 +30,7 @@ public:
     float GetDoubleClickInterval() const;
     
     // Properties:
-    tolua_property__get_set const String& text;
+    tolua_property__get_set String& text;
     tolua_property__get_set unsigned cursorPosition;
     tolua_property__get_set float cursorBlinkRate;
     tolua_property__get_set unsigned maxLength;

+ 1 - 1
Extras/LuaScript/pkgs/UI/Menu.pkg

@@ -21,7 +21,7 @@ public:
     
     // Properties:
     tolua_property__get_set UIElement* popup;
-    tolua_property__get_set const IntVector2& popupOffset;
+    tolua_property__get_set IntVector2& popupOffset;
     tolua_property__get_set bool showPopup;
     tolua_readonly tolua_property__get_set int acceleratorKey;
     tolua_readonly tolua_property__get_set int acceleratorQualifiers;

+ 1 - 1
Extras/LuaScript/pkgs/UI/ScrollView.pkg

@@ -27,7 +27,7 @@ public:
     void SetViewPositionAttr(const IntVector2& value);
     
     // Properties:
-    tolua_property__get_set const IntVector2& viewPosition;
+    tolua_property__get_set IntVector2& viewPosition;
     tolua_property__get_set UIElement* contentElement;
     tolua_readonly tolua_property__get_set ScrollBar* horizontalScrollBar;
     tolua_readonly tolua_property__get_set ScrollBar* verticalScrollBar;

+ 5 - 5
Extras/LuaScript/pkgs/UI/Sprite.pkg

@@ -34,13 +34,13 @@ public:
     const Matrix3x4& GetTransform() const;
     
     // Properties:
-    tolua_property__get_set const Vector2& position;
-    tolua_property__get_set const IntVector2& hotSpot;
-    tolua_property__get_set const Vector2& scale;
+    tolua_property__get_set Vector2& position;
+    tolua_property__get_set IntVector2& hotSpot;
+    tolua_property__get_set Vector2& scale;
     tolua_property__get_set float rotation;
     tolua_property__get_set Texture* texture;
-    tolua_property__get_set const IntRect& imageRect;
+    tolua_property__get_set IntRect& imageRect;
     tolua_property__get_set BlendMode blendMode;
     tolua_property__get_set ResourceRef textureAttr;
-    tolua_property__get_set const Matrix3x4& transform;
+    tolua_readonly tolua_property__get_set Matrix3x4& transform;
 };

+ 3 - 3
Extras/LuaScript/pkgs/UI/Text.pkg

@@ -41,14 +41,14 @@ public:
     // Properties:
     tolua_property__get_set Font* font;
     tolua_readonly tolua_property__get_set int fontSize;
-    tolua_property__get_set const String& text;
+    tolua_property__get_set String& text;
     tolua_property__get_set HorizontalAlignment textAlignment;
     tolua_property__get_set float rowSpacing;
     tolua_property__get_set bool wordwrap;
     tolua_readonly tolua_property__get_set unsigned selectionStart;
     tolua_readonly tolua_property__get_set unsigned selectionLength;
-    tolua_property__get_set const Color& selectionColor;
-    tolua_property__get_set const Color& hoverColor;
+    tolua_property__get_set Color& selectionColor;
+    tolua_property__get_set Color& hoverColor;
     tolua_readonly tolua_property__get_set int rowHeight;
     tolua_readonly tolua_property__get_set unsigned numRows;
 };

+ 1 - 1
Extras/LuaScript/pkgs/UI/Text3D.pkg

@@ -47,7 +47,7 @@ public:
     tolua_property__get_set Font* font;
     tolua_property__get_set Material* material;
     tolua_readonly tolua_property__get_set int fontSize;
-    tolua_property__get_set const String& text;
+    tolua_property__get_set String& text;
     tolua_property__get_set HorizontalAlignment textAlignment;
     tolua_property__get_set HorizontalAlignment horizontalAlignment;
     tolua_property__get_set VerticalAlignment verticalAlignment;

+ 4 - 9
Extras/LuaScript/pkgs/UI/UI.pkg

@@ -2,8 +2,6 @@ $#include "UI.h"
 
 class UI : public Object
 {
-public:
-    // Methods:
     void SetCursor(Cursor* cursor);
     void SetFocusElement(UIElement* element);
     bool SetModalElement(UIElement* modalElement, bool enable);
@@ -18,30 +16,27 @@ public:
     
     UIElement* GetRoot() const;
     UIElement* GetRootModalElement() const;
-    
     Cursor* GetCursor() const;
     
     UIElement* GetElementAt(const IntVector2& position, bool enabledOnly = true);
     UIElement* GetElementAt(const IntVector2& position);
-    
     UIElement* GetElementAt(int x, int y, bool enabledOnly = true);
     UIElement* GetElementAt(int x, int y);
     
     UIElement* GetFocusElement() const;
     UIElement* GetFrontElement() const;
-    
     IntVector2 GetCursorPosition() const;
     const String& GetClipBoardText() const;
     bool IsNonFocusedMouseWheel() const;
     bool HasModalElement() const;
     
-    // Properties:
     tolua_readonly tolua_property__get_set UIElement* root;
     tolua_readonly tolua_property__get_set UIElement* rootModalElement;
-    tolua_readonly tolua_property__get_set Cursor* cursor;
+    tolua_property__get_set Cursor* cursor;
     tolua_readonly tolua_property__get_set UIElement* focusElement;
     tolua_readonly tolua_property__get_set UIElement* frontElement;
-    tolua_property__get_set const String& clipBoardText;
+    tolua_readonly tolua_property__get_set IntVector2 cursorPosition;
+    tolua_property__get_set String& clipBoardText;
     tolua_readonly tolua_property__is_set bool nonFocusedMouseWheel;
     tolua_readonly tolua_property__has_set bool modalElement;
-};
+};

+ 12 - 15
Extras/LuaScript/pkgs/UI/UIElement.pkg

@@ -57,8 +57,6 @@ static const unsigned DD_SOURCE_AND_TARGET;
 
 class UIElement : public Serializable
 {
-public:
-    // Methods:
     UIElement(Context* context);
     virtual ~UIElement();
 
@@ -239,16 +237,15 @@ public:
     bool IsElementEventSender() const;
     UIElement* GetElementEventSender() const;
     
-    // Properties:
-    tolua_property__get_set const String& style;
-    tolua_property__get_set const String& name;
-    tolua_property__get_set const IntVector2& position;
-    tolua_property__get_set const IntVector2 size;
+    tolua_property__get_set String& style;
+    tolua_property__get_set String& name;
+    tolua_property__get_set IntVector2& position;
+    tolua_property__get_set IntVector2 size;
     tolua_property__get_set int width;
-    tolua_property__get_set const int height;
-    tolua_property__get_set const IntVector2 minSize;
-    tolua_property__get_set const int minWidth;
-    tolua_property__get_set const int minHeight;
+    tolua_property__get_set int height;
+    tolua_property__get_set IntVector2 minSize;
+    tolua_property__get_set int minWidth;
+    tolua_property__get_set int minHeight;
     tolua_property__get_set IntVector2 maxSize;
     tolua_property__get_set int maxWidth;
     tolua_property__get_set int maxHeight;
@@ -280,18 +277,18 @@ public:
     tolua_property__get_set XMLFile* defaultStyle;
     tolua_property__get_set LayoutMode layoutMode;
     tolua_property__get_set int layoutSpacing;
-    tolua_property__get_set const IntRect& layoutBorder;
+    tolua_property__get_set IntRect& layoutBorder;
     
     tolua_property__get_set int indent;
     tolua_property__get_set int indentSpacing;
     tolua_readonly tolua_property__get_set int indentWidth;
-    tolua_property__get_set const IntVector2& childOffset;
+    tolua_property__get_set IntVector2& childOffset;
     tolua_property__is_set bool elementEventSender;
     tolua_readonly tolua_property__get_set unsigned numChildren;
     tolua_property__get_set UIElement* parent;
     tolua_readonly tolua_property__get_set UIElement* root;
-    tolua_readonly tolua_property__get_set const IntVector2& screenPosition;
-    tolua_readonly tolua_property__get_set const IntRect& combinedScreenRect;
+    tolua_readonly tolua_property__get_set IntVector2& screenPosition;
+    tolua_readonly tolua_property__get_set IntRect combinedScreenRect;
     tolua_readonly tolua_property__get_set float derivedOpacity;
 };
 

+ 4 - 4
Extras/LuaScript/pkgs/UI/Window.pkg

@@ -39,9 +39,9 @@ public:
     // Properties:
     tolua_property__is_set bool movable;
     tolua_property__is_set bool resizable;
-    tolua_property__get_set const IntRect& resizeBorder;
+    tolua_property__get_set IntRect& resizeBorder;
     tolua_property__is_set bool modal;
-    tolua_property__get_set const Color& modalShadeColor;
-    tolua_property__get_set const Color& modalFrameColor;
-    tolua_property__get_set const IntVector2& modalFrameSize;
+    tolua_property__get_set Color& modalShadeColor;
+    tolua_property__get_set Color& modalFrameColor;
+    tolua_property__get_set IntVector2& modalFrameSize;
 };