| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | /* |
|---|
| 4 | orxonox - the future of 3D-vertical-scrollers |
|---|
| 5 | |
|---|
| 6 | Copyright (C) 2004 orx |
|---|
| 7 | |
|---|
| 8 | This program is free software; you can redistribute it and/or modify |
|---|
| 9 | it under the terms of the GNU General Public License as published by |
|---|
| 10 | the Free Software Foundation; either version 2, or (at your option) |
|---|
| 11 | any later version. |
|---|
| 12 | |
|---|
| 13 | ### File Specific: |
|---|
| 14 | main-programmer: Thomas Fahrni |
|---|
| 15 | co-programmer: |
|---|
| 16 | */ |
|---|
| 17 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_AI |
|---|
| 18 | #include "ai_module.h" |
|---|
| 19 | #include "debug.h" |
|---|
| 20 | #include "aabb.h" |
|---|
| 21 | |
|---|
| 22 | float AIModule::getRadius(WorldEntity* object) |
|---|
| 23 | { |
|---|
| 24 | AABB* aabb = object->getModelAABB(); |
|---|
| 25 | if( aabb == NULL)return -1; |
|---|
| 26 | |
|---|
| 27 | float a = aabb->halfLength[0]; |
|---|
| 28 | float b = aabb->halfLength[1]; |
|---|
| 29 | float c = aabb->halfLength[2]; |
|---|
| 30 | |
|---|
| 31 | if(a>b){ |
|---|
| 32 | return (c>a)?c:a; |
|---|
| 33 | }else{ |
|---|
| 34 | return (c>b)?c:b; |
|---|
| 35 | } |
|---|
| 36 | } |
|---|
| 37 | |
|---|
| 38 | void AIModule::getAttributesFrom(AIModule* other) |
|---|
| 39 | { |
|---|
| 40 | this->view = other->getView(); |
|---|
| 41 | this->movement = other->getMovement(); |
|---|
| 42 | this->npc = other->getNPC(); |
|---|
| 43 | this->target = other->getTarget(); |
|---|
| 44 | this->weight = other->getWeight(); |
|---|
| 45 | this->maxSpeed = other->getMaxSpeed(); |
|---|
| 46 | this->attackDistance = other->getAttackDistance(); |
|---|
| 47 | this->accelerationMax = other->getMaxAcceleration(); |
|---|
| 48 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.