Skip to content

Commit

Permalink
Update example.cpp
Browse files Browse the repository at this point in the history
Signed-off-by: Glenn Fiedler <glenn@networknext.com>
  • Loading branch information
gafferongames committed Dec 30, 2023
1 parent d1d7a9f commit 5d5ddec
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
};
Expand Down

0 comments on commit 5d5ddec

Please sign in to comment.