- Timestamp:
- Dec 1, 2008, 11:09:43 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/physics/src/orxonox/objects/worldentities/WorldEntity.h
r2300 r2303 36 36 37 37 #include "LinearMath/btMotionState.h" 38 #include "BulletDynamics/Dynamics/btRigidBody.h"39 38 40 39 #include "network/Synchronisable.h" … … 108 107 { this->setDirection(Vector3(x, y, z), relativeTo, localDirectionVector); } 109 108 110 inline void setScale3D(const Vector3& scale) 111 { this->node_->setScale(scale); } 109 void setScale3D(const Vector3& scale); 112 110 inline void setScale3D(float x, float y, float z) 113 { this-> node_->setScale(x, y, z); }111 { this->setScale3D(Vector3(x, y, z)); } 114 112 inline const Vector3& getScale3D(void) const 115 113 { return this->node_->getScale(); } 116 114 117 inlinevoid setScale(float scale)118 { this-> node_->setScale(scale, scale, scale); }115 void setScale(float scale) 116 { this->setScale3D(scale, scale, scale); } 119 117 inline float getScale() const 120 118 { Vector3 scale = this->getScale3D(); return (scale.x == scale.y && scale.x == scale.z) ? scale.x : 1; } 121 119 122 inline void scale3D(const Vector3& scale) 123 { this->node_->scale(scale); } 120 void scale3D(const Vector3& scale); 124 121 inline void scale3D(float x, float y, float z) 125 { this-> node_->scale(x, y, z); }122 { this->scale3D(Vector3(x, y, z)); } 126 123 inline void scale(float scale) 127 { this-> node_->scale(scale, scale, scale); }124 { this->scale3D(scale, scale, scale); } 128 125 129 126 void attach(WorldEntity* object); 127 // void attachAsdf(BlinkingBillboard* object); 130 128 void detach(WorldEntity* object); 131 129 WorldEntity* getAttachedObject(unsigned int index) const; 130 // BlinkingBillboard* getAttachedAsdfObject(unsigned int index) const; 132 131 inline const std::set<WorldEntity*>& getAttachedObjects() const 133 132 { return this->children_; } … … 195 194 196 195 void setMass(float mass); 197 float getMass() const; 198 199 void setCollisionRadius(float radius); 200 float getCollisionRadius() const; 196 inline float getMass() const 197 { return this->mass_; } 198 199 void attachCollisionShape(CollisionShape* shape); 200 CollisionShape* getAttachedCollisionShape(unsigned int index) const; 201 202 CollisionShape* getCollisionShape() { return this->collisionShape_; } 203 btRigidBody* getPhysicalBody() { return this->physicalBody_; } 201 204 202 205 protected: … … 211 214 212 215 private: 213 CollisionType collisionType_; 214 216 void mergeCollisionShape(CollisionShape* shape); 217 218 CollisionType collisionType_; 219 std::vector<CollisionShape*> attachedShapes_; 220 CollisionShape* collisionShape_; 221 btScalar mass_; 215 222 }; 216 223 }
Note: See TracChangeset
for help on using the changeset viewer.