diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2006-04-13 09:11:34 +0400 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2006-04-13 09:11:34 +0400 |
commit | 13e0d22d8941feadad46882390f3aaf51a0278cf (patch) | |
tree | d88ec50d45ec513bcea3849eb83f87402852664f /source/gameengine/Ketsji | |
parent | 92fd18e5c2861f3b87df099a35b87807b50ff78d (diff) |
a lot of work in a few small changes to improve penetration depth. and some fixes in shaders from Charlie.
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r-- | source/gameengine/Ketsji/BL_Shader.cpp | 3 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 37 |
2 files changed, 40 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp index 4a664589871..ce0809628ce 100644 --- a/source/gameengine/Ketsji/BL_Shader.cpp +++ b/source/gameengine/Ketsji/BL_Shader.cpp @@ -470,6 +470,9 @@ void BL_Shader::Update( const KX_MeshSlot & ms, RAS_IRasterizer* rasty ) MT_Matrix4x4 view; rasty->GetViewMatrix(view); + if(mAttr==SHD_TANGENT) + ms.m_mesh->SetMeshModified(true); + BL_UniformVecDef::iterator it; for(it = mPreDef.begin(); it!= mPreDef.end(); it++) { diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index 8f3a6a2470c..82f035c4763 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -676,6 +676,16 @@ void KX_ConvertODEEngineObject(KX_GameObject* gameobj, #include "CollisionShapes/TriangleMeshShape.h" #include "CollisionShapes/BvhTriangleMeshShape.h" + #ifdef WIN32 +#if _MSC_VER >= 1310 +//only use SIMD Hull code under Win32 +#define USE_HULL 1 + +#include "NarrowPhaseCollision/Hull.h" + +#endif //_MSC_VER +#endif //WIN32 + static GEN_Map<GEN_HashedPtr,CollisionShape*> map_gamemesh_to_bulletshape; @@ -1010,6 +1020,33 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, bm->SetMargin(0.06); +#ifdef TEST_SIMD_HULL + if (bm->IsPolyhedral()) + { + PolyhedralConvexShape* polyhedron = static_cast<PolyhedralConvexShape*>(bm); + if (!polyhedron->m_optionalHull) + { + //first convert vertices in 'Point3' format + int numPoints = polyhedron->GetNumVertices(); + Point3* points = new Point3[numPoints+1]; + //first 4 points should not be co-planar, so add central point to satisfy MakeHull + points[0] = Point3(0.f,0.f,0.f); + + SimdVector3 vertex; + for (int p=0;p<numPoints;p++) + { + polyhedron->GetVertex(p,vertex); + points[p+1] = Point3(vertex.getX(),vertex.getY(),vertex.getZ()); + } + + Hull* hull = Hull::MakeHull(numPoints+1,points); + polyhedron->m_optionalHull = hull; + } + + } +#endif //TEST_SIMD_HULL + + ci.m_collisionShape = bm; |