mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Merge branch 'tmj-dev' into lua
This commit is contained in:
@@ -77,7 +77,11 @@ shape_node::shapenode_data::serialize( std::ostream &Output ) const {
|
||||
// vertex count, followed by vertex data
|
||||
sn_utils::ls_uint32( Output, vertices.size() );
|
||||
for( auto const &vertex : vertices ) {
|
||||
vertex.serialize( Output );
|
||||
basic_vertex(
|
||||
glm::vec3{ vertex.position - origin },
|
||||
vertex.normal,
|
||||
vertex.texture )
|
||||
.serialize( Output );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,8 +106,12 @@ shape_node::shapenode_data::deserialize( std::istream &Input ) {
|
||||
// NOTE: geometry handle is acquired during geometry creation
|
||||
// vertex data
|
||||
vertices.resize( sn_utils::ld_uint32( Input ) );
|
||||
basic_vertex localvertex;
|
||||
for( auto &vertex : vertices ) {
|
||||
vertex.deserialize( Input );
|
||||
localvertex.deserialize( Input );
|
||||
vertex.position = origin + glm::dvec3{ localvertex.position };
|
||||
vertex.normal = localvertex.normal;
|
||||
vertex.texture = localvertex.texture;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -453,7 +461,11 @@ lines_node::linesnode_data::serialize( std::ostream &Output ) const {
|
||||
// vertex count, followed by vertex data
|
||||
sn_utils::ls_uint32( Output, vertices.size() );
|
||||
for( auto const &vertex : vertices ) {
|
||||
vertex.serialize( Output );
|
||||
basic_vertex(
|
||||
glm::vec3{ vertex.position - origin },
|
||||
vertex.normal,
|
||||
vertex.texture )
|
||||
.serialize( Output );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -474,8 +486,12 @@ lines_node::linesnode_data::deserialize( std::istream &Input ) {
|
||||
// NOTE: geometry handle is acquired during geometry creation
|
||||
// vertex data
|
||||
vertices.resize( sn_utils::ld_uint32( Input ) );
|
||||
basic_vertex localvertex;
|
||||
for( auto &vertex : vertices ) {
|
||||
vertex.deserialize( Input );
|
||||
localvertex.deserialize( Input );
|
||||
vertex.position = origin + glm::dvec3{ localvertex.position };
|
||||
vertex.normal = localvertex.normal;
|
||||
vertex.texture = localvertex.texture;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user