[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16292] branches/soc-2008-unclezeiv: svn merge -r 16234:16291 https://svn.blender.org/svnroot/bf-blender/trunk/ blender
Davide Vercelli
davide.vercelli at gmail.com
Fri Aug 29 00:09:13 CEST 2008
Revision: 16292
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16292
Author: unclezeiv
Date: 2008-08-29 00:08:37 +0200 (Fri, 29 Aug 2008)
Log Message:
-----------
svn merge -r 16234:16291 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Modified Paths:
--------------
branches/soc-2008-unclezeiv/CMake/macros.cmake
branches/soc-2008-unclezeiv/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
branches/soc-2008-unclezeiv/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
branches/soc-2008-unclezeiv/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
branches/soc-2008-unclezeiv/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h
branches/soc-2008-unclezeiv/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj
branches/soc-2008-unclezeiv/source/Makefile
branches/soc-2008-unclezeiv/source/blender/blenkernel/intern/effect.c
branches/soc-2008-unclezeiv/source/blender/blenkernel/intern/particle.c
branches/soc-2008-unclezeiv/source/blender/blenkernel/intern/particle_system.c
branches/soc-2008-unclezeiv/source/blender/include/BDR_gpencil.h
branches/soc-2008-unclezeiv/source/blender/include/BIF_editarmature.h
branches/soc-2008-unclezeiv/source/blender/include/BIF_editview.h
branches/soc-2008-unclezeiv/source/blender/include/BSE_drawipo.h
branches/soc-2008-unclezeiv/source/blender/include/transform.h
branches/soc-2008-unclezeiv/source/blender/makesdna/DNA_actuator_types.h
branches/soc-2008-unclezeiv/source/blender/makesdna/DNA_gpencil_types.h
branches/soc-2008-unclezeiv/source/blender/makesdna/DNA_sensor_types.h
branches/soc-2008-unclezeiv/source/blender/render/intern/source/convertblender.c
branches/soc-2008-unclezeiv/source/blender/src/buttons_logic.c
branches/soc-2008-unclezeiv/source/blender/src/drawgpencil.c
branches/soc-2008-unclezeiv/source/blender/src/drawipo.c
branches/soc-2008-unclezeiv/source/blender/src/editarmature.c
branches/soc-2008-unclezeiv/source/blender/src/editmesh_tools.c
branches/soc-2008-unclezeiv/source/blender/src/editnode.c
branches/soc-2008-unclezeiv/source/blender/src/editobject.c
branches/soc-2008-unclezeiv/source/blender/src/editview.c
branches/soc-2008-unclezeiv/source/blender/src/gpencil.c
branches/soc-2008-unclezeiv/source/blender/src/space.c
branches/soc-2008-unclezeiv/source/blender/src/transform_generics.c
branches/soc-2008-unclezeiv/source/blender/src/transform_numinput.c
branches/soc-2008-unclezeiv/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
branches/soc-2008-unclezeiv/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
branches/soc-2008-unclezeiv/source/gameengine/Converter/KX_ConvertActuators.cpp
branches/soc-2008-unclezeiv/source/gameengine/Converter/KX_ConvertSensors.cpp
branches/soc-2008-unclezeiv/source/gameengine/Expressions/PyObjectPlus.h
branches/soc-2008-unclezeiv/source/gameengine/GameLogic/SCA_IController.cpp
branches/soc-2008-unclezeiv/source/gameengine/GameLogic/SCA_ISensor.cpp
branches/soc-2008-unclezeiv/source/gameengine/GameLogic/SCA_ISensor.h
branches/soc-2008-unclezeiv/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
branches/soc-2008-unclezeiv/source/gameengine/GameLogic/SCA_LogicManager.cpp
branches/soc-2008-unclezeiv/source/gameengine/GameLogic/SCA_LogicManager.h
branches/soc-2008-unclezeiv/source/gameengine/GameLogic/SCA_PythonController.cpp
branches/soc-2008-unclezeiv/source/gameengine/GameLogic/SCA_PythonController.h
branches/soc-2008-unclezeiv/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
branches/soc-2008-unclezeiv/source/gameengine/GamePlayer/common/GPC_RenderTools.h
branches/soc-2008-unclezeiv/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
branches/soc-2008-unclezeiv/source/gameengine/Ketsji/KX_ConstraintActuator.h
branches/soc-2008-unclezeiv/source/gameengine/Ketsji/KX_GameObject.cpp
branches/soc-2008-unclezeiv/source/gameengine/Ketsji/KX_GameObject.h
branches/soc-2008-unclezeiv/source/gameengine/Ketsji/KX_IPO_SGController.cpp
branches/soc-2008-unclezeiv/source/gameengine/Ketsji/KX_MeshProxy.cpp
branches/soc-2008-unclezeiv/source/gameengine/Ketsji/KX_MeshProxy.h
branches/soc-2008-unclezeiv/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
branches/soc-2008-unclezeiv/source/gameengine/Ketsji/KX_MouseFocusSensor.h
branches/soc-2008-unclezeiv/source/gameengine/Ketsji/KX_PythonInit.cpp
branches/soc-2008-unclezeiv/source/gameengine/Ketsji/KX_RayCast.cpp
branches/soc-2008-unclezeiv/source/gameengine/Ketsji/KX_RayCast.h
branches/soc-2008-unclezeiv/source/gameengine/Ketsji/KX_RaySensor.cpp
branches/soc-2008-unclezeiv/source/gameengine/Ketsji/KX_RaySensor.h
branches/soc-2008-unclezeiv/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
branches/soc-2008-unclezeiv/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h
branches/soc-2008-unclezeiv/source/gameengine/Ketsji/KX_Scene.cpp
branches/soc-2008-unclezeiv/source/gameengine/Ketsji/KX_SoundActuator.cpp
branches/soc-2008-unclezeiv/source/gameengine/Ketsji/Makefile
branches/soc-2008-unclezeiv/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp
branches/soc-2008-unclezeiv/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h
branches/soc-2008-unclezeiv/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
branches/soc-2008-unclezeiv/source/gameengine/Physics/Bullet/CcdPhysicsController.h
branches/soc-2008-unclezeiv/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
branches/soc-2008-unclezeiv/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
branches/soc-2008-unclezeiv/source/gameengine/Physics/Bullet/Makefile
branches/soc-2008-unclezeiv/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.cpp
branches/soc-2008-unclezeiv/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h
branches/soc-2008-unclezeiv/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp
branches/soc-2008-unclezeiv/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h
branches/soc-2008-unclezeiv/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
branches/soc-2008-unclezeiv/source/gameengine/PyDoc/KX_GameObject.py
branches/soc-2008-unclezeiv/source/gameengine/PyDoc/KX_MeshProxy.py
branches/soc-2008-unclezeiv/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py
branches/soc-2008-unclezeiv/source/gameengine/PyDoc/SCA_ISensor.py
branches/soc-2008-unclezeiv/source/gameengine/Rasterizer/RAS_MeshObject.cpp
branches/soc-2008-unclezeiv/source/gameengine/Rasterizer/RAS_MeshObject.h
branches/soc-2008-unclezeiv/source/nan_definitions.mk
Added Paths:
-----------
branches/soc-2008-unclezeiv/source/gameengine/Ketsji/KX_PolyProxy.cpp
branches/soc-2008-unclezeiv/source/gameengine/Ketsji/KX_PolyProxy.h
branches/soc-2008-unclezeiv/source/gameengine/PyDoc/KX_PolyProxy.py
Modified: branches/soc-2008-unclezeiv/CMake/macros.cmake
===================================================================
--- branches/soc-2008-unclezeiv/CMake/macros.cmake 2008-08-28 21:19:25 UTC (rev 16291)
+++ branches/soc-2008-unclezeiv/CMake/macros.cmake 2008-08-28 22:08:37 UTC (rev 16292)
@@ -38,6 +38,8 @@
ENDMACRO(BLENDERLIB)
MACRO(SETUP_LIBDIRS)
+ # see "cmake --help-policy CMP0003"
+ CMAKE_POLICY(SET CMP0003 NEW)
LINK_DIRECTORIES(${PYTHON_LIBPATH} ${SDL_LIBPATH} ${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${ICONV_LIBPATH} ${OPENEXR_LIBPATH} ${QUICKTIME_LIBPATH} ${FFMPEG_LIBPATH})
IF(WITH_INTERNATIONAL)
LINK_DIRECTORIES(${GETTEXT_LIBPATH})
Modified: branches/soc-2008-unclezeiv/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
===================================================================
--- branches/soc-2008-unclezeiv/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp 2008-08-28 21:19:25 UTC (rev 16291)
+++ branches/soc-2008-unclezeiv/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp 2008-08-28 22:08:37 UTC (rev 16292)
@@ -181,7 +181,9 @@
btCollisionObject* collisionObject,
const btCollisionShape* collisionShape,
const btTransform& colObjWorldTransform,
- RayResultCallback& resultCallback,short int collisionFilterMask)
+ RayResultCallback& resultCallback,
+ short int collisionFilterMask,
+ bool faceNormal)
{
btSphereShape pointShape(btScalar(0.0));
@@ -191,14 +193,16 @@
collisionObject,
collisionShape,
colObjWorldTransform,
- resultCallback,collisionFilterMask);
+ resultCallback,collisionFilterMask,faceNormal);
}
void btCollisionWorld::objectQuerySingle(const btConvexShape* castShape,const btTransform& rayFromTrans,const btTransform& rayToTrans,
btCollisionObject* collisionObject,
const btCollisionShape* collisionShape,
const btTransform& colObjWorldTransform,
- RayResultCallback& resultCallback,short int collisionFilterMask)
+ RayResultCallback& resultCallback,
+ short int collisionFilterMask,
+ bool faceNormal)
{
@@ -257,9 +261,9 @@
btCollisionObject* m_collisionObject;
btTriangleMeshShape* m_triangleMesh;
- BridgeTriangleRaycastCallback( const btVector3& from,const btVector3& to,
- btCollisionWorld::RayResultCallback* resultCallback, btCollisionObject* collisionObject,btTriangleMeshShape* triangleMesh):
- btTriangleRaycastCallback(from,to),
+ BridgeTriangleRaycastCallback( const btVector3& from,const btVector3& to,bool faceNormal,
+ btCollisionWorld::RayResultCallback* resultCallback, btCollisionObject* collisionObject,btTriangleMeshShape* triangleMesh):
+ btTriangleRaycastCallback(from,to,faceNormal),
m_resultCallback(resultCallback),
m_collisionObject(collisionObject),
m_triangleMesh(triangleMesh)
@@ -272,6 +276,7 @@
btCollisionWorld::LocalShapeInfo shapeInfo;
shapeInfo.m_shapePart = partId;
shapeInfo.m_triangleIndex = triangleIndex;
+ shapeInfo.m_triangleShape = m_triangleMesh;
btCollisionWorld::LocalRayResult rayResult
(m_collisionObject,
@@ -287,7 +292,7 @@
};
- BridgeTriangleRaycastCallback rcb(rayFromLocal,rayToLocal,&resultCallback,collisionObject,triangleMesh);
+ BridgeTriangleRaycastCallback rcb(rayFromLocal,rayToLocal,faceNormal,&resultCallback,collisionObject,triangleMesh);
rcb.m_hitFraction = resultCallback.m_closestHitFraction;
btVector3 rayAabbMinLocal = rayFromLocal;
@@ -313,7 +318,7 @@
collisionObject,
childCollisionShape,
childWorldTrans,
- resultCallback, collisionFilterMask);
+ resultCallback, collisionFilterMask, faceNormal);
}
@@ -323,7 +328,7 @@
}
}
-void btCollisionWorld::rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback,short int collisionFilterMask)
+void btCollisionWorld::rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback,short int collisionFilterMask, bool faceNormal)
{
@@ -350,11 +355,17 @@
btVector3 hitNormal;
if (btRayAabb(rayFromWorld,rayToWorld,collisionObjectAabbMin,collisionObjectAabbMax,hitLambda,hitNormal))
{
- rayTestSingle(rayFromTrans,rayToTrans,
- collisionObject,
- collisionObject->getCollisionShape(),
- collisionObject->getWorldTransform(),
- resultCallback);
+ // before testing this object, verify that it is not filtered out
+ if (resultCallback.NeedRayCast(collisionObject))
+ {
+ rayTestSingle(rayFromTrans,rayToTrans,
+ collisionObject,
+ collisionObject->getCollisionShape(),
+ collisionObject->getWorldTransform(),
+ resultCallback,
+ collisionFilterMask,
+ faceNormal);
+ }
}
}
}
Modified: branches/soc-2008-unclezeiv/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
===================================================================
--- branches/soc-2008-unclezeiv/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h 2008-08-28 21:19:25 UTC (rev 16291)
+++ branches/soc-2008-unclezeiv/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h 2008-08-28 22:08:37 UTC (rev 16292)
@@ -125,8 +125,8 @@
{
int m_shapePart;
int m_triangleIndex;
-
- //const btCollisionShape* m_shapeTemp;
+ // needed in case of compound shape
+ const btCollisionShape* m_triangleShape;
//const btTransform* m_shapeLocalTransform;
};
@@ -166,6 +166,10 @@
:m_closestHitFraction(btScalar(1.))
{
}
+ virtual bool NeedRayCast(btCollisionObject* object)
+ {
+ return true;
+ }
virtual btScalar AddSingleResult(LocalRayResult& rayResult) = 0;
};
@@ -209,7 +213,7 @@
/// rayTest performs a raycast on all objects in the btCollisionWorld, and calls the resultCallback
/// This allows for several queries: first hit, all hits, any hit, dependent on the value returned by the callback.
- void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback, short int collisionFilterMask=-1);
+ void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback, short int collisionFilterMask=-1, bool faceNormal=false);
/// rayTestSingle performs a raycast call and calls the resultCallback. It is used internally by rayTest.
/// In a future implementation, we consider moving the ray test as a virtual method in btCollisionShape.
@@ -218,14 +222,18 @@
btCollisionObject* collisionObject,
const btCollisionShape* collisionShape,
const btTransform& colObjWorldTransform,
- RayResultCallback& resultCallback, short int collisionFilterMask=-1);
+ RayResultCallback& resultCallback,
+ short int collisionFilterMask=-1,
+ bool faceNormal=false);
/// objectQuerySingle performs a collision detection query and calls the resultCallback. It is used internally by rayTest.
static void objectQuerySingle(const btConvexShape* castShape, const btTransform& rayFromTrans,const btTransform& rayToTrans,
btCollisionObject* collisionObject,
const btCollisionShape* collisionShape,
const btTransform& colObjWorldTransform,
- RayResultCallback& resultCallback, short int collisionFilterMask=-1);
+ RayResultCallback& resultCallback,
+ short int collisionFilterMask=-1,
+ bool faceNormal=false);
void addCollisionObject(btCollisionObject* collisionObject,short int collisionFilterGroup=1,short int collisionFilterMask=1);
Modified: branches/soc-2008-unclezeiv/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
===================================================================
--- branches/soc-2008-unclezeiv/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp 2008-08-28 21:19:25 UTC (rev 16291)
+++ branches/soc-2008-unclezeiv/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp 2008-08-28 22:08:37 UTC (rev 16292)
@@ -16,10 +16,11 @@
#include "btRaycastCallback.h"
-btTriangleRaycastCallback::btTriangleRaycastCallback(const btVector3& from,const btVector3& to)
+btTriangleRaycastCallback::btTriangleRaycastCallback(const btVector3& from,const btVector3& to,bool faceNormal)
:
m_from(from),
m_to(to),
+ m_faceNormal(faceNormal),
m_hitFraction(btScalar(1.))
{
@@ -84,8 +85,7 @@
if ( (btScalar)(cp2.dot(triangleNormal)) >=edge_tolerance)
{
-
- if ( dist_a > 0 )
+ if (m_faceNormal || dist_a > 0)
{
m_hitFraction = reportHit(triangleNormal,distance,partId,triangleIndex);
}
Modified: branches/soc-2008-unclezeiv/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h
===================================================================
--- branches/soc-2008-unclezeiv/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h 2008-08-28 21:19:25 UTC (rev 16291)
+++ branches/soc-2008-unclezeiv/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h 2008-08-28 22:08:37 UTC (rev 16292)
@@ -27,10 +27,11 @@
//input
btVector3 m_from;
btVector3 m_to;
+ bool m_faceNormal;
btScalar m_hitFraction;
- btTriangleRaycastCallback(const btVector3& from,const btVector3& to);
+ btTriangleRaycastCallback(const btVector3& from,const btVector3& to,bool faceNormal);
virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex);
Modified: branches/soc-2008-unclezeiv/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj
===================================================================
--- branches/soc-2008-unclezeiv/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj 2008-08-28 21:19:25 UTC (rev 16291)
+++ branches/soc-2008-unclezeiv/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj 2008-08-28 22:08:37 UTC (rev 16292)
@@ -395,6 +395,9 @@
RelativePath="..\..\..\source\gameengine\Ketsji\KX_PolygonMaterial.cpp">
</File>
<File
+ RelativePath="..\..\..\source\gameengine\Ketsji\KX_PolyProxy.cpp">
+ </File>
+ <File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_PyConstraintBinding.cpp">
</File>
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list