updated sol2 and lua

This commit is contained in:
Hartmut Seichter 2021-01-31 21:29:56 +01:00
parent 2b71d39a9b
commit 939195b851
678 changed files with 335 additions and 59269 deletions

View file

@ -24,8 +24,8 @@ add_library(pwbinding
target_include_directories(
pwbinding
PRIVATE
${CMAKE_SOURCE_DIR}/src/deps/lua-5.3.5/src
${CMAKE_SOURCE_DIR}/src/deps/sol2-3.2.2/single/include
${CMAKE_SOURCE_DIR}/src/deps/lua-5.4.2/src
${CMAKE_SOURCE_DIR}/src/deps/sol2-3.2.3/single/include
PUBLIC
include
)

View file

@ -21,7 +21,6 @@ template <> struct is_automagical<pw::vector2> : std::false_type {};
template <> struct is_automagical<pw::vector4> : std::false_type {};
template <> struct is_automagical<pw::quaternion> : std::false_type {};
template <> struct is_automagical<pw::rectangle> : std::false_type {};
template <> struct is_automagical<pw::geometry> : std::false_type {};
}
namespace pw {
@ -67,11 +66,11 @@ void register_core_function(sol::state& lua,sol::table& ns)
ns.new_usertype<vector2>("vector2"
,sol::call_constructor,sol::constructors<vector2(),vector2(Scalar,Scalar)>()
,"x", sol::property(sol::resolve<const vector2::value_type&() const>(&vector2::x), [](vector2& v,vector2::value_type val){ v.x() = val;})
,"y", sol::property(sol::resolve<const vector2::value_type&() const>(&vector2::y), [](vector2& v,vector2::value_type val){ v.y() = val;})
,"y", sol::property(sol::resolve<const vector2::value_type&() const>(&vector2::y), [](vector2& v,vector2::value_type val){ v.y() = val;})
);
ns.new_usertype<vector3>("vector3"
,sol::call_constructor,sol::constructors<vector3(),vector3(Scalar,Scalar,Scalar)>()
,sol::constructors<vector3(),vector3(Scalar,Scalar,Scalar)>()
,"x", sol::property(sol::resolve<const vector3::value_type&() const>(&vector3::x), [](vector3& v,vector3::value_type val){ v.x() = val;})
,"y", sol::property(sol::resolve<const vector3::value_type&() const>(&vector3::y), [](vector3& v,vector3::value_type val){ v.y() = val;})
,"z", sol::property(sol::resolve<const vector3::value_type&() const>(&vector3::z), [](vector3& v,vector3::value_type val){ v.z() = val;})
@ -161,7 +160,8 @@ void register_core_function(sol::state& lua,sol::table& ns)
ns.new_usertype<geometry>("geometry"
,sol::constructors<geometry(),geometry(geometry::primitive_topology_type,vector3_array,geometry::indices_t)>()
,"primitive_topology", sol::property(&geometry::primitive_topology,&geometry::set_primitive_topology)
,"vertices", sol::property(&geometry::ref_vertices,&geometry::ref_vertices)
// ,"vertices", sol::property(&geometry::ref_vertices,&geometry::ref_vertices)
,"vertices", sol::property(&geometry::vertices,&geometry::set_vertices)
,"indices", sol::property(&geometry::ref_indices,&geometry::ref_indices)
// ,"texture_coordinates", sol::property(&geometry::ref_texture_coordinates,&geometry::ref_texture_coordinates)
,"compute_normals", &geometry::compute_normals