enemy collide logic in enemy and out of world

This commit is contained in:
Remco
2016-06-03 13:51:54 +02:00
parent 527394f635
commit b827885f40
3 changed files with 11 additions and 9 deletions
+7 -2
View File
@@ -59,9 +59,14 @@ void Enemy::inEyeSight(Vec3f & TargetPosition)
hasTarget = false;
}
bool Enemy::hasCollison(Vec3f &)
void Enemy::collide(const Entity * entity)
{
Vec3f difference = position - entity->position; //zou misschien omgedraait moeten worden
difference.y = 0;
difference.Normalize();
difference = difference * (entity->model->radius + 0.01f);
position.x = difference.x + entity->position.x;
position.z = difference.z + entity->position.z;
}
void Enemy::update(float delta)