From 5d5ddec1ac464c0d78e2ec4fe1c2a2d819f3ee2f Mon Sep 17 00:00:00 2001 From: Glenn Fiedler Date: Sat, 30 Dec 2023 18:49:18 -0500 Subject: [PATCH] Update example.cpp Signed-off-by: Glenn Fiedler --- example.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/example.cpp b/example.cpp index 16e7ffd..afe9f54 100644 --- a/example.cpp +++ b/example.cpp @@ -63,21 +63,17 @@ struct RigidBody { serialize_object( stream, position ); serialize_object( stream, orientation ); - serialize_bool( stream, atRest ); - if ( !atRest ) { serialize_object( stream, linearVelocity ); serialize_object( stream, angularVelocity ); - } - - if ( Stream::IsReading && atRest ) + } + else if ( Stream::IsReading ) { linearVelocity.x = linearVelocity.y = linearVelocity.z = 0.0; angularVelocity.x = angularVelocity.y = angularVelocity.z = 0.0; - } - + } return true; } };