- Timestamp:
- Dec 13, 2008, 4:14:36 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/physics/src/orxonox/objects/collisionshapes/CollisionShape.h
r2377 r2423 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "LinearMath/btVector3.h" 34 35 #include "util/Math.h" 35 36 #include "core/BaseObject.h" … … 48 49 49 50 inline void setPosition(const Vector3& position) 50 { this->position_ = position; }51 { this->position_ = position; this->updateParent(); } 51 52 inline const Vector3& getPosition() const 52 53 { return this->position_; } 53 54 54 55 inline void setOrientation(const Quaternion& orientation) 55 { this->orientation_ = orientation; }56 { this->orientation_ = orientation; this->updateParent(); } 56 57 inline const Quaternion& getOrientation() const 57 58 { return this->orientation_; } 58 59 59 void yaw(const Degree& angle) { this-> orientation_ = this->orientation_ * Quaternion(angle, Vector3::UNIT_Y); }60 void pitch(const Degree& angle) { this-> orientation_ = this->orientation_ * Quaternion(angle, Vector3::UNIT_X); }61 void roll(const Degree& angle) { this-> orientation_ = this->orientation_ * Quaternion(angle, Vector3::UNIT_Z); }60 void yaw(const Degree& angle) { this->setOrientation(this->orientation_ * Quaternion(angle, Vector3::UNIT_Y)); } 61 void pitch(const Degree& angle) { this->setOrientation(this->orientation_ * Quaternion(angle, Vector3::UNIT_X)); } 62 void roll(const Degree& angle) { this->setOrientation(this->orientation_ * Quaternion(angle, Vector3::UNIT_Z)); } 62 63 63 64 virtual void setScale3D(const Vector3& scale); … … 66 67 { return this->scale_; } 67 68 68 virtual inline btCollisionShape* getCollisionShape() const 69 btVector3 getLocalInertia(float mass) const; 70 71 inline btCollisionShape* getCollisionShape() const 69 72 { return this->collisionShape_; } 70 73 … … 75 78 76 79 protected: 77 btCollisionShape* collisionShape_; 80 virtual void updateParent(); 81 82 btCollisionShape* collisionShape_; 83 CompoundCollisionShape* parent_; 78 84 79 85 private: 80 void updateParent();86 void parentChanged(); 81 87 82 Vector3 position_; 83 Quaternion orientation_; 84 Vector3 scale_; 85 CompoundCollisionShape* parent_; 86 unsigned int parentID_; 88 Vector3 position_; 89 Quaternion orientation_; 90 Vector3 scale_; 91 unsigned int parentID_; 87 92 }; 88 93 }
Note: See TracChangeset
for help on using the changeset viewer.