- Timestamp:
- Dec 13, 2008, 11:18:44 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/physics/src/orxonox/objects/worldentities/WorldEntity.h
r2426 r2429 141 141 142 142 private: 143 void updateParent();144 145 143 inline void lookAt_xmlport(const Vector3& target) 146 144 { this->lookAt(target); } … … 154 152 { this->roll(angle); } 155 153 154 // network callbacks 155 void parentChanged(); 156 156 inline void scaleChanged() 157 157 { this->setScale3D(this->getScale3D()); } … … 192 192 std::string getCollisionTypeStr() const; 193 193 194 void setMass(float mass); 194 inline void setMass(float mass) 195 { this->mass_ = mass; recalculateMassProps(); } 195 196 inline float getMass() const 196 197 { return this->mass_; } 198 197 199 inline float getTotalMass() const 198 200 { return this->mass_ + this->childrenMass_; } 201 202 inline void setRestitution(float restitution) 203 { this->restitution_ = restitution; resetPhysicsProps(); } 204 inline float getRestitution() const 205 { return this->restitution_; } 206 207 inline void setAngularFactor(float angularFactor) 208 { this->angularFactor_ = angularFactor; resetPhysicsProps(); } 209 inline float getAngularFactor() const 210 { return this->angularFactor_; } 211 212 inline void setLinearDamping(float linearDamping) 213 { this->linearDamping_ = linearDamping; resetPhysicsProps(); } 214 inline float getLinearDamping() const 215 { return this->linearDamping_; } 216 217 inline void setAngularDamping(float angularDamping) 218 { this->angularDamping_ = angularDamping; resetPhysicsProps(); } 219 inline float getAngularDamping() const 220 { return this->angularDamping_; } 221 222 inline void setFriction(float friction) 223 { this->friction_ = friction; resetPhysicsProps(); } 224 inline float getFriction() const 225 { return this->friction_; } 199 226 200 227 void attachCollisionShape(CollisionShape* shape); … … 217 244 private: 218 245 void updateCollisionType(); 219 void recalculatePhysicsProps(); 246 void recalculateMassProps(); 247 void resetPhysicsProps(); 220 248 221 249 // network callbacks 222 250 void collisionTypeChanged(); 223 void massChanged();224 251 void physicsActivityChanged(); 252 inline void massChanged() 253 { this->setMass(this->mass_); } 254 inline void restitutionChanged() 255 { this->setRestitution(this->restitution_); } 256 inline void angularFactorChanged() 257 { this->setAngularFactor(this->angularFactor_); } 258 inline void linearDampingChanged() 259 { this->setLinearDamping(this->linearDamping_); } 260 inline void angularDampingChanged() 261 { this->setAngularDamping(this->angularDamping_); } 262 inline void frictionChanged() 263 { this->setFriction(this->friction_); } 225 264 226 265 CollisionType collisionType_; … … 230 269 CompoundCollisionShape* collisionShape_; 231 270 btScalar mass_; 271 btScalar restitution_; 272 btScalar angularFactor_; 273 btScalar linearDamping_; 274 btScalar angularDamping_; 275 btScalar friction_; 232 276 btScalar childrenMass_; 233 277 };
Note: See TracChangeset
for help on using the changeset viewer.