Fixed right weapon
This commit is contained in:
+2
-1
@@ -126,7 +126,8 @@ void CrystalPoint::update()
|
|||||||
if (rightControllerJoystick->x > 0.3 || rightControllerJoystick->x < -0.3) {
|
if (rightControllerJoystick->x > 0.3 || rightControllerJoystick->x < -0.3) {
|
||||||
player->rotation.y += rightcontroller->joystick.x/2;
|
player->rotation.y += rightcontroller->joystick.x/2;
|
||||||
}
|
}
|
||||||
}
|
player->rightWeapon->rotateWeapon(Vec3f(rightcontroller->ypr.y + 140, 0, -rightcontroller->ypr.z));
|
||||||
|
}
|
||||||
|
|
||||||
if (player->rotation.x > 90)
|
if (player->rotation.x > 90)
|
||||||
player->rotation.x = 90;
|
player->rotation.x = 90;
|
||||||
|
|||||||
+3
-1
@@ -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 = 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));
|
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));
|
rightWeapon->rotateWeapon(Vec3f(150, 0, 60));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,6 +49,7 @@ void Player::setCamera()
|
|||||||
glTranslatef(-position.x, -position.y, -position.z);
|
glTranslatef(-position.x, -position.y, -position.z);
|
||||||
|
|
||||||
leftWeapon->rotate(rotation);
|
leftWeapon->rotate(rotation);
|
||||||
|
rightWeapon->rotate(rotation);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,6 +64,7 @@ void Player::setPosition(float angle, float fac, bool height)
|
|||||||
}
|
}
|
||||||
|
|
||||||
leftWeapon->move(position);
|
leftWeapon->move(position);
|
||||||
|
rightWeapon->move(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::draw() {
|
void Player::draw() {
|
||||||
|
|||||||
Reference in New Issue
Block a user