[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16286] branches/apricot: Apricot Branch:
Brecht Van Lommel
brechtvanlommel at pandora.be
Thu Aug 28 13:22:13 CEST 2008
Revision: 16286
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16286
Author: blendix
Date: 2008-08-28 13:22:06 +0200 (Thu, 28 Aug 2008)
Log Message:
-----------
Apricot Branch:
svn merge -r 16266:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/blender
Modified Paths:
--------------
branches/apricot/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
branches/apricot/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
branches/apricot/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
branches/apricot/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h
branches/apricot/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj
branches/apricot/source/blender/include/BDR_gpencil.h
branches/apricot/source/blender/include/BSE_drawipo.h
branches/apricot/source/blender/src/buttons_logic.c
branches/apricot/source/blender/src/drawgpencil.c
branches/apricot/source/blender/src/drawipo.c
branches/apricot/source/blender/src/editobject.c
branches/apricot/source/blender/src/gpencil.c
branches/apricot/source/blender/src/space.c
branches/apricot/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
branches/apricot/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
branches/apricot/source/gameengine/Converter/KX_ConvertActuators.cpp
branches/apricot/source/gameengine/Expressions/PyObjectPlus.h
branches/apricot/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
branches/apricot/source/gameengine/GamePlayer/common/GPC_RenderTools.h
branches/apricot/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
branches/apricot/source/gameengine/Ketsji/KX_ConstraintActuator.h
branches/apricot/source/gameengine/Ketsji/KX_GameObject.cpp
branches/apricot/source/gameengine/Ketsji/KX_GameObject.h
branches/apricot/source/gameengine/Ketsji/KX_IPO_SGController.cpp
branches/apricot/source/gameengine/Ketsji/KX_MeshProxy.cpp
branches/apricot/source/gameengine/Ketsji/KX_MeshProxy.h
branches/apricot/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
branches/apricot/source/gameengine/Ketsji/KX_MouseFocusSensor.h
branches/apricot/source/gameengine/Ketsji/KX_PythonInit.cpp
branches/apricot/source/gameengine/Ketsji/KX_RayCast.cpp
branches/apricot/source/gameengine/Ketsji/KX_RayCast.h
branches/apricot/source/gameengine/Ketsji/KX_RaySensor.cpp
branches/apricot/source/gameengine/Ketsji/KX_RaySensor.h
branches/apricot/source/gameengine/Ketsji/KX_Scene.cpp
branches/apricot/source/gameengine/Ketsji/KX_SoundActuator.cpp
branches/apricot/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp
branches/apricot/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h
branches/apricot/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
branches/apricot/source/gameengine/Physics/Bullet/CcdPhysicsController.h
branches/apricot/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
branches/apricot/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
branches/apricot/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.cpp
branches/apricot/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h
branches/apricot/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp
branches/apricot/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h
branches/apricot/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
branches/apricot/source/gameengine/PyDoc/KX_GameObject.py
branches/apricot/source/gameengine/PyDoc/KX_MeshProxy.py
branches/apricot/source/gameengine/Rasterizer/RAS_MeshObject.cpp
branches/apricot/source/gameengine/Rasterizer/RAS_MeshObject.h
Modified: branches/apricot/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
===================================================================
--- branches/apricot/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp 2008-08-28 11:13:04 UTC (rev 16285)
+++ branches/apricot/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp 2008-08-28 11:22:06 UTC (rev 16286)
@@ -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/apricot/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
===================================================================
--- branches/apricot/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h 2008-08-28 11:13:04 UTC (rev 16285)
+++ branches/apricot/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h 2008-08-28 11:22:06 UTC (rev 16286)
@@ -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/apricot/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
===================================================================
--- branches/apricot/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp 2008-08-28 11:13:04 UTC (rev 16285)
+++ branches/apricot/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp 2008-08-28 11:22:06 UTC (rev 16286)
@@ -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/apricot/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h
===================================================================
--- branches/apricot/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h 2008-08-28 11:13:04 UTC (rev 16285)
+++ branches/apricot/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h 2008-08-28 11:22:06 UTC (rev 16286)
@@ -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/apricot/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj
===================================================================
--- branches/apricot/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj 2008-08-28 11:13:04 UTC (rev 16285)
+++ branches/apricot/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj 2008-08-28 11:22:06 UTC (rev 16286)
@@ -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>
<File
@@ -622,6 +625,9 @@
RelativePath="..\..\..\source\gameengine\Ketsji\KX_PolygonMaterial.h">
</File>
<File
+ RelativePath="..\..\..\source\gameengine\Ketsji\KX_PolyProxy.h">
+ </File>
+ <File
RelativePath="..\..\..\source\gameengine\Ketsji\KX_PyConstraintBinding.h">
</File>
<File
Modified: branches/apricot/source/blender/include/BDR_gpencil.h
===================================================================
--- branches/apricot/source/blender/include/BDR_gpencil.h 2008-08-28 11:13:04 UTC (rev 16285)
+++ branches/apricot/source/blender/include/BDR_gpencil.h 2008-08-28 11:22:06 UTC (rev 16286)
@@ -76,6 +76,9 @@
void gpencil_delete_operation(short mode);
void gpencil_delete_menu(void);
+void gpencil_convert_operation(short mode);
+void gpencil_convert_menu(void);
+
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list