Changeset 8824 in orxonox.OLD for branches/single_player_map
- Timestamp:
- Jun 27, 2006, 2:31:12 PM (19 years ago)
- Location:
- branches/single_player_map/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/single_player_map/src/lib/collision_reaction/cr_physics_ground_walk.cc
r8812 r8824 25 25 26 26 #include <vector> 27 28 #include "debug.h" 27 29 28 30 #include "aabb.h" … … 67 69 AABB* box = collision->getEntityB()->getModelAABB(); 68 70 71 if( box != NULL) 72 { 73 PRINTF(0)("collpos:\n"); 74 Vector collPos = ce->getCollisionPosition(); 75 collPos.debug(); 69 76 77 } 70 78 71 if(box!=NULL) 79 #if 0 80 if( box != NULL) 72 81 height = ( ce->getCollisionPosition() - collision->getEntityB()->getAbsCoor() )*(-1.0f) ; 73 82 else 74 83 height = ce->getCollisionPosition() - collision->getEntityB()->getAbsCoor() ; 75 84 76 if(box!=NULL) { 85 86 if( box != NULL) { 77 87 78 88 … … 124 134 125 135 }// if(box!= NULL) 136 #endif 126 137 /* 127 138 PRINTF(0)("Collision with Ground: \n"); -
branches/single_player_map/src/lib/math/quaternion.h
r8802 r8824 51 51 inline bool operator== (const Quaternion& q) const { return (unlikely(this->v==q.v&&this->w==q.w))?true:false; }; 52 52 /** @param q: the Quaternion to compare with this one. @returns true if the Quaternions are the same, false otherwise */ 53 inline bool operator!= (const Quaternion& q) const { return (unlikely(this->v!=q.v &&this->w!=q.w))?true:false; };53 inline bool operator!= (const Quaternion& q) const { return (unlikely(this->v!=q.v||this->w!=q.w))?true:false; }; 54 54 /** @param f: a real value @return a Quaternion containing the quotient */ 55 55 inline Quaternion operator/ (const float& f) const { return (unlikely(f==0.0)) ? Quaternion() : Quaternion(this->v/f, this->w/f); }; -
branches/single_player_map/src/lib/math/vector.h
r8490 r8824 47 47 inline bool operator== (const Vector& v) const { return (this->x==v.x&&this->y==v.y&&this->z==v.z)?true:false; }; 48 48 /** @param v: the Vecor to compare with this one @returns true, if the Vecors are different, false otherwise */ 49 inline bool operator!= (const Vector& v) const { return (this->x!=v.x &&this->y!=v.y&&this->z!=v.z)?true:false; };49 inline bool operator!= (const Vector& v) const { return (this->x!=v.x||this->y!=v.y||this->z!=v.z)?true:false; }; 50 50 /** @param index The index of the "array" @returns the x/y/z coordinate */ 51 51 inline float operator[] (float index) const {if( index == 0) return this->x; if( index == 1) return this->y; if( index == 2) return this->z; } -
branches/single_player_map/src/world_entities/npcs/generic_npc.cc
r8823 r8824 401 401 float GenericNPC::lookAt(WorldEntity* worldEntity) 402 402 {} 403 404 405 /** 406 * turns to a given direction 407 */ 408 bool GenericNPC::turnTo(float qu, float qx, float qy, float qz) 409 { 410 Quaternion destDir = Quaternion(Vector(qx, qy, qz), qu); 411 412 // check if this is the current goal 413 if( this->destDir != destDir) 414 { 415 this->destCoor = destCoor; 416 417 float time = 5.0f; 418 419 if( this->currentAnim != NULL) 420 delete this->currentAnim; 421 422 this->currentAnim = new Animation3D(this); 423 this->currentAnim->addKeyFrame(this->getAbsCoor(), this->getAbsDir(), time, ANIM_LINEAR, ANIM_LINEAR); 424 this->currentAnim->addKeyFrame(this->getAbsCoor(), this->destDir, time, ANIM_LINEAR, ANIM_LINEAR); 425 426 this->currentAnim->setInfinity(ANIM_INF_CONSTANT); 427 this->currentAnim->play(); 428 429 this->setAnimation(CROUCH_STAND, MD2_ANIM_LOOP); 430 } 431 432 // calculate the distance 433 Vector distance = this->getAbsCoor() - this->destCoor; 434 return distance.len(); 435 } 436 403 437 404 438 -
branches/single_player_map/src/world_entities/npcs/generic_npc.h
r8823 r8824 63 63 /* some oriantation functions */ 64 64 float lookAt(WorldEntity* worldEntity); 65 bool turnTo(float qu, float qx, float qy, float qz); 65 66 66 67 /* talking funcitons*/
Note: See TracChangeset
for help on using the changeset viewer.