WIN & MAC OS & UNIX support
parent
7e5c96c123
commit
bb4cf148c4
|
@ -89,7 +89,7 @@ add_executable(shooter
|
||||||
engine/animation/AFunction.h
|
engine/animation/AFunction.h
|
||||||
)
|
)
|
||||||
|
|
||||||
if(${APPLE})
|
if(APPLE OR UNIX)
|
||||||
include_directories(/usr/local/include)
|
include_directories(/usr/local/include)
|
||||||
else()
|
else()
|
||||||
set(SFML_DIR "C:/Libraries/SFML/lib/cmake/SFML")
|
set(SFML_DIR "C:/Libraries/SFML/lib/cmake/SFML")
|
||||||
|
|
|
@ -164,8 +164,6 @@ void Player::update() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
oldVelocity = velocity();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::rotateWeaponsRelativePoint(const Point4D& point4D, const Point4D& v, double val) {
|
void Player::rotateWeaponsRelativePoint(const Point4D& point4D, const Point4D& v, double val) {
|
||||||
|
|
5
Player.h
5
Player.h
|
@ -53,10 +53,7 @@ private:
|
||||||
sf::Sound unSlowMoSound;
|
sf::Sound unSlowMoSound;
|
||||||
sf::Sound fullHealthSound;
|
sf::Sound fullHealthSound;
|
||||||
sf::Sound fullAbilitySound;
|
sf::Sound fullAbilitySound;
|
||||||
|
|
||||||
|
|
||||||
Point4D oldVelocity;
|
|
||||||
|
|
||||||
std::string _name = "im";
|
std::string _name = "im";
|
||||||
|
|
||||||
std::vector<std::shared_ptr<Weapon>> _weapons;
|
std::vector<std::shared_ptr<Weapon>> _weapons;
|
||||||
|
|
|
@ -155,7 +155,7 @@ void Server::generateBonuses() {
|
||||||
|
|
||||||
void Server::updateInfo() {
|
void Server::updateInfo() {
|
||||||
for(auto& bonus : _bonuses) {
|
for(auto& bonus : _bonuses) {
|
||||||
if(!bonus.second.onTheMap && abs(Time::time() - bonus.second.lastTake) > _bonusRechargeTime) {
|
if(!bonus.second.onTheMap && std::abs(Time::time() - bonus.second.lastTake) > _bonusRechargeTime) {
|
||||||
sf::Packet sendPacket;
|
sf::Packet sendPacket;
|
||||||
sendPacket << MsgType::AddBonus << bonus.first << bonus.second.position.x() << bonus.second.position.y() << bonus.second.position.z();
|
sendPacket << MsgType::AddBonus << bonus.first << bonus.second.position.x() << bonus.second.position.y() << bonus.second.position.z();
|
||||||
for (const auto& player : _players)
|
for (const auto& player : _players)
|
||||||
|
|
|
@ -32,7 +32,7 @@ std::map<std::string, double> Weapon::fire(const std::shared_ptr<World>& world,
|
||||||
noAmmoSound.play();
|
noAmmoSound.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_clipAmmo <= 0 || abs(Time::time() - _lastFireTime) < _fireDelay || abs(Time::time() - _lastReloadTime) < _reloadTime)
|
if(_clipAmmo <= 0 || std::abs(Time::time() - _lastFireTime) < _fireDelay || std::abs(Time::time() - _lastReloadTime) < _reloadTime)
|
||||||
return std::map<std::string, double>();
|
return std::map<std::string, double>();
|
||||||
|
|
||||||
_lastFireTime = Time::time();
|
_lastFireTime = Time::time();
|
||||||
|
@ -45,7 +45,7 @@ std::map<std::string, double> Weapon::fire(const std::shared_ptr<World>& world,
|
||||||
}
|
}
|
||||||
|
|
||||||
void Weapon::reload() {
|
void Weapon::reload() {
|
||||||
if (_stockAmmo == 0 || abs(Time::time() - _lastReloadTime) < _reloadTime)
|
if (_stockAmmo == 0 || std::abs(Time::time() - _lastReloadTime) < _reloadTime)
|
||||||
return;
|
return;
|
||||||
if(_clipCapacity - _clipAmmo <= _stockAmmo) {
|
if(_clipCapacity - _clipAmmo <= _stockAmmo) {
|
||||||
_stockAmmo -= _clipCapacity - _clipAmmo;
|
_stockAmmo -= _clipCapacity - _clipAmmo;
|
||||||
|
|
2
Weapon.h
2
Weapon.h
|
@ -27,8 +27,6 @@ protected:
|
||||||
|
|
||||||
double _spreading = 2.0;
|
double _spreading = 2.0;
|
||||||
|
|
||||||
[[maybe_unused]] double _firePower = M_PI/100;
|
|
||||||
|
|
||||||
std::string _name = "Weapon_name";
|
std::string _name = "Weapon_name";
|
||||||
std::map<std::string, std::shared_ptr<Mesh>> _objects;
|
std::map<std::string, std::shared_ptr<Mesh>> _objects;
|
||||||
|
|
||||||
|
|
|
@ -191,7 +191,7 @@ CollisionPoint RigidBody::EPA(const Simplex& simplex, const std::shared_ptr<Rigi
|
||||||
Point4D support = _support(obj, minNormal);
|
Point4D support = _support(obj, minNormal);
|
||||||
double sDistance = minNormal.dot(support);
|
double sDistance = minNormal.dot(support);
|
||||||
|
|
||||||
if (abs(sDistance - minDistance) > 0.0001) {
|
if (std::abs(sDistance - minDistance) > 0.0001) {
|
||||||
minDistance = INFINITY;
|
minDistance = INFINITY;
|
||||||
std::vector<std::pair<size_t, size_t>> uniqueEdges;
|
std::vector<std::pair<size_t, size_t>> uniqueEdges;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue