[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47663] branches/soc-2011-tomato: Merging r47624 through r47661 from trunk into soc-2011-tomato
Sergey Sharybin
sergey.vfx at gmail.com
Sun Jun 10 11:44:37 CEST 2012
Revision: 47663
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47663
Author: nazgul
Date: 2012-06-10 09:44:26 +0000 (Sun, 10 Jun 2012)
Log Message:
-----------
Merging r47624 through r47661 from trunk into soc-2011-tomato
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47624
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47661
Modified Paths:
--------------
branches/soc-2011-tomato/extern/bullet2/src/BulletCollision/CollisionShapes/btConvexPolyhedron.cpp
branches/soc-2011-tomato/extern/bullet2/src/BulletCollision/CollisionShapes/btConvexPolyhedron.h
branches/soc-2011-tomato/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp
branches/soc-2011-tomato/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.h
branches/soc-2011-tomato/extern/bullet2/src/LinearMath/btConvexHullComputer.cpp
branches/soc-2011-tomato/extern/bullet2/src/LinearMath/btConvexHullComputer.h
branches/soc-2011-tomato/extern/bullet2/src/LinearMath/btGrahamScan2dConvexHull.h
branches/soc-2011-tomato/intern/cycles/app/cycles_test.cpp
branches/soc-2011-tomato/intern/cycles/app/cycles_xml.cpp
branches/soc-2011-tomato/intern/cycles/blender/blender_camera.cpp
branches/soc-2011-tomato/intern/cycles/blender/blender_mesh.cpp
branches/soc-2011-tomato/intern/cycles/blender/blender_object.cpp
branches/soc-2011-tomato/intern/cycles/blender/blender_particles.cpp
branches/soc-2011-tomato/intern/cycles/blender/blender_python.cpp
branches/soc-2011-tomato/intern/cycles/blender/blender_session.cpp
branches/soc-2011-tomato/intern/cycles/blender/blender_shader.cpp
branches/soc-2011-tomato/intern/cycles/blender/blender_sync.cpp
branches/soc-2011-tomato/intern/cycles/blender/blender_util.h
branches/soc-2011-tomato/intern/cycles/bvh/bvh.cpp
branches/soc-2011-tomato/intern/cycles/bvh/bvh.h
branches/soc-2011-tomato/intern/cycles/bvh/bvh_binning.cpp
branches/soc-2011-tomato/intern/cycles/bvh/bvh_build.cpp
branches/soc-2011-tomato/intern/cycles/bvh/bvh_node.cpp
branches/soc-2011-tomato/intern/cycles/bvh/bvh_params.h
branches/soc-2011-tomato/intern/cycles/bvh/bvh_sort.h
branches/soc-2011-tomato/intern/cycles/device/device.cpp
branches/soc-2011-tomato/intern/cycles/device/device_cpu.cpp
branches/soc-2011-tomato/intern/cycles/device/device_cuda.cpp
branches/soc-2011-tomato/intern/cycles/device/device_network.h
branches/soc-2011-tomato/intern/cycles/device/device_opencl.cpp
branches/soc-2011-tomato/intern/cycles/kernel/kernel_accumulate.h
branches/soc-2011-tomato/intern/cycles/kernel/kernel_bvh.h
branches/soc-2011-tomato/intern/cycles/kernel/kernel_compat_cpu.h
branches/soc-2011-tomato/intern/cycles/kernel/kernel_differential.h
branches/soc-2011-tomato/intern/cycles/kernel/kernel_emission.h
branches/soc-2011-tomato/intern/cycles/kernel/kernel_globals.h
branches/soc-2011-tomato/intern/cycles/kernel/kernel_light.h
branches/soc-2011-tomato/intern/cycles/kernel/kernel_montecarlo.h
branches/soc-2011-tomato/intern/cycles/kernel/kernel_optimized.cpp
branches/soc-2011-tomato/intern/cycles/kernel/kernel_path.h
branches/soc-2011-tomato/intern/cycles/kernel/kernel_projection.h
branches/soc-2011-tomato/intern/cycles/kernel/kernel_random.h
branches/soc-2011-tomato/intern/cycles/kernel/kernel_triangle.h
branches/soc-2011-tomato/intern/cycles/kernel/osl/nodes/node_fresnel.h
branches/soc-2011-tomato/intern/cycles/kernel/osl/osl_services.cpp
branches/soc-2011-tomato/intern/cycles/kernel/osl/osl_services.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/bsdf.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/bsdf_ashikhmin_velvet.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/bsdf_diffuse.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/bsdf_microfacet.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/bsdf_reflection.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/bsdf_refraction.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/bsdf_transparent.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/bsdf_ward.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/bsdf_westin.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/emissive.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/svm_closure.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/svm_gradient.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/svm_image.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/svm_magic.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/svm_mix.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/svm_musgrave.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/svm_noise.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/svm_texture.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/svm_types.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/svm_voronoi.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/svm_wave.h
branches/soc-2011-tomato/intern/cycles/kernel/svm/volume.h
branches/soc-2011-tomato/intern/cycles/render/attribute.cpp
branches/soc-2011-tomato/intern/cycles/render/buffers.cpp
branches/soc-2011-tomato/intern/cycles/render/buffers.h
branches/soc-2011-tomato/intern/cycles/render/camera.cpp
branches/soc-2011-tomato/intern/cycles/render/camera.h
branches/soc-2011-tomato/intern/cycles/render/film.cpp
branches/soc-2011-tomato/intern/cycles/render/filter.cpp
branches/soc-2011-tomato/intern/cycles/render/graph.cpp
branches/soc-2011-tomato/intern/cycles/render/image.cpp
branches/soc-2011-tomato/intern/cycles/render/light.cpp
branches/soc-2011-tomato/intern/cycles/render/mesh.cpp
branches/soc-2011-tomato/intern/cycles/render/nodes.cpp
branches/soc-2011-tomato/intern/cycles/render/nodes.h
branches/soc-2011-tomato/intern/cycles/render/object.cpp
branches/soc-2011-tomato/intern/cycles/render/osl.cpp
branches/soc-2011-tomato/intern/cycles/render/session.cpp
branches/soc-2011-tomato/intern/cycles/render/shader.cpp
branches/soc-2011-tomato/intern/cycles/render/shader.h
branches/soc-2011-tomato/intern/cycles/render/svm.cpp
branches/soc-2011-tomato/intern/cycles/subd/subd_build.cpp
branches/soc-2011-tomato/intern/cycles/subd/subd_dice.cpp
branches/soc-2011-tomato/intern/cycles/subd/subd_ring.cpp
branches/soc-2011-tomato/intern/cycles/subd/subd_split.cpp
branches/soc-2011-tomato/intern/cycles/util/util_color.h
branches/soc-2011-tomato/intern/cycles/util/util_cuda.cpp
branches/soc-2011-tomato/intern/cycles/util/util_cuda.h
branches/soc-2011-tomato/intern/cycles/util/util_hash.h
branches/soc-2011-tomato/intern/cycles/util/util_math.h
branches/soc-2011-tomato/intern/cycles/util/util_md5.cpp
branches/soc-2011-tomato/intern/cycles/util/util_md5.h
branches/soc-2011-tomato/intern/cycles/util/util_opencl.cpp
branches/soc-2011-tomato/intern/cycles/util/util_opencl.h
branches/soc-2011-tomato/intern/cycles/util/util_path.cpp
branches/soc-2011-tomato/intern/cycles/util/util_system.cpp
branches/soc-2011-tomato/intern/cycles/util/util_task.cpp
branches/soc-2011-tomato/intern/cycles/util/util_thread.h
branches/soc-2011-tomato/intern/cycles/util/util_transform.cpp
branches/soc-2011-tomato/intern/cycles/util/util_transform.h
branches/soc-2011-tomato/intern/cycles/util/util_view.cpp
branches/soc-2011-tomato/release/scripts/modules/bpy/utils.py
branches/soc-2011-tomato/source/blender/blenkernel/BKE_gpencil.h
branches/soc-2011-tomato/source/blender/blenkernel/BKE_image.h
branches/soc-2011-tomato/source/blender/blenkernel/intern/constraint.c
branches/soc-2011-tomato/source/blender/blenkernel/intern/gpencil.c
branches/soc-2011-tomato/source/blender/blenkernel/intern/image.c
branches/soc-2011-tomato/source/blender/blenlib/BLI_string_cursor_utf8.h
branches/soc-2011-tomato/source/blender/bmesh/operators/bmo_mesh_conv.c
branches/soc-2011-tomato/source/blender/bmesh/operators/bmo_triangulate.c
branches/soc-2011-tomato/source/blender/bmesh/operators/bmo_utils.c
branches/soc-2011-tomato/source/blender/compositor/CMakeLists.txt
branches/soc-2011-tomato/source/blender/compositor/intern/COM_ChunkOrderHotspot.cpp
branches/soc-2011-tomato/source/blender/compositor/intern/COM_MemoryBuffer.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_BokehBlurOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_BokehImageOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_BoxMaskOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_ChangeHSVOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_ColorBalanceASCCDLOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_ColorCorrectionOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_ColorCurveOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_DifferenceMatteOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_EllipseMaskOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_FogGlowImageOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_GammaOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_MapUVOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_MathBaseOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_RotateOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_TonemapOperation.cpp
branches/soc-2011-tomato/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
branches/soc-2011-tomato/source/blender/editors/gpencil/editaction_gpencil.c
branches/soc-2011-tomato/source/blender/editors/include/ED_gpencil.h
branches/soc-2011-tomato/source/blender/editors/include/ED_mask.h
branches/soc-2011-tomato/source/blender/editors/include/ED_transform.h
branches/soc-2011-tomato/source/blender/editors/mask/mask_edit.c
branches/soc-2011-tomato/source/blender/editors/mask/mask_editaction.c
branches/soc-2011-tomato/source/blender/editors/mask/mask_relationships.c
branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_tools.c
branches/soc-2011-tomato/source/blender/editors/object/object_relations.c
branches/soc-2011-tomato/source/blender/editors/space_action/action_edit.c
branches/soc-2011-tomato/source/blender/editors/space_action/action_select.c
branches/soc-2011-tomato/source/blender/editors/space_clip/clip_dopesheet_draw.c
branches/soc-2011-tomato/source/blender/editors/space_clip/clip_dopesheet_ops.c
branches/soc-2011-tomato/source/blender/editors/space_clip/tracking_ops.c
branches/soc-2011-tomato/source/blender/editors/space_node/drawnode.c
branches/soc-2011-tomato/source/blender/editors/transform/transform.c
branches/soc-2011-tomato/source/blender/makesdna/DNA_constraint_types.h
branches/soc-2011-tomato/source/blender/makesrna/intern/makesrna.c
branches/soc-2011-tomato/source/blender/makesrna/intern/rna_constraint.c
branches/soc-2011-tomato/source/blender/makesrna/intern/rna_sequencer_api.c
branches/soc-2011-tomato/source/blender/nodes/composite/nodes/node_composite_bokehblur.c
branches/soc-2011-tomato/source/blender/nodes/composite/nodes/node_composite_bokehimage.c
branches/soc-2011-tomato/source/blender/nodes/composite/nodes/node_composite_boxmask.c
branches/soc-2011-tomato/source/blender/nodes/composite/nodes/node_composite_ellipsemask.c
branches/soc-2011-tomato/source/blender/nodes/composite/nodes/node_composite_switch.c
branches/soc-2011-tomato/source/blender/python/bmesh/bmesh_py_utils.c
branches/soc-2011-tomato/source/blender/python/intern/bpy_interface.c
branches/soc-2011-tomato/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
branches/soc-2011-tomato/source/tools/check_style_c.py
Property Changed:
----------------
branches/soc-2011-tomato/
branches/soc-2011-tomato/extern/bullet2/src/BulletCollision/CollisionShapes/btConvexPolyhedron.cpp
branches/soc-2011-tomato/extern/bullet2/src/BulletCollision/CollisionShapes/btConvexPolyhedron.h
branches/soc-2011-tomato/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp
branches/soc-2011-tomato/extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.h
branches/soc-2011-tomato/extern/bullet2/src/LinearMath/btConvexHullComputer.cpp
branches/soc-2011-tomato/extern/bullet2/src/LinearMath/btConvexHullComputer.h
branches/soc-2011-tomato/extern/bullet2/src/LinearMath/btGrahamScan2dConvexHull.h
branches/soc-2011-tomato/intern/cycles/blender/blender_particles.cpp
branches/soc-2011-tomato/release/datafiles/clkernelstoh.py
branches/soc-2011-tomato/source/blender/editors/interface/interface.c
branches/soc-2011-tomato/source/blender/editors/space_outliner/
branches/soc-2011-tomato/source/blender/nodes/shader/nodes/node_shader_particle_info.c
Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-47623
+ /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-47661
Modified: branches/soc-2011-tomato/extern/bullet2/src/BulletCollision/CollisionShapes/btConvexPolyhedron.cpp
===================================================================
--- branches/soc-2011-tomato/extern/bullet2/src/BulletCollision/CollisionShapes/btConvexPolyhedron.cpp 2012-06-10 09:30:31 UTC (rev 47662)
+++ branches/soc-2011-tomato/extern/bullet2/src/BulletCollision/CollisionShapes/btConvexPolyhedron.cpp 2012-06-10 09:44:26 UTC (rev 47663)
@@ -1,296 +1,296 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2011 Advanced Micro Devices, Inc. http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-///This file was written by Erwin Coumans
-///Separating axis rest based on work from Pierre Terdiman, see
-///And contact clipping based on work from Simon Hobbs
-
-#include "btConvexPolyhedron.h"
-#include "LinearMath/btHashMap.h"
-
-btConvexPolyhedron::btConvexPolyhedron()
-{
-
-}
-btConvexPolyhedron::~btConvexPolyhedron()
-{
-
-}
-
-
-inline bool IsAlmostZero(const btVector3& v)
-{
- if(fabsf(v.x())>1e-6 || fabsf(v.y())>1e-6 || fabsf(v.z())>1e-6) return false;
- return true;
-}
-
-struct btInternalVertexPair
-{
- btInternalVertexPair(short int v0,short int v1)
- :m_v0(v0),
- m_v1(v1)
- {
- if (m_v1>m_v0)
- btSwap(m_v0,m_v1);
- }
- short int m_v0;
- short int m_v1;
- int getHash() const
- {
- return m_v0+(m_v1<<16);
- }
- bool equals(const btInternalVertexPair& other) const
- {
- return m_v0==other.m_v0 && m_v1==other.m_v1;
- }
-};
-
-struct btInternalEdge
-{
- btInternalEdge()
- :m_face0(-1),
- m_face1(-1)
- {
- }
- short int m_face0;
- short int m_face1;
-};
-
-//
-
-#ifdef TEST_INTERNAL_OBJECTS
-bool btConvexPolyhedron::testContainment() const
-{
- for(int p=0;p<8;p++)
- {
- btVector3 LocalPt;
- if(p==0) LocalPt = m_localCenter + btVector3(m_extents[0], m_extents[1], m_extents[2]);
- else if(p==1) LocalPt = m_localCenter + btVector3(m_extents[0], m_extents[1], -m_extents[2]);
- else if(p==2) LocalPt = m_localCenter + btVector3(m_extents[0], -m_extents[1], m_extents[2]);
- else if(p==3) LocalPt = m_localCenter + btVector3(m_extents[0], -m_extents[1], -m_extents[2]);
- else if(p==4) LocalPt = m_localCenter + btVector3(-m_extents[0], m_extents[1], m_extents[2]);
- else if(p==5) LocalPt = m_localCenter + btVector3(-m_extents[0], m_extents[1], -m_extents[2]);
- else if(p==6) LocalPt = m_localCenter + btVector3(-m_extents[0], -m_extents[1], m_extents[2]);
- else if(p==7) LocalPt = m_localCenter + btVector3(-m_extents[0], -m_extents[1], -m_extents[2]);
-
- for(int i=0;i<m_faces.size();i++)
- {
- const btVector3 Normal(m_faces[i].m_plane[0], m_faces[i].m_plane[1], m_faces[i].m_plane[2]);
- const btScalar d = LocalPt.dot(Normal) + m_faces[i].m_plane[3];
- if(d>0.0f)
- return false;
- }
- }
- return true;
-}
-#endif
-
-void btConvexPolyhedron::initialize()
-{
-
- btHashMap<btInternalVertexPair,btInternalEdge> edges;
-
- btScalar TotalArea = 0.0f;
-
- m_localCenter.setValue(0, 0, 0);
- for(int i=0;i<m_faces.size();i++)
- {
- int numVertices = m_faces[i].m_indices.size();
- int NbTris = numVertices;
- for(int j=0;j<NbTris;j++)
- {
- int k = (j+1)%numVertices;
- btInternalVertexPair vp(m_faces[i].m_indices[j],m_faces[i].m_indices[k]);
- btInternalEdge* edptr = edges.find(vp);
- btVector3 edge = m_vertices[vp.m_v1]-m_vertices[vp.m_v0];
- edge.normalize();
-
- bool found = false;
-
- for (int p=0;p<m_uniqueEdges.size();p++)
- {
-
- if (IsAlmostZero(m_uniqueEdges[p]-edge) ||
- IsAlmostZero(m_uniqueEdges[p]+edge))
- {
- found = true;
- break;
- }
- }
-
- if (!found)
- {
- m_uniqueEdges.push_back(edge);
- }
-
- if (edptr)
- {
- btAssert(edptr->m_face0>=0);
- btAssert(edptr->m_face1<0);
- edptr->m_face1 = i;
- } else
- {
- btInternalEdge ed;
- ed.m_face0 = i;
- edges.insert(vp,ed);
- }
- }
- }
-
-#ifdef USE_CONNECTED_FACES
- for(int i=0;i<m_faces.size();i++)
- {
- int numVertices = m_faces[i].m_indices.size();
- m_faces[i].m_connectedFaces.resize(numVertices);
-
- for(int j=0;j<numVertices;j++)
- {
- int k = (j+1)%numVertices;
- btInternalVertexPair vp(m_faces[i].m_indices[j],m_faces[i].m_indices[k]);
- btInternalEdge* edptr = edges.find(vp);
- btAssert(edptr);
- btAssert(edptr->m_face0>=0);
- btAssert(edptr->m_face1>=0);
-
- int connectedFace = (edptr->m_face0==i)?edptr->m_face1:edptr->m_face0;
- m_faces[i].m_connectedFaces[j] = connectedFace;
- }
- }
-#endif//USE_CONNECTED_FACES
-
- for(int i=0;i<m_faces.size();i++)
- {
- int numVertices = m_faces[i].m_indices.size();
- int NbTris = numVertices-2;
-
- const btVector3& p0 = m_vertices[m_faces[i].m_indices[0]];
- for(int j=1;j<=NbTris;j++)
- {
- int k = (j+1)%numVertices;
- const btVector3& p1 = m_vertices[m_faces[i].m_indices[j]];
- const btVector3& p2 = m_vertices[m_faces[i].m_indices[k]];
- btScalar Area = ((p0 - p1).cross(p0 - p2)).length() * 0.5f;
- btVector3 Center = (p0+p1+p2)/3.0f;
- m_localCenter += Area * Center;
- TotalArea += Area;
- }
- }
- m_localCenter /= TotalArea;
-
-
-
-
-#ifdef TEST_INTERNAL_OBJECTS
- if(1)
- {
- m_radius = FLT_MAX;
- for(int i=0;i<m_faces.size();i++)
- {
- const btVector3 Normal(m_faces[i].m_plane[0], m_faces[i].m_plane[1], m_faces[i].m_plane[2]);
- const btScalar dist = btFabs(m_localCenter.dot(Normal) + m_faces[i].m_plane[3]);
- if(dist<m_radius)
- m_radius = dist;
- }
-
-
- btScalar MinX = FLT_MAX;
- btScalar MinY = FLT_MAX;
- btScalar MinZ = FLT_MAX;
- btScalar MaxX = -FLT_MAX;
- btScalar MaxY = -FLT_MAX;
- btScalar MaxZ = -FLT_MAX;
- for(int i=0; i<m_vertices.size(); i++)
- {
- const btVector3& pt = m_vertices[i];
- if(pt.x()<MinX) MinX = pt.x();
- if(pt.x()>MaxX) MaxX = pt.x();
- if(pt.y()<MinY) MinY = pt.y();
- if(pt.y()>MaxY) MaxY = pt.y();
- if(pt.z()<MinZ) MinZ = pt.z();
- if(pt.z()>MaxZ) MaxZ = pt.z();
- }
- mC.setValue(MaxX+MinX, MaxY+MinY, MaxZ+MinZ);
- mE.setValue(MaxX-MinX, MaxY-MinY, MaxZ-MinZ);
-
-
-
-// const btScalar r = m_radius / sqrtf(2.0f);
- const btScalar r = m_radius / sqrtf(3.0f);
- const int LargestExtent = mE.maxAxis();
- const btScalar Step = (mE[LargestExtent]*0.5f - r)/1024.0f;
- m_extents[0] = m_extents[1] = m_extents[2] = r;
- m_extents[LargestExtent] = mE[LargestExtent]*0.5f;
- bool FoundBox = false;
- for(int j=0;j<1024;j++)
- {
- if(testContainment())
- {
- FoundBox = true;
- break;
- }
-
- m_extents[LargestExtent] -= Step;
- }
- if(!FoundBox)
- {
- m_extents[0] = m_extents[1] = m_extents[2] = r;
- }
- else
- {
- // Refine the box
- const btScalar Step = (m_radius - r)/1024.0f;
- const int e0 = (1<<LargestExtent) & 3;
- const int e1 = (1<<e0) & 3;
-
- for(int j=0;j<1024;j++)
- {
- const btScalar Saved0 = m_extents[e0];
- const btScalar Saved1 = m_extents[e1];
- m_extents[e0] += Step;
- m_extents[e1] += Step;
-
- if(!testContainment())
- {
- m_extents[e0] = Saved0;
- m_extents[e1] = Saved1;
- break;
- }
- }
- }
- }
-#endif
-}
-
-
-void btConvexPolyhedron::project(const btTransform& trans, const btVector3& dir, btScalar& min, btScalar& max) const
-{
- min = FLT_MAX;
- max = -FLT_MAX;
- int numVerts = m_vertices.size();
- for(int i=0;i<numVerts;i++)
- {
- btVector3 pt = trans * m_vertices[i];
- btScalar dp = pt.dot(dir);
- if(dp < min) min = dp;
- if(dp > max) max = dp;
- }
- if(min>max)
- {
- btScalar tmp = min;
- min = max;
- max = tmp;
- }
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2011 Advanced Micro Devices, Inc. http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+///This file was written by Erwin Coumans
+///Separating axis rest based on work from Pierre Terdiman, see
+///And contact clipping based on work from Simon Hobbs
+
+#include "btConvexPolyhedron.h"
+#include "LinearMath/btHashMap.h"
+
+btConvexPolyhedron::btConvexPolyhedron()
+{
+
+}
+btConvexPolyhedron::~btConvexPolyhedron()
+{
+
+}
+
+
+inline bool IsAlmostZero(const btVector3& v)
+{
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list