[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11261] branches/soc-2007-red_fox: Merge 11177:11259 from /trunk/blender
Levi Schooley
redfox at hhofministries.org
Fri Jul 13 05:06:15 CEST 2007
Revision: 11261
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11261
Author: red_fox
Date: 2007-07-13 05:06:01 +0200 (Fri, 13 Jul 2007)
Log Message:
-----------
Merge 11177:11259 from /trunk/blender
Just my weekly sync with /trunk/blender.
Levi
Modified Paths:
--------------
branches/soc-2007-red_fox/bin/.blender/locale/fr/LC_MESSAGES/blender.mo
branches/soc-2007-red_fox/bin/.blender/locale/it/LC_MESSAGES/blender.mo
branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp
branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h
branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h
branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp
branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp
branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h
branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp
branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionShapes/btCompoundShape.h
branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp
branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h
branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp
branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.h
branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionShapes/btMultiSphereShape.h
branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp
branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h
branches/soc-2007-red_fox/extern/bullet2/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp
branches/soc-2007-red_fox/extern/bullet2/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h
branches/soc-2007-red_fox/extern/bullet2/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
branches/soc-2007-red_fox/extern/bullet2/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
branches/soc-2007-red_fox/extern/bullet2/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h
branches/soc-2007-red_fox/extern/bullet2/src/BulletDynamics/Dynamics/btDynamicsWorld.h
branches/soc-2007-red_fox/extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.cpp
branches/soc-2007-red_fox/extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.h
branches/soc-2007-red_fox/extern/bullet2/src/LinearMath/btMatrix3x3.h
branches/soc-2007-red_fox/extern/bullet2/src/LinearMath/btQuaternion.h
branches/soc-2007-red_fox/extern/bullet2/src/LinearMath/btQuickprof.h
branches/soc-2007-red_fox/extern/bullet2/src/LinearMath/btScalar.h
branches/soc-2007-red_fox/extern/bullet2/src/LinearMath/btTransform.h
branches/soc-2007-red_fox/extern/bullet2/src/btBulletDynamicsCommon.h
branches/soc-2007-red_fox/intern/boolop/intern/BOP_Face.cpp
branches/soc-2007-red_fox/intern/boolop/intern/BOP_Face.h
branches/soc-2007-red_fox/intern/boolop/intern/BOP_Face2Face.cpp
branches/soc-2007-red_fox/intern/boolop/intern/BOP_MathUtils.cpp
branches/soc-2007-red_fox/intern/boolop/intern/BOP_MathUtils.h
branches/soc-2007-red_fox/intern/boolop/intern/BOP_Merge.cpp
branches/soc-2007-red_fox/intern/boolop/intern/BOP_Mesh.cpp
branches/soc-2007-red_fox/intern/boolop/intern/BOP_Triangulator.cpp
branches/soc-2007-red_fox/po/fr.po
branches/soc-2007-red_fox/po/it.po
branches/soc-2007-red_fox/release/Makefile
branches/soc-2007-red_fox/release/scripts/bpymodules/BPyRender.py
branches/soc-2007-red_fox/release/scripts/image_auto_layout.py
branches/soc-2007-red_fox/release/scripts/uvcalc_lightmap.py
branches/soc-2007-red_fox/source/blender/blenkernel/BKE_idprop.h
branches/soc-2007-red_fox/source/blender/blenkernel/BKE_node.h
branches/soc-2007-red_fox/source/blender/blenkernel/intern/constraint.c
branches/soc-2007-red_fox/source/blender/blenkernel/intern/idprop.c
branches/soc-2007-red_fox/source/blender/blenkernel/intern/library.c
branches/soc-2007-red_fox/source/blender/blenkernel/intern/node.c
branches/soc-2007-red_fox/source/blender/ftfont/intern/FTF_TTFont.cpp
branches/soc-2007-red_fox/source/blender/imbuf/IMB_imbuf.h
branches/soc-2007-red_fox/source/blender/imbuf/intern/imageprocess.c
branches/soc-2007-red_fox/source/blender/include/BDR_drawaction.h
branches/soc-2007-red_fox/source/blender/makesdna/DNA_ID.h
branches/soc-2007-red_fox/source/blender/makesdna/DNA_userdef_types.h
branches/soc-2007-red_fox/source/blender/nodes/CMP_node.h
branches/soc-2007-red_fox/source/blender/nodes/intern/CMP_nodes/CMP_math.c
branches/soc-2007-red_fox/source/blender/python/SConscript
branches/soc-2007-red_fox/source/blender/python/api2_2x/BezTriple.c
branches/soc-2007-red_fox/source/blender/python/api2_2x/Camera.c
branches/soc-2007-red_fox/source/blender/python/api2_2x/Draw.c
branches/soc-2007-red_fox/source/blender/python/api2_2x/Image.c
branches/soc-2007-red_fox/source/blender/python/api2_2x/Ipocurve.c
branches/soc-2007-red_fox/source/blender/python/api2_2x/Key.c
branches/soc-2007-red_fox/source/blender/python/api2_2x/Makefile
branches/soc-2007-red_fox/source/blender/python/api2_2x/Mesh.c
branches/soc-2007-red_fox/source/blender/python/api2_2x/Object.c
branches/soc-2007-red_fox/source/blender/python/api2_2x/Pose.c
branches/soc-2007-red_fox/source/blender/python/api2_2x/SurfNurb.c
branches/soc-2007-red_fox/source/blender/python/api2_2x/Texture.c
branches/soc-2007-red_fox/source/blender/python/api2_2x/bpy_data.c
branches/soc-2007-red_fox/source/blender/python/api2_2x/doc/Ipo.py
branches/soc-2007-red_fox/source/blender/python/api2_2x/doc/Render.py
branches/soc-2007-red_fox/source/blender/python/api2_2x/gen_library.c
branches/soc-2007-red_fox/source/blender/python/api2_2x/gen_utils.c
branches/soc-2007-red_fox/source/blender/python/api2_2x/sceneSequence.c
branches/soc-2007-red_fox/source/blender/src/buttons_editing.c
branches/soc-2007-red_fox/source/blender/src/drawaction.c
branches/soc-2007-red_fox/source/blender/src/editaction.c
branches/soc-2007-red_fox/source/blender/src/editipo.c
branches/soc-2007-red_fox/source/blender/src/filesel.c
branches/soc-2007-red_fox/source/blender/src/header_action.c
branches/soc-2007-red_fox/source/blender/src/language.c
branches/soc-2007-red_fox/source/blender/src/renderwin.c
branches/soc-2007-red_fox/source/creator/creator.c
branches/soc-2007-red_fox/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
Added Paths:
-----------
branches/soc-2007-red_fox/extern/bullet2/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp
branches/soc-2007-red_fox/extern/bullet2/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h
branches/soc-2007-red_fox/source/blender/nodes/intern/CMP_nodes/CMP_normalize.c
Modified: branches/soc-2007-red_fox/bin/.blender/locale/fr/LC_MESSAGES/blender.mo
===================================================================
(Binary files differ)
Modified: branches/soc-2007-red_fox/bin/.blender/locale/it/LC_MESSAGES/blender.mo
===================================================================
(Binary files differ)
Modified: branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp
===================================================================
--- branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp 2007-07-13 02:19:41 UTC (rev 11260)
+++ branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp 2007-07-13 03:06:01 UTC (rev 11261)
@@ -24,7 +24,8 @@
int gOverlappingPairs = 0;
btOverlappingPairCache::btOverlappingPairCache():
-m_blockedForChanges(false)
+m_blockedForChanges(false),
+m_overlapFilterCallback(0)
//m_NumOverlapBroadphasePair(0)
{
}
Modified: branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h
===================================================================
--- branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h 2007-07-13 02:19:41 UTC (rev 11260)
+++ branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h 2007-07-13 03:06:01 UTC (rev 11261)
@@ -26,13 +26,20 @@
struct btOverlapCallback
{
-virtual ~btOverlapCallback()
-{
-}
+ virtual ~btOverlapCallback()
+ {}
//return true for deletion of the pair
virtual bool processOverlap(btBroadphasePair& pair) = 0;
};
+struct btOverlapFilterCallback
+{
+ virtual ~btOverlapFilterCallback()
+ {}
+ // return true when pairs need collision
+ virtual bool needBroadphaseCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const = 0;
+};
+
///btOverlappingPairCache maintains the objects with overlapping AABB
///Typically managed by the Broadphase, Axis3Sweep or btSimpleBroadphase
class btOverlappingPairCache : public btBroadphaseInterface
@@ -44,6 +51,8 @@
//during the dispatch, check that user doesn't destroy/create proxy
bool m_blockedForChanges;
+ //if set, use the callback instead of the built in filter in needBroadphaseCollision
+ btOverlapFilterCallback* m_overlapFilterCallback;
public:
btOverlappingPairCache();
@@ -67,6 +76,9 @@
inline bool needsBroadphaseCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const
{
+ if (m_overlapFilterCallback)
+ return m_overlapFilterCallback->needBroadphaseCollision(proxy0,proxy1);
+
bool collides = (proxy0->m_collisionFilterGroup & proxy1->m_collisionFilterMask) != 0;
collides = collides && (proxy1->m_collisionFilterGroup & proxy0->m_collisionFilterMask);
@@ -92,7 +104,17 @@
return m_overlappingPairArray.size();
}
+ btOverlapFilterCallback* getOverlapFilterCallback()
+ {
+ return m_overlapFilterCallback;
+ }
+ void setOverlapFilterCallback(btOverlapFilterCallback* callback)
+ {
+ m_overlapFilterCallback = callback;
+ }
+
};
#endif //OVERLAPPING_PAIR_CACHE_H
+
Modified: branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h
===================================================================
--- branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h 2007-07-13 02:19:41 UTC (rev 11260)
+++ branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h 2007-07-13 03:06:01 UTC (rev 11261)
@@ -41,6 +41,8 @@
class btSimpleBroadphase : public btOverlappingPairCache
{
+protected:
+
btSimpleBroadphaseProxy* m_proxies;
int* m_freeProxies;
int m_firstFreeProxy;
Modified: branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp
===================================================================
--- branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp 2007-07-13 02:19:41 UTC (rev 11260)
+++ branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp 2007-07-13 03:06:01 UTC (rev 11261)
@@ -273,6 +273,8 @@
if ((!body0->isActive()) && (!body1->isActive()))
needsCollision = false;
+ else if (!body0->checkCollideWith(body1))
+ needsCollision = false;
return needsCollision ;
Modified: branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp
===================================================================
--- branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp 2007-07-13 02:19:41 UTC (rev 11260)
+++ branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp 2007-07-13 03:06:01 UTC (rev 11261)
@@ -24,11 +24,15 @@
m_userObjectPointer(0),
m_hitFraction(btScalar(1.)),
m_ccdSweptSphereRadius(btScalar(0.)),
- m_ccdSquareMotionThreshold(btScalar(0.))
+ m_ccdSquareMotionThreshold(btScalar(0.)),
+ m_checkCollideWith(false)
{
}
+btCollisionObject::~btCollisionObject()
+{
+}
void btCollisionObject::setActivationState(int newState)
{
Modified: branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h
===================================================================
--- branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h 2007-07-13 02:19:41 UTC (rev 11260)
+++ branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h 2007-07-13 03:06:01 UTC (rev 11261)
@@ -69,16 +69,24 @@
void* m_internalOwner;
///time of impact calculation
- btScalar m_hitFraction;
+ btScalar m_hitFraction;
///Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm::
- btScalar m_ccdSweptSphereRadius;
+ btScalar m_ccdSweptSphereRadius;
/// Don't do continuous collision detection if square motion (in one step) is less then m_ccdSquareMotionThreshold
- btScalar m_ccdSquareMotionThreshold;
+ btScalar m_ccdSquareMotionThreshold;
- char m_pad[8];
+ /// If some object should have elaborate collision filtering by sub-classes
+ bool m_checkCollideWith;
+ char m_pad[7];
+
+ virtual bool checkCollideWithOverride(btCollisionObject* co)
+ {
+ return true;
+ }
+
public:
enum CollisionFlags
@@ -118,6 +126,7 @@
btCollisionObject();
+ virtual ~btCollisionObject();
void setCollisionShape(btCollisionShape* collisionShape)
{
@@ -159,7 +168,7 @@
return ((getActivationState() != ISLAND_SLEEPING) && (getActivationState() != DISABLE_SIMULATION));
}
- void setRestitution(btScalar rest)
+ void setRestitution(btScalar rest)
{
m_restitution = rest;
}
@@ -322,6 +331,15 @@
m_userObjectPointer = userPointer;
}
+ inline bool checkCollideWith(btCollisionObject* co)
+ {
+ if (m_checkCollideWith)
+ return checkCollideWithOverride(co);
+
+ return true;
+ }
+
+
}
;
Modified: branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
===================================================================
--- branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp 2007-07-13 02:19:41 UTC (rev 11260)
+++ branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp 2007-07-13 03:06:01 UTC (rev 11261)
@@ -17,6 +17,8 @@
#include "btCollisionDispatcher.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/CollisionShapes/btCollisionShape.h"
+#include "BulletCollision/CollisionShapes/btConvexShape.h"
+
#include "BulletCollision/CollisionShapes/btSphereShape.h" //for raycasting
#include "BulletCollision/CollisionShapes/btTriangleMeshShape.h" //for raycasting
#include "BulletCollision/NarrowPhaseCollision/btRaycastCallback.h"
@@ -179,12 +181,27 @@
btCollisionObject* collisionObject,
const btCollisionShape* collisionShape,
const btTransform& colObjWorldTransform,
- RayResultCallback& resultCallback)
+ RayResultCallback& resultCallback,short int collisionFilterMask)
{
btSphereShape pointShape(btScalar(0.0));
pointShape.setMargin(0.f);
+ objectQuerySingle(&pointShape,rayFromTrans,rayToTrans,
+ collisionObject,
+ collisionShape,
+ colObjWorldTransform,
+ resultCallback,collisionFilterMask);
+}
+
+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)
+{
+
+
if (collisionShape->isConvex())
{
btConvexCast::CastResult castResult;
@@ -192,9 +209,9 @@
btConvexShape* convexShape = (btConvexShape*) collisionShape;
btVoronoiSimplexSolver simplexSolver;
- btSubsimplexConvexCast convexCaster(&pointShape,convexShape,&simplexSolver);
- //GjkConvexCast convexCaster(&pointShape,convexShape,&simplexSolver);
- //ContinuousConvexCollision convexCaster(&pointShape,convexShape,&simplexSolver,0);
+ btSubsimplexConvexCast convexCaster(castShape,convexShape,&simplexSolver);
+ //GjkConvexCast convexCaster(castShape,convexShape,&simplexSolver);
+ //ContinuousConvexCollision convexCaster(castShape,convexShape,&simplexSolver,0);
if (convexCaster.calcTimeOfImpact(rayFromTrans,rayToTrans,colObjWorldTransform,colObjWorldTransform,castResult))
{
@@ -292,11 +309,11 @@
btTransform childTrans = compoundShape->getChildTransform(i);
const btCollisionShape* childCollisionShape = compoundShape->getChildShape(i);
btTransform childWorldTrans = colObjWorldTransform * childTrans;
- rayTestSingle(rayFromTrans,rayToTrans,
+ objectQuerySingle(castShape, rayFromTrans,rayToTrans,
collisionObject,
childCollisionShape,
childWorldTrans,
- resultCallback);
+ resultCallback, collisionFilterMask);
}
@@ -306,7 +323,7 @@
}
}
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list