@@ -416,13 +416,10 @@ function HandleMouseButtonDown(eventType, eventData)
decal = result.drawable:GetNode():CreateDecalSet()
decal:SetMaterial(cache:GetMaterial("Materials/UrhoDecal.xml"))
-- Increase max. vertices/indices if the target is skinned
- --[[
- if result.drawable:GetTypeName() == "AnimatedModel")
- {
+ if result.drawable:GetTypeName() == "AnimatedModel" then
decal.maxVertices = 2048
decal.maxIndices = 4096
- }
- --]]
+ end
end
decal:AddDecal(result.drawable, rayHitPos, cameraNode:GetWorldRotation(), 0.5, 1.0, 1.0, Vector2(0, 0), Vector2(1, 1))
@@ -278,7 +278,7 @@ add_subdirectory (ThirdParty/STB)
add_subdirectory (ThirdParty/JO)
# Alternative Lua bindings. Uncomment the following line to enable
-# set (ENABLE_LUA 1)
+set (ENABLE_LUA 1)
if (ENABLE_LUA)
add_definitions (-DENABLE_LUA)
add_subdirectory (ThirdParty/Lua)
@@ -309,7 +309,7 @@ if (NOT USE_OPENGL)
endif ()
# Urho3D extras. Uncomment to enable
-# set (ENABLE_EXTRAS 1)
+set (ENABLE_EXTRAS 1)
if (ENABLE_EXTRAS)
add_subdirectory (Extras/OgreBatchConverter)
add_subdirectory (Extras/CharacterDemo)
@@ -0,0 +1,28 @@
+$#include "Object.h"
+
+class Object : public RefCounted
+{
+public:
+ tolua_outside const char* ObjectGetTypeName @ GetTypeName() const;
+ tolua_outside void ObjectSendEvent @ SendEvent(const char* eventName);
+ tolua_outside void ObjectSendEvent @ SendEvent(const char* eventName, VariantMap& eventData);
+};
+${
+static const char* ObjectGetTypeName(const Object* object)
+ return object->GetTypeName().CString();
+}
+static void ObjectSendEvent(Object* object, const char* eventName)
+ object->SendEvent(StringHash(eventName));
+static void ObjectSendEvent(Object* object, const char* eventName, VariantMap& eventData)
+ object->SendEvent(StringHash(eventName), eventData);
+$}
@@ -1,6 +1,7 @@
$#define TOLUA_RELEASE
$pfile "Core/Context.pkg"
+$pfile "Core/Object.pkg"
$pfile "Core/ProcessUtils.pkg"
$pfile "Core/StringUtils.pkg"
$pfile "Core/Variant.pkg"
@@ -1,7 +1,7 @@
$#include "Component.h"
/// Base class for components. Components can be created to scene nodes.
-class Component
+class Component : public Serializable
{
public:
/// Set enabled/disabled state.
@@ -0,0 +1,6 @@
+$#include "Serializable.h"
+class Serializable : public Object
@@ -3,6 +3,7 @@ $#define TOLUA_RELEASE
$pfile "Scene/Component.pkg"
$pfile "Scene/Node.pkg"
$pfile "Scene/Scene.pkg"
+$pfile "Scene/Serializable.pkg"
$using namespace Urho3D;
$#pragma warning(disable:4800)