Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 20, 2006, 1:09:03 AM (18 years ago)
Author:
patrick
Message:

more design, thinner interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/coll_rect/src/world_entities/world_entity.h

    r9892 r9896  
    1212
    1313#include "cr_engine.h"
     14#include "collision_filter.h"
    1415#include "object_manager.h"
    1516#include "glincl.h"
     
    2526namespace OrxSound { class SoundBuffer; class SoundSource; }
    2627namespace OrxGui { class GLGuiWidget; class GLGuiBar; class GLGuiEnergyWidget; };
    27 namespace CoRe { class CollisionHandle; class Collision; }
     28namespace CoRe { class Collision; }
    2829
    2930class BVTree;
     
    7677  inline AABB* getModelAABB() const { return (this->aabbNode)?this->aabbNode->getAABB():NULL;}
    7778
     79  virtual void hit(float damage, WorldEntity* killer);
     80
    7881
    7982  /* --- Collision Reaction Block --- */
    80   void subscribeReaction(CoRe::CREngine::ReactionType type);
    8183  void subscribeReaction(CoRe::CREngine::ReactionType type, const ClassID& target1);
    8284  void subscribeReaction(CoRe::CREngine::ReactionType type, const ClassID& target1, const ClassID& target2);
     
    8486
    8587  void unsubscribeReaction(CoRe::CREngine::ReactionType type);
    86   void unsubscribeReaction();
    87 
    88   bool registerCollision(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB);
    89   bool registerCollision(int type, WorldEntity* entity, WorldEntity* groundEntity, Vector normal, Vector position, bool bInWall = false);
     88  void unsubscribeReactions();
     89
    9090  /** @return true if there is at least on collision reaction subscribed */
    9191  inline bool isReactive() const { return this->bReactive; }
    9292
    93   CoRe::CollisionHandle* getCollisionHandle(CoRe::CREngine::ReactionType type) const { return this->collisionHandles[type]; }
     93  const CoRe::CollisionFilter& getCollisionFilter(CoRe::CREngine::ReactionType type) const { return this->collisionFilter; }
    9494
    9595  /** @returns true if this entity is standing on ground (BSP model) */
     
    9797  /** @param flag: marks if this entity is standing on ground */
    9898  void setOnGround(bool flag) { this->bOnGround = flag; }
    99 
    100   virtual void hit(float damage, WorldEntity* killer);
    10199
    102100  virtual void destroy( WorldEntity* killer );
     
    193191
    194192  /* collision reaction stuff */
    195   CoRe::CollisionHandle*  collisionHandles[CoRe::CREngine::CR_NUMBER];  //!< the list of the collision reactions
    196   bool                    bReactive;                              //!< true if there is at least one collision reaction subscibed
     193  CoRe::CollisionFilter   collisionFilter;                 //!< filter for collision event filtering (not every entity listens to all collisions)
     194  bool                    bReactive;                       //!< true if there is at least one collision reaction subscibed
    197195
    198196
Note: See TracChangeset for help on using the changeset viewer.