/* orxonox - the future of 3D-vertical-scrollers Copyright (C) 2004 orx This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ### File Specific: main-programmer: Thomas Fahrni co-programmer: */ #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_AI #include "ai_module.h" #include "debug.h" #include "aabb.h" float AIModule::getRadius(WorldEntity* object) { AABB* aabb = object->getModelAABB(); if( aabb == NULL)return -1; float a = aabb->halfLength[0]; float b = aabb->halfLength[1]; float c = aabb->halfLength[2]; if(a>b){ return (c>a)?c:a; }else{ return (c>b)?c:b; } } void AIModule::getAttributesFrom(AIModule* other) { this->view = other->getView(); this->movement = other->getMovement(); this->npc = other->getNPC(); this->target = other->getTarget(); this->weight = other->getWeight(); this->speedMax = other->getMaxSpeed(); this->accelerationMax = other->getMaxAcceleration(); }