[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11131] branches/soc-2007-red_fox: Merge ( missed files during a previous merge) from /trunk/blender
Levi Schooley
redfox at hhofministries.org
Sat Jun 30 03:33:19 CEST 2007
Revision: 11131
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11131
Author: red_fox
Date: 2007-06-30 03:33:15 +0200 (Sat, 30 Jun 2007)
Log Message:
-----------
Merge (missed files during a previous merge) from /trunk/blender
OK, just to make things confusing, here are some files that apparently didn't make it through the merge process.
I don't know which revisions these belonged to.
Levi
Added Paths:
-----------
branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp
branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionShapes/btCapsuleShape.h
branches/soc-2007-red_fox/extern/bullet2/src/BulletDynamics/ConstraintSolver/btSolverBody.h
branches/soc-2007-red_fox/extern/bullet2/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h
branches/soc-2007-red_fox/release/scripts/export_m3g.py
branches/soc-2007-red_fox/release/scripts/scripttemplate_pyconstraint.py
branches/soc-2007-red_fox/source/blender/blenkernel/intern/verse_method.c
branches/soc-2007-red_fox/source/blender/include/BSE_editaction_types.h
branches/soc-2007-red_fox/source/blender/nodes/intern/CMP_nodes/CMP_invert.c
branches/soc-2007-red_fox/source/blender/nodes/intern/SHD_nodes/SHD_invert.c
branches/soc-2007-red_fox/source/blender/src/sculptmode-stroke.c
Added: branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp
===================================================================
--- branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp (rev 0)
+++ branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp 2007-06-30 01:33:15 UTC (rev 11131)
@@ -0,0 +1,146 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
+
+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.
+*/
+
+
+#include "btCapsuleShape.h"
+
+#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
+#include "LinearMath/btQuaternion.h"
+
+btCapsuleShape::btCapsuleShape(btScalar radius, btScalar height)
+{
+ m_implicitShapeDimensions.setValue(radius,0.5f*height,radius);
+}
+
+
+ btVector3 btCapsuleShape::localGetSupportingVertexWithoutMargin(const btVector3& vec0)const
+{
+
+ btVector3 supVec(0,0,0);
+
+ btScalar maxDot(btScalar(-1e30));
+
+ btVector3 vec = vec0;
+ btScalar lenSqr = vec.length2();
+ if (lenSqr < btScalar(0.0001))
+ {
+ vec.setValue(1,0,0);
+ } else
+ {
+ btScalar rlen = btScalar(1.) / btSqrt(lenSqr );
+ vec *= rlen;
+ }
+
+ btVector3 vtx;
+ btScalar newDot;
+
+ btScalar radius = getRadius();
+
+
+ {
+ btVector3 pos(0,getHalfHeight(),0);
+ vtx = pos +vec*m_localScaling*(radius) - vec * getMargin();
+ newDot = vec.dot(vtx);
+ if (newDot > maxDot)
+ {
+ maxDot = newDot;
+ supVec = vtx;
+ }
+ }
+ {
+ btVector3 pos(0,-getHalfHeight(),0);
+ vtx = pos +vec*m_localScaling*(radius) - vec * getMargin();
+ newDot = vec.dot(vtx);
+ if (newDot > maxDot)
+ {
+ maxDot = newDot;
+ supVec = vtx;
+ }
+ }
+
+ return supVec;
+
+}
+
+ void btCapsuleShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
+{
+
+
+ btScalar radius = getRadius();
+
+ for (int j=0;j<numVectors;j++)
+ {
+ btScalar maxDot(btScalar(-1e30));
+ const btVector3& vec = vectors[j];
+
+ btVector3 vtx;
+ btScalar newDot;
+ {
+ btVector3 pos(0,getHalfHeight(),0);
+ vtx = pos +vec*m_localScaling*(radius) - vec * getMargin();
+ newDot = vec.dot(vtx);
+ if (newDot > maxDot)
+ {
+ maxDot = newDot;
+ supportVerticesOut[j] = vtx;
+ }
+ }
+ {
+ btVector3 pos(0,-getHalfHeight(),0);
+ vtx = pos +vec*m_localScaling*(radius) - vec * getMargin();
+ newDot = vec.dot(vtx);
+ if (newDot > maxDot)
+ {
+ maxDot = newDot;
+ supportVerticesOut[j] = vtx;
+ }
+ }
+
+ }
+}
+
+
+void btCapsuleShape::calculateLocalInertia(btScalar mass,btVector3& inertia)
+{
+ //as an approximation, take the inertia of the box that bounds the spheres
+
+ btTransform ident;
+ ident.setIdentity();
+
+
+ btScalar radius = getRadius();
+
+ btVector3 halfExtents(radius,radius+getHalfHeight(),radius);
+
+ btScalar margin = CONVEX_DISTANCE_MARGIN;
+
+ btScalar lx=btScalar(2.)*(halfExtents[0]+margin);
+ btScalar ly=btScalar(2.)*(halfExtents[1]+margin);
+ btScalar lz=btScalar(2.)*(halfExtents[2]+margin);
+ const btScalar x2 = lx*lx;
+ const btScalar y2 = ly*ly;
+ const btScalar z2 = lz*lz;
+ const btScalar scaledmass = mass * btScalar(.08333333);
+
+ inertia[0] = scaledmass * (y2+z2);
+ inertia[1] = scaledmass * (x2+z2);
+ inertia[2] = scaledmass * (x2+y2);
+
+}
+
+
+
+
+
Added: branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionShapes/btCapsuleShape.h
===================================================================
--- branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionShapes/btCapsuleShape.h (rev 0)
+++ branches/soc-2007-red_fox/extern/bullet2/src/BulletCollision/CollisionShapes/btCapsuleShape.h 2007-06-30 01:33:15 UTC (rev 11131)
@@ -0,0 +1,60 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
+
+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.
+*/
+
+#ifndef BT_CAPSULE_SHAPE_H
+#define BT_CAPSULE_SHAPE_H
+
+#include "btConvexShape.h"
+#include "../BroadphaseCollision/btBroadphaseProxy.h" // for the types
+
+
+///btCapsuleShape represents a capsule around the Y axis
+///A more general solution that can represent capsules is the btMultiSphereShape
+class btCapsuleShape : public btConvexShape
+{
+
+public:
+ btCapsuleShape(btScalar radius,btScalar height);
+
+ ///CollisionShape Interface
+ virtual void calculateLocalInertia(btScalar mass,btVector3& inertia);
+
+ /// btConvexShape Interface
+ virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
+
+ virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
+
+ virtual int getShapeType() const { return CAPSULE_SHAPE_PROXYTYPE; }
+
+ virtual char* getName()const
+ {
+ return "CapsuleShape";
+ }
+
+ btScalar getRadius() const
+ {
+ return m_implicitShapeDimensions.getX();
+ }
+
+ btScalar getHalfHeight() const
+ {
+ return m_implicitShapeDimensions.getY();
+ }
+
+};
+
+
+
+#endif //BT_CAPSULE_SHAPE_H
Added: branches/soc-2007-red_fox/extern/bullet2/src/BulletDynamics/ConstraintSolver/btSolverBody.h
===================================================================
--- branches/soc-2007-red_fox/extern/bullet2/src/BulletDynamics/ConstraintSolver/btSolverBody.h (rev 0)
+++ branches/soc-2007-red_fox/extern/bullet2/src/BulletDynamics/ConstraintSolver/btSolverBody.h 2007-06-30 01:33:15 UTC (rev 11131)
@@ -0,0 +1,71 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
+
+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.
+*/
+
+#ifndef BT_SOLVER_BODY_H
+#define BT_SOLVER_BODY_H
+
+class btRigidBody;
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btMatrix3x3.h"
+
+
+
+
+ATTRIBUTE_ALIGNED16 (struct) btSolverBody
+{
+ btVector3 m_centerOfMassPosition;
+ btVector3 m_linearVelocity;
+ btVector3 m_angularVelocity;
+ btRigidBody* m_originalBody;
+ float m_invMass;
+ float m_friction;
+ float m_angularFactor;
+
+ inline void getVelocityInLocalPoint(const btVector3& rel_pos, btVector3& velocity ) const
+ {
+ velocity = m_linearVelocity + m_angularVelocity.cross(rel_pos);
+ }
+
+ //Optimization for the iterative solver: avoid calculating constant terms involving inertia, normal, relative position
+ inline void internalApplyImpulse(const btVector3& linearComponent, const btVector3& angularComponent,btScalar impulseMagnitude)
+ {
+ m_linearVelocity += linearComponent*impulseMagnitude;
+ m_angularVelocity += angularComponent*impulseMagnitude*m_angularFactor;
+ }
+
+ void writebackVelocity()
+ {
+ if (m_invMass)
+ {
+ m_originalBody->setLinearVelocity(m_linearVelocity);
+ m_originalBody->setAngularVelocity(m_angularVelocity);
+ }
+ }
+
+ void readVelocity()
+ {
+ if (m_invMass)
+ {
+ m_linearVelocity = m_originalBody->getLinearVelocity();
+ m_angularVelocity = m_originalBody->getAngularVelocity();
+ }
+ }
+
+
+
+
+};
+
+#endif //BT_SOLVER_BODY_H
Added: branches/soc-2007-red_fox/extern/bullet2/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h
===================================================================
--- branches/soc-2007-red_fox/extern/bullet2/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h (rev 0)
+++ branches/soc-2007-red_fox/extern/bullet2/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h 2007-06-30 01:33:15 UTC (rev 11131)
@@ -0,0 +1,63 @@
+
+
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
+
+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:
+
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list