removed many Irrlicht references

This commit is contained in:
devZoGok
2021-10-31 15:13:47 +02:00
parent 0e236a44d6
commit b18b2fe9a8
70 changed files with 1822 additions and 1529 deletions
+16 -14
View File
@@ -1,32 +1,34 @@
#include <util.h>
#include <model.h>
#include "missile.h"
using namespace game::core;
using namespace game::util;
using namespace irr::core;
using namespace irr::scene;
using namespace vb01;
namespace game{
namespace content{
Missile::Missile(Unit *unit, ISceneNode *node, vector3df *target,vector3df pos,vector3df dir, vector3df left, vector3df up,int id,int weaponTypeId,int weaponId) :
Projectile(unit, node, pos, dir, left, up,id,weaponTypeId,weaponId) {
this->target=target;
this->type=(MissileType)weaponId;
this->initTime=getTime();
Missile::Missile(Unit *unit, Node *node, Vector3 *target, Vector3 pos, Vector3 dir, Vector3 left, Vector3 up, int id, int weaponTypeId, int weaponId) :
Projectile(unit, node, pos, dir, left, up, id, weaponTypeId, weaponId) {
this->target = target;
this->type = (MissileType)weaponId;
this->initTime = getTime();
}
void Missile::update() {
Projectile::update();
pos+=dirVec*speed;
pos = pos + dirVec * speed;
node->setPosition(pos);
float angle=getAngleBetween(dirVec,*target-pos);
vector3df axis=dirVec.crossProduct(*target-pos).normalize();
float angle = dirVec.getAngleBetween(*target - pos);
Vector3 axis = dirVec.cross(*target - pos).norm();
if(rotationSpeed/180*PI<angle){
quaternion rotQuat=quaternion().fromAngleAxis(rotationSpeed/180*PI,axis);
orientProjectile(rotQuat*dirVec);
if(rotationSpeed / 180 * PI < angle){
Quaternion rotQuat = Quaternion(rotationSpeed / 180 * PI, axis);
orientProjectile(rotQuat * dirVec);
}
if(!exploded&&getTime()-initTime>selfDistructTime)
if(!exploded && getTime() - initTime > selfDistructTime)
Projectile::explode(nullptr);
}
}