OLD | NEW |
1 /** \file gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp | 1 /** \file gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp |
2 * \ingroup physbullet | 2 * \ingroup physbullet |
3 */ | 3 */ |
4 /* | 4 /* |
5 Bullet Continuous Collision Detection and Physics Library | 5 Bullet Continuous Collision Detection and Physics Library |
6 Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ | 6 Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ |
7 | 7 |
8 This software is provided 'as-is', without any express or implied warranty. | 8 This software is provided 'as-is', without any express or implied warranty. |
9 In no event will the authors be held liable for any damages arising from the use
of this software. | 9 In no event will the authors be held liable for any damages arising from the use
of this software. |
10 Permission is granted to anyone to use this software for any purpose,· | 10 Permission is granted to anyone to use this software for any purpose,· |
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1088 | 1088 |
1089 //btCollisionWorld::ClosestRayResultCallback rayCallback(rayFrom,rayTo); | 1089 //btCollisionWorld::ClosestRayResultCallback rayCallback(rayFrom,rayTo); |
1090 FilterClosestRayResultCallback rayCallback(filterCallback,rayFrom,rayT
o); | 1090 FilterClosestRayResultCallback rayCallback(filterCallback,rayFrom,rayT
o); |
1091 | 1091 |
1092 | 1092 |
1093 PHY_RayCastResult result; | 1093 PHY_RayCastResult result; |
1094 memset(&result, 0, sizeof(result)); | 1094 memset(&result, 0, sizeof(result)); |
1095 | 1095 |
1096 // don't collision with sensor object | 1096 // don't collision with sensor object |
1097 rayCallback.m_collisionFilterMask = CcdConstructionInfo::AllFilter ^ Ccd
ConstructionInfo::SensorFilter; | 1097 rayCallback.m_collisionFilterMask = CcdConstructionInfo::AllFilter ^ Ccd
ConstructionInfo::SensorFilter; |
| 1098 rayCallback.m_collisionFilterGroup = CcdConstructionInfo::AllFilter; |
1098 //, ,filterCallback.m_faceNormal); | 1099 //, ,filterCallback.m_faceNormal); |
1099 | 1100 |
1100 m_dynamicsWorld->rayTest(rayFrom,rayTo,rayCallback); | 1101 m_dynamicsWorld->rayTest(rayFrom,rayTo,rayCallback); |
1101 if (rayCallback.hasHit()) | 1102 if (rayCallback.hasHit()) |
1102 { | 1103 { |
1103 CcdPhysicsController* controller = static_cast<CcdPhysicsControl
ler*>(rayCallback.m_collisionObject->getUserPointer()); | 1104 CcdPhysicsController* controller = static_cast<CcdPhysicsControl
ler*>(rayCallback.m_collisionObject->getUserPointer()); |
1104 result.m_controller = controller; | 1105 result.m_controller = controller; |
1105 result.m_hitPoint[0] = rayCallback.m_hitPointWorld.getX(); | 1106 result.m_hitPoint[0] = rayCallback.m_hitPointWorld.getX(); |
1106 result.m_hitPoint[1] = rayCallback.m_hitPointWorld.getY(); | 1107 result.m_hitPoint[1] = rayCallback.m_hitPointWorld.getY(); |
1107 result.m_hitPoint[2] = rayCallback.m_hitPointWorld.getZ(); | 1108 result.m_hitPoint[2] = rayCallback.m_hitPointWorld.getZ(); |
(...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2826 m_dynamicsWorld->serialize(serializer); | 2827 m_dynamicsWorld->serialize(serializer); |
2827 | 2828 |
2828 FILE* file = fopen(filename,"wb"); | 2829 FILE* file = fopen(filename,"wb"); |
2829 if (file) | 2830 if (file) |
2830 { | 2831 { |
2831 fwrite(serializer->getBufferPointer(),serializer->getCurrentBuff
erSize(),1, file); | 2832 fwrite(serializer->getBufferPointer(),serializer->getCurrentBuff
erSize(),1, file); |
2832 fclose(file); | 2833 fclose(file); |
2833 } | 2834 } |
2834 } | 2835 } |
2835 | 2836 |
OLD | NEW |