Changeset 3319
- Timestamp:
- 01/26/10 16:50:03 (7 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
plugins/branches/0185_GEN_PHYSICS_REFACTOR_2/ZBullet/src/PhysicsActor.hpp
r3318 r3319 229 229 virtual Math::Real getContactSpeed() const 230 230 { 231 return ZBulletMaterialGetContactNormalSpeed(m_pMaterial, m_pContact);231 return m_pContact->getAppliedImpulse(); 232 232 } 233 233 234 234 virtual void getContactForce(Math::Vector3& _forceVector) const 235 235 { 236 ZBulletMaterialGetContactForce(m_pMaterial, _forceVector.m_array); 236 btVector3 tquat = m_pContact->m_normalWorldOnB; 237 tquat *= m_pContact->getAppliedImpulse(); 238 _forceVector.m_x = tquat.x(); 239 _forceVector.m_y = tquat.y(); 240 _forceVector.m_z = tquat.z(); 237 241 } 238 242 239 243 virtual void getContactPosition(Math::Point3& _contactPosition) const 240 244 { 241 Math::Vector3 contactNormal; 242 ZBulletMaterialGetContactPositionAndNormal(m_pMaterial, _contactPosition.m_array, contactNormal.m_array); 245 btVector3 tquat = m_pContact->getPositionWorldOnB(); 246 _contactPosition.m_x = tquat.x(); 247 _contactPosition.m_y = tquat.y(); 248 _contactPosition.m_z = tquat.z(); 243 249 } 244 250 245 251 virtual void getContactNormal(Math::Vector3& _contactNormal) const 246 252 { 247 Math::Point3 contactPosition; 248 ZBulletMaterialGetContactPositionAndNormal(m_pMaterial, contactPosition.m_array, _contactNormal.m_array); 253 btVector3 tquat = m_pContact->m_normalWorldOnB; 254 _contactNormal.m_x = tquat.x(); 255 _contactNormal.m_y = tquat.y(); 256 _contactNormal.m_z = tquat.z(); 249 257 } 250 258 251 259 virtual void getContactPositionAndNormal(Math::Point3& _contactPosition, Math::Vector3& _contactNormal) const 252 260 { 253 ZBulletMaterialGetContactPositionAndNormal(m_pMaterial, _contactPosition.m_array, _contactNormal.m_array); 261 getContactPosition(_contactPosition); 262 getContactNormal(_contactNormal); 254 263 } 255 264
