-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Physics can now be modified per-dimension.
- Loading branch information
Showing
9 changed files
with
150 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
#include "DimensionPhysics.hpp" | ||
#include "NetworkUtils.hpp" | ||
|
||
void DimensionPhysics::serialize(sf::Packet &packet) const { | ||
packet << gravity << jumpSpeed << jumpAntigravity << glideGravity << horizontalSprintMod << | ||
verticalSprintMod << moveSpeed << airSpeedMod << flySpeed << sneakVerticalSpeed << | ||
sneakHorizontalMod << isSneakAlwaysMod; | ||
} | ||
|
||
void DimensionPhysics::deserialize(sf::Packet &packet) { | ||
packet >> gravity >> jumpSpeed >> jumpAntigravity >> glideGravity >> horizontalSprintMod >> | ||
verticalSprintMod >> moveSpeed >> airSpeedMod >> flySpeed >> sneakVerticalSpeed >> | ||
sneakHorizontalMod >> isSneakAlwaysMod; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
#include <gk/core/ISerializable.hpp> | ||
|
||
struct DimensionPhysics : public gk::ISerializable { | ||
void serialize(sf::Packet &packet) const override; | ||
void deserialize(sf::Packet &packet) override; | ||
|
||
float gravity = 1.f; | ||
float jumpSpeed = 0.05f; | ||
|
||
float jumpAntigravity = 0.3f; | ||
float glideGravity = 0.04f; | ||
|
||
float horizontalSprintMod = 1.5f; | ||
float verticalSprintMod = 1.5f; | ||
|
||
float moveSpeed = 0.04f; | ||
float airSpeedMod = 0.75f; | ||
|
||
float flySpeed = 0.1f; | ||
float sneakVerticalSpeed = 0.1f; | ||
float sneakHorizontalMod = 0.75f; | ||
|
||
bool isSneakAlwaysMod = false; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters