Fix winding issue
This commit is contained in:
parent
13810c40d6
commit
84bff8a669
|
@ -163,10 +163,16 @@ local function create_collision_quad(mesh, thickness)
|
|||
normal_sum = normal_sum + normal
|
||||
end
|
||||
|
||||
local final_normal = normal_sum:normalized()
|
||||
|
||||
-- make sure the basis is right handed
|
||||
if edge_a_point:cross(edge_b_point):dot(final_normal) < 0 then
|
||||
edge_a_point, edge_b_point = edge_b_point, edge_a_point
|
||||
end
|
||||
|
||||
local edge_a_normalized = edge_a_point:normalized()
|
||||
local edge_b_normalized = edge_b_point:normalized()
|
||||
|
||||
local final_normal = normal_sum:normalized()
|
||||
|
||||
return {
|
||||
corner = corner_point,
|
||||
|
|
|
@ -50,7 +50,7 @@ for _, decor_entry in pairs(sk_scene.nodes_for_type('@decor')) do
|
|||
position,
|
||||
rotation,
|
||||
room_index,
|
||||
'DECOR_TYPE_' .. decor_entry.arguments[1],
|
||||
sk_definition_writer.raw('DECOR_TYPE_' .. decor_entry.arguments[1]),
|
||||
})
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue