mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-19 07:39:19 +02:00
Merge branch 'tmj-dev' into lua
This commit is contained in:
31
vertex.cpp
31
vertex.cpp
@@ -9,6 +9,37 @@ http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "vertex.h"
|
||||
#include "sn_utils.h"
|
||||
|
||||
void
|
||||
world_vertex::serialize( std::ostream &s ) const {
|
||||
|
||||
sn_utils::ls_float64( s, position.x );
|
||||
sn_utils::ls_float64( s, position.y );
|
||||
sn_utils::ls_float64( s, position.z );
|
||||
|
||||
sn_utils::ls_float32( s, normal.x );
|
||||
sn_utils::ls_float32( s, normal.y );
|
||||
sn_utils::ls_float32( s, normal.z );
|
||||
|
||||
sn_utils::ls_float32( s, texture.x );
|
||||
sn_utils::ls_float32( s, texture.y );
|
||||
}
|
||||
|
||||
void
|
||||
world_vertex::deserialize( std::istream &s ) {
|
||||
|
||||
position.x = sn_utils::ld_float64( s );
|
||||
position.y = sn_utils::ld_float64( s );
|
||||
position.z = sn_utils::ld_float64( s );
|
||||
|
||||
normal.x = sn_utils::ld_float32( s );
|
||||
normal.y = sn_utils::ld_float32( s );
|
||||
normal.z = sn_utils::ld_float32( s );
|
||||
|
||||
texture.x = sn_utils::ld_float32( s );
|
||||
texture.y = sn_utils::ld_float32( s );
|
||||
}
|
||||
|
||||
template <>
|
||||
world_vertex &
|
||||
|
||||
Reference in New Issue
Block a user