Skip to content

Commit 7b80333

Browse files
committed
gun stuff
1 parent 7992f23 commit 7b80333

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

Engine/Game/Gun.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ void Gun::Update(float deltaTime, bool isReloading, bool aiming) {
2828
}
2929
else {
3030
gun->setPosition(weaponOffSet + (direction * -kickbackOffset * deltaTime));
31-
//gun->SetRotationX(0);
32-
33-
static glm::vec3 swayPosition;
3431

3532
//TokyoSpliffs code
3633
float xSwayTarget = 0.0f;
@@ -50,11 +47,9 @@ void Gun::Update(float deltaTime, bool isReloading, bool aiming) {
5047
ySwayTarget = -0.5f;
5148
}
5249

53-
float speed = 0.5f;
54-
50+
float speed = 2.0f;
5551
swayPosition.x = finlerpTo(swayPosition.x, xSwayTarget, 1/60, speed);
5652
swayPosition.y = finlerpTo(swayPosition.y, ySwayTarget, 1/60, speed);
57-
5853
gun->addPosition(swayPosition);
5954
}
6055

@@ -187,6 +182,8 @@ GunPickUp::GunPickUp(std::string GunName, glm::vec3 position, glm::vec3 force) {
187182
AssetManager::GetGameObject(index)->GetRigidBody()->applyCentralImpulse(glmToBtVector3(force));
188183
}
189184

185+
glm::vec3 Gun::swayPosition = glm::vec3(0);
186+
190187
void GunPickUp::Update() {
191188

192189
}

Engine/Game/Gun.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ enum GunType
1616

1717
struct Gun
1818
{
19+
20+
static glm::vec3 swayPosition;
21+
1922
std::string name;
2023
int ammo;
2124
double firerate;

0 commit comments

Comments
 (0)