~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to extern/bullet/Bullet/CollisionShapes/MinkowskiSumShape.cpp

Tags: upstream-2.40
ImportĀ upstreamĀ versionĀ 2.40

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2005 Erwin Coumans http://continuousphysics.com/Bullet/
 
3
 *
 
4
 * Permission to use, copy, modify, distribute and sell this software
 
5
 * and its documentation for any purpose is hereby granted without fee,
 
6
 * provided that the above copyright notice appear in all copies.
 
7
 * Erwin Coumans makes no representations about the suitability 
 
8
 * of this software for any purpose.  
 
9
 * It is provided "as is" without express or implied warranty.
 
10
*/
 
11
#include "MinkowskiSumShape.h"
 
12
 
 
13
 
 
14
MinkowskiSumShape::MinkowskiSumShape(ConvexShape* shapeA,ConvexShape* shapeB)
 
15
:m_shapeA(shapeA),
 
16
m_shapeB(shapeB)
 
17
{
 
18
        m_transA.setIdentity();
 
19
        m_transB.setIdentity();
 
20
}
 
21
 
 
22
SimdVector3 MinkowskiSumShape::LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec)const
 
23
{
 
24
        SimdVector3 supVertexA = m_transA(m_shapeA->LocalGetSupportingVertexWithoutMargin(vec*m_transA.getBasis()));
 
25
        SimdVector3 supVertexB = m_transB(m_shapeB->LocalGetSupportingVertexWithoutMargin(vec*m_transB.getBasis()));
 
26
        return supVertexA + supVertexB;
 
27
}
 
28
 
 
29
float   MinkowskiSumShape::GetMargin() const
 
30
{
 
31
        return m_shapeA->GetMargin() + m_shapeB->GetMargin();
 
32
}
 
33
 
 
34
 
 
35
void    MinkowskiSumShape::CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia)
 
36
{
 
37
        assert(0);
 
38
        inertia.setValue(0,0,0);
 
39
}