- Timestamp:
- Dec 2, 2008, 4:59:36 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/physics/src/orxonox/objects/worldentities/WorldEntity.h
r2304 r2306 108 108 { this->setDirection(Vector3(x, y, z), relativeTo, localDirectionVector); } 109 109 110 v oid setScale3D(const Vector3& scale);110 virtual void setScale3D(const Vector3& scale); 111 111 inline void setScale3D(float x, float y, float z) 112 112 { this->setScale3D(Vector3(x, y, z)); } … … 119 119 { Vector3 scale = this->getScale3D(); return (scale.x == scale.y && scale.x == scale.z) ? scale.x : 1; } 120 120 121 v oid scale3D(const Vector3& scale);121 virtual void scale3D(const Vector3& scale); 122 122 inline void scale3D(float x, float y, float z) 123 123 { this->scale3D(Vector3(x, y, z)); } … … 182 182 }; 183 183 184 bool hasPhysics() const { return getCollisionType() != None; } 185 186 CollisionType getCollisionType() const { return this->collisionType_; } 187 void setCollisionType(CollisionType type); 188 189 void setCollisionTypeStr(const std::string& type); 190 std::string getCollisionTypeStr() const; 191 184 bool hasPhysics() const { return getCollisionType() != None ; } 192 185 bool isStatic() const { return getCollisionType() == Static ; } 193 186 bool isKinematic() const { return getCollisionType() == Kinematic; } 194 187 bool isDynamic() const { return getCollisionType() == Dynamic ; } 195 188 189 inline CollisionType getCollisionType() const 190 { return this->collisionType_; } 191 void setCollisionType(CollisionType type); 192 193 void setCollisionTypeStr(const std::string& type); 194 std::string getCollisionTypeStr() const; 195 196 196 void setMass(float mass); 197 197 inline float getMass() const … … 201 201 CollisionShape* getAttachedCollisionShape(unsigned int index) const; 202 202 203 CollisionShape* getCollisionShape() { return this->collisionShape_; } 204 btRigidBody* getPhysicalBody() { return this->physicalBody_; } 203 inline CollisionShape* getCollisionShape() 204 { return this->collisionShape_; } 205 inline btRigidBody* getPhysicalBody() 206 { return this->physicalBody_; } 205 207 206 208 protected: 207 //virtual btCollisionShape* getCollisionShape() = 0;208 //virtual void attachPhysicalObject(WorldEntity* object);209 210 209 virtual bool isCollisionTypeLegal(CollisionType type) const = 0; 210 211 btRigidBody* physicalBody_; 212 213 private: 214 void updateCollisionType(); 215 void mergeCollisionShape(CollisionShape* shape); 216 void internalSetMassProps(); 217 btVector3 getLocalInertia(btScalar mass) const; 211 218 bool checkPhysics() const; 212 void updateCollisionType();213 214 btRigidBody* physicalBody_;215 216 private:217 void mergeCollisionShape(CollisionShape* shape);218 219 219 220 CollisionType collisionType_; … … 221 222 CollisionShape* collisionShape_; 222 223 btScalar mass_; 224 btScalar childMass_; 223 225 }; 224 226 }
Note: See TracChangeset
for help on using the changeset viewer.