Fixed right weapon

This commit is contained in:
jancoow
2016-06-21 11:32:37 +02:00
parent 3f8623d0bf
commit 06a768a3a1
2 changed files with 5 additions and 2 deletions
+2 -1
View File
@@ -126,7 +126,8 @@ void CrystalPoint::update()
if (rightControllerJoystick->x > 0.3 || rightControllerJoystick->x < -0.3) {
player->rotation.y += rightcontroller->joystick.x/2;
}
}
player->rightWeapon->rotateWeapon(Vec3f(rightcontroller->ypr.y + 140, 0, -rightcontroller->ypr.z));
}
if (player->rotation.x > 90)
player->rotation.x = 90;
+3 -1
View File
@@ -16,7 +16,7 @@ Player::Player()
leftWeapon = new Weapon("models/weapons/ZwaardMetTextures/TextureZwaard.obj", 1, position, rotation, Vec3f(4.5, -8, -1), Vec3f(-2.0f, 6.0f, -2.1f), Vec2f(170, 70), Vec2f(20, -80));
leftWeapon->rotateWeapon(Vec3f(150, 0, 60));
rightWeapon = new Weapon("models/weapons/ZwaardMetTextures/TextureZwaard.obj", 1, position, rotation, Vec3f(3, -8, -1), Vec3f(-2.0f, 6.0f, -2.1f), Vec2f(170, 70), Vec2f(20, -80));
rightWeapon = new Weapon("models/weapons/ZwaardMetTextures/TextureZwaard.obj", 1, position, rotation, Vec3f(0.5, -8, -1), Vec3f(-2.0f, 6.0f, -2.1f), Vec2f(170, 70), Vec2f(20, -80));
rightWeapon->rotateWeapon(Vec3f(150, 0, 60));
}
@@ -49,6 +49,7 @@ void Player::setCamera()
glTranslatef(-position.x, -position.y, -position.z);
leftWeapon->rotate(rotation);
rightWeapon->rotate(rotation);
}
@@ -63,6 +64,7 @@ void Player::setPosition(float angle, float fac, bool height)
}
leftWeapon->move(position);
rightWeapon->move(position);
}
void Player::draw() {