Changeset 2374 for code/branches/physics/src/orxonox/objects/worldentities/collisionshapes/CollisionShape.h
- Timestamp:
- Dec 10, 2008, 1:38:17 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/physics/src/orxonox/objects/worldentities/collisionshapes/CollisionShape.h
r2306 r2374 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "objects/worldentities/StaticEntity.h" 34 #include "util/Math.h" 35 #include "core/BaseObject.h" 35 36 36 37 namespace orxonox 37 38 { 38 class _OrxonoxExport CollisionShape : public StaticEntity39 class _OrxonoxExport CollisionShape : public BaseObject, public network::Synchronisable 39 40 { 40 41 public: … … 43 44 44 45 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 46 void registerVariables(); 45 47 46 btCollisionShape* getCollisionShape() const { return this->collisionShape_; } 47 bool isCompoundShape() const { return this->bIsCompound_; } 48 inline void setPosition(const Vector3& position) 49 { this->position_ = position; } 50 inline const Vector3& getPosition() const 51 { return this->position_; } 48 52 49 bool hasNoTransform() const; 50 virtual btVector3 getTotalScaling(); 53 inline void setOrientation(const Quaternion& orientation) 54 { this->orientation_ = orientation; } 55 inline const Quaternion& getOrientation() const 56 { return this->orientation_; } 57 58 void yaw(const Degree& angle) { this->orientation_ = this->orientation_ * Quaternion(angle, Vector3::UNIT_Y); } 59 void pitch(const Degree& angle) { this->orientation_ = this->orientation_ * Quaternion(angle, Vector3::UNIT_X); } 60 void roll(const Degree& angle) { this->orientation_ = this->orientation_ * Quaternion(angle, Vector3::UNIT_Z); } 61 62 virtual void setScale3D(const Vector3& scale); 63 virtual void setScale(float scale); 64 inline const Vector3& getScale3D(void) const 65 { return this->scale_; } 66 67 virtual inline btCollisionShape* getCollisionShape() const 68 { return this->collisionShape_; } 69 70 bool hasTransform() const; 71 72 inline void setParent(CompoundCollisionShape* shape, unsigned int ID) 73 { this->parent_ = shape; this->parentID_ = ID; } 51 74 52 75 protected: 53 bool bIsCompound_;54 76 btCollisionShape* collisionShape_; 55 77 56 78 private: 57 virtual void setScale3D(const Vector3& scale); 58 virtual void scale3D(const Vector3& scale); 79 void updateParent(); 59 80 60 bool isCollisionTypeLegal(WorldEntity::CollisionType type) const; 81 Vector3 position_; 82 Quaternion orientation_; 83 Vector3 scale_; 84 CompoundCollisionShape* parent_; 85 unsigned int parentID_; 61 86 }; 62 87 }
Note: See TracChangeset
for help on using the changeset viewer.