mockup of utility functions
This commit is contained in:
1 parent
d0085e834e
commit
74c684fff8
8 files changed
+105
-5
No files matched your search
@@ -17,6 +17,7 @@ namespace Demo {
|
||||
|
||||
Enemy::Enemy(Engine* engine, const EnemyInfo& t_info) {
|
||||
info = t_info;
|
||||
utility = &engine->renderer.renderer3D.utility;
|
||||
|
||||
mesh = new DynamicMesh(*info.motherMesh);
|
||||
|
||||
@@ -96,6 +97,10 @@ void Enemy::handlePlayerShoot(const PlayerShootAction& shootAction) {
|
||||
|
||||
auto isOnEnemy = ray.intersectBox(bbox.min(), bbox.max());
|
||||
|
||||
utility->drawBBox(bbox);
|
||||
utility->drawLine(ray.origin, ray.direction);
|
||||
utility->drawPoint(*mesh->getPosition());
|
||||
|
||||
if (isOnEnemy) {
|
||||
mesh->setPosition(spawnPoint);
|
||||
TYRA_LOG("Enemy hit!");
|
||||
|
||||
@@ -65,8 +65,8 @@ void GameState::update() {
|
||||
fpsChecker = 0;
|
||||
}
|
||||
|
||||
skybox->update(player->getPosition());
|
||||
player->update(terrain->heightmap);
|
||||
skybox->update(player->getPosition());
|
||||
auto shootAction = player->getShootAction();
|
||||
enemyManager->update(terrain->heightmap, player->getPosition(), shootAction);
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ PlayerShootAction Player::getShootAction() const {
|
||||
action.isShooting = weapon.isShooting;
|
||||
|
||||
if (action.isShooting) {
|
||||
action.ray = Ray(camera.position, camera.lookAt);
|
||||
action.ray = Ray(camera.position, camera.lookAt.getNormalized());
|
||||
}
|
||||
|
||||
return action;
|
||||
|
||||
Reference in new issue
Block a user