Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wilkins <Jason.A.Wilkins@gmail.com>2012-08-21 15:35:40 +0400
committerJason Wilkins <Jason.A.Wilkins@gmail.com>2012-08-21 15:35:40 +0400
commitc57b398ff9a93cc9d12011844efdc68ef0b5fb62 (patch)
treef0c39318e3483df3c7a58d0e4af929cf4de84bdb /source/gameengine/Physics
parent4b458a8467843dca68dcbcbb2278068b596cb582 (diff)
parent77f47799ddff99da672aa58e5d989237403e7707 (diff)
"Pens Down" merge /w trunk r49015-r50064. Make clean patches for Google Summer of Code against trunk revision 50064.
Note: The new flag LIB_LOAD_ASYNC in the GE conflicted with trunks new LIB_LOAD_SCRIPTS, so I changed the value of ASYNC. So, heads up if these values has been saved in any .blend files! Once again (see last merge note) it seems like node_draw.c had a bunch of wierd conflicts that make it look like it missed a merge or update. Not sure what is going on with that file. Other parts of the merge had some difficulty resolving proper bracket nesting in places where it seems like the merge should have gone smoothly. Maybe that was KDiff3's fault? This reduces my confidence on if bugs were not introduced.
Diffstat (limited to 'source/gameengine/Physics')
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsController.cpp7
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp11
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h2
-rw-r--r--source/gameengine/Physics/common/PHY_DynamicTypes.h24
-rw-r--r--source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h6
5 files changed, 30 insertions, 20 deletions
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index 0a105ee1c1a..ed2b9cfcb0b 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -632,6 +632,8 @@ CcdPhysicsController::~CcdPhysicsController()
delete m_MotionState;
if (m_bulletMotionState)
delete m_bulletMotionState;
+ if (m_characterController)
+ delete m_characterController;
delete m_object;
DeleteControllerShape();
@@ -836,6 +838,11 @@ void CcdPhysicsController::SetPhysicsEnvironment(class PHY_IPhysicsEnvironment *
if (m_cci.m_physicsEnv->removeCcdPhysicsController(this))
{
physicsEnv->addCcdPhysicsController(this);
+
+ // Set the object to be active so it can at least by evaluated once.
+ // This fixes issues with static objects not having their physics meshes
+ // in the right spot when lib loading.
+ this->GetCollisionObject()->setActivationState(ACTIVE_TAG);
}
m_cci.m_physicsEnv = physicsEnv;
}
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
index 9058c5b9dbd..dbc4ce209fe 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
@@ -450,6 +450,11 @@ bool CcdPhysicsEnvironment::removeCcdPhysicsController(CcdPhysicsController* ctr
} else
{
m_dynamicsWorld->removeCollisionObject(ctrl->GetCollisionObject());
+
+ if (ctrl->GetCharacterController())
+ {
+ m_dynamicsWorld->removeAction(ctrl->GetCharacterController());
+ }
}
}
if (ctrl->m_registerCount != 0)
@@ -829,16 +834,16 @@ void CcdPhysicsEnvironment::setCcdMode(int ccdMode)
void CcdPhysicsEnvironment::setSolverSorConstant(float sor)
{
- m_solverInfo.m_sor = sor;
+ m_dynamicsWorld->getSolverInfo().m_sor = sor;
}
void CcdPhysicsEnvironment::setSolverTau(float tau)
{
- m_solverInfo.m_tau = tau;
+ m_dynamicsWorld->getSolverInfo().m_tau = tau;
}
void CcdPhysicsEnvironment::setSolverDamping(float damping)
{
- m_solverInfo.m_damping = damping;
+ m_dynamicsWorld->getSolverInfo().m_damping = damping;
}
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
index 8f26b07badc..26c96da168e 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
@@ -83,8 +83,6 @@ protected:
int m_profileTimings;
bool m_enableSatCollisionDetection;
- btContactSolverInfo m_solverInfo;
-
void processFhSprings(double curTime,float timeStep);
public:
diff --git a/source/gameengine/Physics/common/PHY_DynamicTypes.h b/source/gameengine/Physics/common/PHY_DynamicTypes.h
index a72929d25c5..69bbc7745e0 100644
--- a/source/gameengine/Physics/common/PHY_DynamicTypes.h
+++ b/source/gameengine/Physics/common/PHY_DynamicTypes.h
@@ -96,18 +96,18 @@ enum
PHY_NUM_RESPONSE
};
- typedef struct PHY_CollData {
- PHY__Vector3 m_point1; /* Point in object1 in world coordinates */
- PHY__Vector3 m_point2; /* Point in object2 in world coordinates */
- PHY__Vector3 m_normal; /* point2 - point1 */
- } PHY_CollData;
-
-
- typedef bool (*PHY_ResponseCallback)(void *client_data,
- void *client_object1,
- void *client_object2,
- const PHY_CollData *coll_data);
- typedef void (*PHY_CullingCallback)(KX_ClientObjectInfo* info, void* param);
+typedef struct PHY_CollData {
+ PHY__Vector3 m_point1; /* Point in object1 in world coordinates */
+ PHY__Vector3 m_point2; /* Point in object2 in world coordinates */
+ PHY__Vector3 m_normal; /* point2 - point1 */
+} PHY_CollData;
+
+
+typedef bool (*PHY_ResponseCallback)(void *client_data,
+ void *client_object1,
+ void *client_object2,
+ const PHY_CollData *coll_data);
+typedef void (*PHY_CullingCallback)(KX_ClientObjectInfo* info, void* param);
/// PHY_PhysicsType enumerates all possible Physics Entities.
diff --git a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
index 0e26440597a..5bfcdc99eec 100644
--- a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
+++ b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
@@ -107,7 +107,7 @@ class PHY_IPhysicsEnvironment
/// Perform an integration step of duration 'timeStep'.
virtual bool proceedDeltaTime(double curTime,float timeStep,float interval)=0;
///draw debug lines (make sure to call this during the render phase, otherwise lines are not drawn properly)
- virtual void debugDrawWorld(){}
+ virtual void debugDrawWorld() {}
virtual void setFixedTimeStep(bool useFixedTimeStep,float fixedTimeStep)=0;
//returns 0.f if no fixed timestep is used
virtual float getFixedTimeStep()=0;
@@ -117,7 +117,7 @@ class PHY_IPhysicsEnvironment
///setNumIterations set the number of iterations for iterative solvers
virtual void setNumIterations(int numIter) {}
///setNumTimeSubSteps set the number of divisions of the timestep. Tradeoff quality versus performance.
- virtual void setNumTimeSubSteps(int numTimeSubSteps){}
+ virtual void setNumTimeSubSteps(int numTimeSubSteps) {}
///setDeactivationTime sets the minimum time that an objects has to stay within the velocity tresholds until it gets fully deactivated
virtual void setDeactivationTime(float dTime) {}
///setDeactivationLinearTreshold sets the linear velocity treshold, see setDeactivationTime
@@ -150,7 +150,7 @@ class PHY_IPhysicsEnvironment
float axis2X=0,float axis2Y=0,float axis2Z=0,int flag=0
)=0;
virtual void removeConstraint(int constraintid)=0;
- virtual float getAppliedImpulse(int constraintid){ return 0.f;}
+ virtual float getAppliedImpulse(int constraintid) { return 0.0f; }
//complex constraint for vehicles