Revision: 15669
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15669
Author:   campbellbarton
Date:     2008-07-21 15:11:56 +0200 (Mon, 21 Jul 2008)

Log Message:
-----------
svn merge -r15657:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/blende

Modified Paths:
--------------
    branches/apricot/source/blender/blenkernel/intern/collision.c
    branches/apricot/source/blender/blenkernel/intern/particle_system.c
    branches/apricot/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
    branches/apricot/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
    branches/apricot/source/gameengine/GamePlayer/common/GPC_Canvas.h
    branches/apricot/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
    branches/apricot/source/gameengine/Ketsji/KX_BulletPhysicsController.h
    branches/apricot/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
    branches/apricot/source/gameengine/Ketsji/KX_GameObject.cpp
    branches/apricot/source/gameengine/Ketsji/KX_IPhysicsController.h
    branches/apricot/source/gameengine/Ketsji/KX_OdePhysicsController.cpp
    branches/apricot/source/gameengine/Ketsji/KX_OdePhysicsController.h
    branches/apricot/source/gameengine/Ketsji/KX_RadarSensor.cpp
    branches/apricot/source/gameengine/Ketsji/KX_Scene.cpp
    branches/apricot/source/gameengine/Ketsji/KX_SumoPhysicsController.cpp
    branches/apricot/source/gameengine/Ketsji/KX_SumoPhysicsController.h
    branches/apricot/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
    branches/apricot/source/gameengine/Physics/Bullet/CcdPhysicsController.h
    branches/apricot/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
    branches/apricot/source/gameengine/Rasterizer/RAS_2DFilterManager.h
    branches/apricot/source/gameengine/Rasterizer/RAS_ICanvas.h

Modified: branches/apricot/source/blender/blenkernel/intern/collision.c
===================================================================
--- branches/apricot/source/blender/blenkernel/intern/collision.c       
2008-07-21 12:37:27 UTC (rev 15668)
+++ branches/apricot/source/blender/blenkernel/intern/collision.c       
2008-07-21 13:11:56 UTC (rev 15669)
@@ -1437,6 +1437,9 @@
 
                                        if(coll_ob == self)
                                                continue;
+                                       
+                                       if( !collmd->bvhtree)
+                                               continue;
 
                                        if(numobj >= maxobj)
                                        {

Modified: branches/apricot/source/blender/blenkernel/intern/particle_system.c
===================================================================
--- branches/apricot/source/blender/blenkernel/intern/particle_system.c 
2008-07-21 12:37:27 UTC (rev 15668)
+++ branches/apricot/source/blender/blenkernel/intern/particle_system.c 
2008-07-21 13:11:56 UTC (rev 15669)
@@ -2797,7 +2797,10 @@
                                epart= epsys->part;
                                pd= epart->pd;
                                totepart= epsys->totpart;
-
+                               
+                               if(totepart <= 0)
+                                       continue;
+                               
                                if(pd->forcefield==PFIELD_HARMONIC){
                                        /* every particle is mapped to only one 
harmonic effector particle */
                                        p= pa_no%epsys->totpart;

Modified: 
branches/apricot/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
===================================================================
--- branches/apricot/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp     
2008-07-21 12:37:27 UTC (rev 15668)
+++ branches/apricot/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp     
2008-07-21 13:11:56 UTC (rev 15669)
@@ -101,6 +101,13 @@
        return scrarea_get_win_height(m_area);
 }
 
+RAS_Rect &
+KX_BlenderCanvas::
+GetWindowArea(
+){
+       return m_area_rect;
+}      
+
        void
 KX_BlenderCanvas::
 SetViewPort(
@@ -112,6 +119,11 @@
        int minx = scrarea_get_win_x(m_area);
        int miny = scrarea_get_win_y(m_area);
 
+       m_area_rect.SetLeft(minx + x1);
+       m_area_rect.SetBottom(miny + y1);
+       m_area_rect.SetRight(minx + x2);
+       m_area_rect.SetTop(miny + y2);
+
        glViewport(minx + x1, miny + y1, vp_width, vp_height);
        glScissor(minx + x1, miny + y1, vp_width, vp_height);
 }

Modified: branches/apricot/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h
===================================================================
--- branches/apricot/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h       
2008-07-21 12:37:27 UTC (rev 15668)
+++ branches/apricot/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h       
2008-07-21 13:11:56 UTC (rev 15669)
@@ -117,6 +117,10 @@
                return m_displayarea;
        };
 
+               RAS_Rect &
+       GetWindowArea(
+       );
+
                void
        SetViewPort(
                int x1, int y1,
@@ -159,6 +163,7 @@
 private:
        /** Blender area the game engine is running within */
        struct ScrArea* m_area;
+       RAS_Rect        m_area_rect;
 };
 
 #endif // __KX_BLENDERCANVAS

Modified: branches/apricot/source/gameengine/GamePlayer/common/GPC_Canvas.h
===================================================================
--- branches/apricot/source/gameengine/GamePlayer/common/GPC_Canvas.h   
2008-07-21 12:37:27 UTC (rev 15668)
+++ branches/apricot/source/gameengine/GamePlayer/common/GPC_Canvas.h   
2008-07-21 13:11:56 UTC (rev 15669)
@@ -130,6 +130,12 @@
        ) {
                return m_displayarea;
        };
+       
+               RAS_Rect &
+       GetWindowArea(
+       ) {
+               return m_displayarea;
+       }
 
                void 
        BeginFrame(

Modified: 
branches/apricot/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
===================================================================
--- branches/apricot/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp    
2008-07-21 12:37:27 UTC (rev 15668)
+++ branches/apricot/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp    
2008-07-21 13:11:56 UTC (rev 15669)
@@ -133,9 +133,10 @@
        
CcdPhysicsController::getOrientation(myorn[0],myorn[1],myorn[2],myorn[3]);
        orn = MT_Quaternion(myorn[0],myorn[1],myorn[2],myorn[3]);
 }
-void KX_BulletPhysicsController::setOrientation(const MT_Quaternion& orn)
+void KX_BulletPhysicsController::setOrientation(const MT_Matrix3x3& orn)
 {
-       CcdPhysicsController::setOrientation(orn.x(),orn.y(),orn.z(),orn.w());
+       btMatrix3x3 btmat(orn[0][0], orn[0][1], orn[1][2], orn[1][0], 
orn[1][1], orn[1][2], orn[2][0], orn[2][1], orn[2][2]);
+       CcdPhysicsController::setWorldOrientation(btmat);
 }
 void KX_BulletPhysicsController::setPosition(const MT_Point3& pos)
 {

Modified: branches/apricot/source/gameengine/Ketsji/KX_BulletPhysicsController.h
===================================================================
--- branches/apricot/source/gameengine/Ketsji/KX_BulletPhysicsController.h      
2008-07-21 12:37:27 UTC (rev 15668)
+++ branches/apricot/source/gameengine/Ketsji/KX_BulletPhysicsController.h      
2008-07-21 13:11:56 UTC (rev 15669)
@@ -35,7 +35,7 @@
        virtual void    SetAngularVelocity(const MT_Vector3& ang_vel,bool 
local);
        virtual void    SetLinearVelocity(const MT_Vector3& lin_vel,bool local);
        virtual void    getOrientation(MT_Quaternion& orn);
-       virtual void setOrientation(const MT_Quaternion& orn);
+       virtual void setOrientation(const MT_Matrix3x3& orn);
        virtual void setPosition(const MT_Point3& pos);
        virtual void setScaling(const MT_Vector3& scaling);
        virtual MT_Scalar       GetMass();

Modified: branches/apricot/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
===================================================================
--- branches/apricot/source/gameengine/Ketsji/KX_ConstraintActuator.cpp 
2008-07-21 12:37:27 UTC (rev 15668)
+++ branches/apricot/source/gameengine/Ketsji/KX_ConstraintActuator.cpp 
2008-07-21 13:11:56 UTC (rev 15669)
@@ -178,16 +178,18 @@
                                direction[2] = rotation[2][1];
                                axis = 1;
                                break;
-                       case KX_ACT_CONSTRAINT_ORIZ:
+                       default:
                                direction[0] = rotation[0][2];
                                direction[1] = rotation[1][2];
                                direction[2] = rotation[2][2];
                                axis = 2;
                                break;
                        }
-                       // apply damping on the direction
                        if (m_posDampTime) {
+                               // apply damping on the direction
                                direction = filter*direction + 
(1.0-filter)*m_refDirection;
+                       } else {
+                               direction = m_refDirection;
                        }
                        obj->AlignAxisToVect(direction, axis);
                        result = true;

Modified: branches/apricot/source/gameengine/Ketsji/KX_GameObject.cpp
===================================================================
--- branches/apricot/source/gameengine/Ketsji/KX_GameObject.cpp 2008-07-21 
12:37:27 UTC (rev 15668)
+++ branches/apricot/source/gameengine/Ketsji/KX_GameObject.cpp 2008-07-21 
13:11:56 UTC (rev 15669)
@@ -744,7 +744,7 @@
        if (m_pPhysicsController1 && (!GetSGNode() || 
!GetSGNode()->GetSGParent()))
        {
                // see note above
-               m_pPhysicsController1->setOrientation(rot.getRotation());
+               m_pPhysicsController1->setOrientation(rot);
        }
        if (GetSGNode())
                GetSGNode()->SetLocalOrientation(rot);

Modified: branches/apricot/source/gameengine/Ketsji/KX_IPhysicsController.h
===================================================================
--- branches/apricot/source/gameengine/Ketsji/KX_IPhysicsController.h   
2008-07-21 12:37:27 UTC (rev 15668)
+++ branches/apricot/source/gameengine/Ketsji/KX_IPhysicsController.h   
2008-07-21 13:11:56 UTC (rev 15669)
@@ -71,7 +71,8 @@
        virtual void    resolveCombinedVelocities(float linvelX,float 
linvelY,float linvelZ,float angVelX,float angVelY,float angVelZ) = 0;
 
        virtual void    getOrientation(MT_Quaternion& orn)=0;
-       virtual void setOrientation(const MT_Quaternion& orn)=0;
+       virtual void setOrientation(const MT_Matrix3x3& orn)=0;
+       //virtual       void setOrientation(const MT_Quaternion& orn)=0;
        virtual void setPosition(const MT_Point3& pos)=0;
        virtual void setScaling(const MT_Vector3& scaling)=0;
        virtual MT_Scalar       GetMass()=0;

Modified: branches/apricot/source/gameengine/Ketsji/KX_OdePhysicsController.cpp
===================================================================
--- branches/apricot/source/gameengine/Ketsji/KX_OdePhysicsController.cpp       
2008-07-21 12:37:27 UTC (rev 15668)
+++ branches/apricot/source/gameengine/Ketsji/KX_OdePhysicsController.cpp       
2008-07-21 13:11:56 UTC (rev 15669)
@@ -133,8 +133,9 @@
        
ODEPhysicsController::SetLinearVelocity(lin_vel[0],lin_vel[1],lin_vel[2],local);
 }
 
-void KX_OdePhysicsController::setOrientation(const MT_Quaternion& orn)
+void KX_OdePhysicsController::setOrientation(const MT_Matrix3x3& rot)
 {
+       MT_Quaternion orn = rot.getRotation();
        ODEPhysicsController::setOrientation(orn[0],orn[1],orn[2],orn[3]);
 }
 

Modified: branches/apricot/source/gameengine/Ketsji/KX_OdePhysicsController.h
===================================================================
--- branches/apricot/source/gameengine/Ketsji/KX_OdePhysicsController.h 
2008-07-21 12:37:27 UTC (rev 15668)
+++ branches/apricot/source/gameengine/Ketsji/KX_OdePhysicsController.h 
2008-07-21 13:11:56 UTC (rev 15669)
@@ -67,7 +67,7 @@
        virtual void    SetLinearVelocity(const MT_Vector3& lin_vel,bool local);
        virtual void            resolveCombinedVelocities(float linvelX,float 
linvelY,float linvelZ,float angVelX,float angVelY,float angVelZ);
        virtual void            getOrientation(MT_Quaternion& orn);
-       virtual void setOrientation(const MT_Quaternion& orn);
+       virtual void setOrientation(const MT_Matrix3x3& orn);
        virtual void setPosition(const MT_Point3& pos);
        virtual void setScaling(const MT_Vector3& scaling);
        virtual MT_Scalar       GetMass();

Modified: branches/apricot/source/gameengine/Ketsji/KX_RadarSensor.cpp
===================================================================
--- branches/apricot/source/gameengine/Ketsji/KX_RadarSensor.cpp        
2008-07-21 12:37:27 UTC (rev 15668)
+++ branches/apricot/source/gameengine/Ketsji/KX_RadarSensor.cpp        
2008-07-21 13:11:56 UTC (rev 15669)
@@ -176,8 +176,10 @@
 
        if (m_physCtrl)
        {
-               
m_physCtrl->setPosition(trans.getOrigin().x(),trans.getOrigin().y(),trans.getOrigin().z());
-               
m_physCtrl->setOrientation(trans.getRotation().x(),trans.getRotation().y(),trans.getRotation().z(),trans.getRotation().w());
+               MT_Quaternion orn = trans.getRotation();
+               MT_Point3 pos = trans.getOrigin();
+               m_physCtrl->setPosition(pos[0],pos[1],pos[2]);
+               m_physCtrl->setOrientation(orn[0],orn[1],orn[2],orn[3]);
                m_physCtrl->calcXform();
        }
 

Modified: branches/apricot/source/gameengine/Ketsji/KX_Scene.cpp
===================================================================
--- branches/apricot/source/gameengine/Ketsji/KX_Scene.cpp      2008-07-21 
12:37:27 UTC (rev 15668)
+++ branches/apricot/source/gameengine/Ketsji/KX_Scene.cpp      2008-07-21 
13:11:56 UTC (rev 15669)
@@ -713,8 +713,12 @@
 
                if (replica->GetPhysicsController())
                {
-                       replica->GetPhysicsController()->setPosition(newpos);

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to