Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5026 in orxonox.OLD


Ignore:
Timestamp:
Aug 15, 2005, 8:30:28 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: changed and some missunderstandings in the BoundingVolume Class Interface and simplified them

Location:
orxonox/trunk/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/collision_detection/bv_tree.h

    r4836 r5026  
    1616class BVTreeNode;
    1717class PNode;
     18class WorldEntity;
    1819
    1920typedef enum DrawMode
     
    4243
    4344  virtual void collideWith(BVTree* tree, PNode* nodeA, PNode* nodeB) = NULL;
     45  virtual void collideWith(WorldEntity* entity1, WorldEntity* entity2) = NULL;
    4446
    4547  virtual void drawBV(int depth, int drawMode) const = NULL;
  • orxonox/trunk/src/lib/collision_detection/cd_engine.cc

    r4968 r5026  
    6666void CDEngine::checkCollisions()
    6767{
    68   //this->checkCollisionObjects();
     68  this->checkCollisionObjects();
    6969  this->checkCollisionGround();
    7070}
     
    8686    {
    8787      PRINTF(3)("checking object %s against %s\n", entity1->getName(), entity2->getName());
    88       entity1->collideWith(entity2);
     88      //entity1->getOBBTree()->collideWith(entity1, entity2);
    8989      entity2 = iterator2->nextElement();
    9090    }
  • orxonox/trunk/src/lib/collision_detection/cd_engine.h

    r4924 r5026  
    1111#include "collision_defs.h"
    1212#include "abstract_model.h"
     13
    1314
    1415template<class T> class tList;
     
    3435//! The class representing the collision detection system of orxonox
    3536class CDEngine : public BaseObject {
     37
     38  friend class WorldEntity;
    3639
    3740 public:
  • orxonox/trunk/src/lib/collision_detection/obb_tree.cc

    r4836 r5026  
    2222#include "compiler.h"
    2323#include "material.h"
     24#include "world_entity.h"
    2425#include "p_node.h"
    2526
     
    109110
    110111
     112void OBBTree::collideWith(WorldEntity* entity1, WorldEntity* entity2)
     113{
     114  this->rootNode->collideWith(((OBBTree*)entity2->getOBBTree())->getRootNode(), (PNode*)entity1, (PNode*)entity2);
     115}
     116
     117
     118/**
     119 * this collides two bvtrees together. the trees are attached to pnodes Objects A and B
     120 * @param tree: the other tree to collide with (Object B)
     121 * @param nodeA: PNode of object A
     122 * @param nodeB: Pnode of object B
     123 */
    111124void OBBTree::collideWith(BVTree* tree, PNode* nodeA, PNode* nodeB)
    112125{
  • orxonox/trunk/src/lib/collision_detection/obb_tree.h

    r4836 r5026  
    2929
    3030    virtual void collideWith(BVTree* tree, PNode* nodeA, PNode* nodeB);
     31    virtual void collideWith(WorldEntity* entity1, WorldEntity* entity2);
    3132
    3233    virtual void drawBV(int depth, int drawMode) const;
  • orxonox/trunk/src/world_entities/world_entity.cc

    r4998 r5026  
    101101 * Implement behaviour like damage application or other miscellaneous collision stuff in this function
    102102*/
    103 void WorldEntity::collideWith(WorldEntity* entity)
     103void WorldEntity::collidesWith(WorldEntity* entity)
    104104{
    105   this->obbTree->collideWith(entity->obbTree, (PNode*)this, (PNode*)entity);
     105  //this->obbTree->collideWith(entity->obbTree, (PNode*)this, (PNode*)entity);
    106106}
    107107
  • orxonox/trunk/src/world_entities/world_entity.h

    r4885 r5026  
    4040  /** @returns true if the entity is visible, false otherwise */
    4141  bool isVisible() const { return this->bVisible; };
     42
    4243  void setCharacterAttributes(CharacterAttributes* charAttr);
    4344  CharacterAttributes* getCharacterAttributes();
     45
     46  /** @returns a reference to the obb tree of this worldentity */
     47  BVTree* getOBBTree() { return this->obbTree; }
    4448
    4549  virtual void postSpawn ();
     
    4751
    4852  virtual void hit (WorldEntity* weapon, Vector* loc);
    49   virtual void collideWith (WorldEntity* entity);
     53  virtual void collidesWith (WorldEntity* entity);
    5054
    5155  /** @returns the Count of Faces on this WorldEntity */
Note: See TracChangeset for help on using the changeset viewer.