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:
authorErwin Coumans <blender@erwincoumans.com>2005-08-02 18:59:49 +0400
committerErwin Coumans <blender@erwincoumans.com>2005-08-02 18:59:49 +0400
commit558b8daf67bc986210d2ca9f778872ec6a4fab3b (patch)
treeda8cd2b52806c83deb0cb6acb7c54a3938e5f965 /source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
parent292c03ab8e9979a3792f8f96e4bad1a9d5b82275 (diff)
added python binding for debugdraw,
tweaked friction, some more preparations but no real functionality added yet
Diffstat (limited to 'source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
index 338e9448e94..d767b480756 100644
--- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
+++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
@@ -133,7 +133,7 @@ void KX_ConvertSumoObject( KX_GameObject* gameobj,
smmaterial->m_fh_normal = kxmaterial->m_fh_normal;
smmaterial->m_fh_spring = kxmaterial->m_fh_spring;
smmaterial->m_friction = kxmaterial->m_friction;
- smmaterial->m_restitution = 0.f;//kxmaterial->m_restitution;
+ smmaterial->m_restitution = kxmaterial->m_restitution;
SumoPhysicsEnvironment* sumoEnv =
(SumoPhysicsEnvironment*)kxscene->GetPhysicsEnvironment();
@@ -854,7 +854,6 @@ static CollisionShape* CreateBulletShapeFromMesh(RAS_MeshObject* meshobj, bool p
-
void KX_ConvertBulletObject( class KX_GameObject* gameobj,
class RAS_MeshObject* meshobj,
class KX_Scene* kxscene,
@@ -864,10 +863,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj,
{
CcdPhysicsEnvironment* env = (CcdPhysicsEnvironment*)kxscene->GetPhysicsEnvironment();
-
assert(env);
-
-
bool dyna = false;
@@ -912,8 +908,12 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj,
halfExtents /= 2.f;
- //todo: do this conversion internally !
+ //SimdVector3 he (halfExtents[0]-CONVEX_DISTANCE_MARGIN ,halfExtents[1]-CONVEX_DISTANCE_MARGIN ,halfExtents[2]-CONVEX_DISTANCE_MARGIN );
+ //he = he.absolute();
+
SimdVector3 he (halfExtents[0],halfExtents[1],halfExtents[2]);
+ he = he.absolute();
+
bm = new BoxShape(he);
bm->CalculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor);
@@ -929,7 +929,6 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj,
);
bm = new CylinderShapeZ(halfExtents);
bm->CalculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor);
- bm->SetMargin(0.05f);
break;
}
@@ -948,7 +947,6 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj,
bm = new ConeShape(objprop->m_boundobject.c.m_radius,objprop->m_boundobject.c.m_height);
bm->CalculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor);
- bm->SetMargin(0.05f);
break;
@@ -959,7 +957,6 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj,
if (bm)
{
bm->CalculateLocalInertia(ci.m_mass,ci.m_localInertiaTensor);
- bm->SetMargin(0.05f);
}
break;
}
@@ -1007,8 +1004,8 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj,
ci.m_restitution = smmaterial->m_restitution;
- ci.m_linearDamping = 0.5;//shapeprops->m_lin_drag;
- ci.m_angularDamping = 0.5f;//shapeprops->m_ang_drag;
+ ci.m_linearDamping = shapeprops->m_lin_drag;
+ ci.m_angularDamping = shapeprops->m_ang_drag;
KX_BulletPhysicsController* physicscontroller = new KX_BulletPhysicsController(ci,dyna);
env->addCcdPhysicsController( physicscontroller);