~ubuntu-branches/ubuntu/intrepid/blender/intrepid-updates

« back to all changes in this revision

Viewing changes to extern/bullet/Bullet/CollisionDispatch/CollisionObject.h

  • Committer: Bazaar Package Importer
  • Author(s): Cyril Brulebois
  • Date: 2008-08-08 02:45:40 UTC
  • mfrom: (12.1.14 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080808024540-kkjp7ekfivzhuw3l
Tags: 2.46+dfsg-4
* Fix python syntax warning in import_dxf.py, which led to nasty output
  in installation/upgrade logs during byte-compilation, using a patch
  provided by the script author (Closes: #492280):
   - debian/patches/45_fix_python_syntax_warning

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
Bullet Continuous Collision Detection and Physics Library
3
 
Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
4
 
 
5
 
This software is provided 'as-is', without any express or implied warranty.
6
 
In no event will the authors be held liable for any damages arising from the use of this software.
7
 
Permission is granted to anyone to use this software for any purpose, 
8
 
including commercial applications, and to alter it and redistribute it freely, 
9
 
subject to the following restrictions:
10
 
 
11
 
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.
12
 
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13
 
3. This notice may not be removed or altered from any source distribution.
14
 
*/
15
 
 
16
 
#ifndef COLLISION_OBJECT_H
17
 
#define COLLISION_OBJECT_H
18
 
 
19
 
#include "SimdTransform.h"
20
 
 
21
 
//island management, m_activationState1
22
 
#define ACTIVE_TAG 1
23
 
#define ISLAND_SLEEPING 2
24
 
#define WANTS_DEACTIVATION 3
25
 
#define DISABLE_DEACTIVATION 4
26
 
#define DISABLE_SIMULATION 5
27
 
 
28
 
struct  BroadphaseProxy;
29
 
class   CollisionShape;
30
 
 
31
 
struct  CollisionObject
32
 
{
33
 
        SimdTransform   m_worldTransform;
34
 
        
35
 
        //m_interpolationWorldTransform is used for CCD and interpolation
36
 
        //it can be either previous or future (predicted) transform
37
 
        SimdTransform   m_interpolationWorldTransform;
38
 
        
39
 
        enum CollisionFlags
40
 
        {
41
 
                isStatic = 1,
42
 
                noContactResponse = 2,
43
 
 
44
 
        };
45
 
 
46
 
        int                             m_collisionFlags;
47
 
 
48
 
        int                             m_islandTag1;
49
 
        int                             m_activationState1;
50
 
        float                   m_deactivationTime;
51
 
 
52
 
        BroadphaseProxy*        m_broadphaseHandle;
53
 
        CollisionShape*         m_collisionShape;
54
 
 
55
 
        void*                   m_userPointer;//not use by Bullet internally
56
 
 
57
 
        //time of impact calculation
58
 
        float                   m_hitFraction; 
59
 
 
60
 
        bool                    mergesSimulationIslands() const;
61
 
 
62
 
        inline bool             IsStatic() const {
63
 
                return m_collisionFlags & isStatic;
64
 
        }
65
 
 
66
 
        inline bool             HasContactResponse() {
67
 
                return !(m_collisionFlags & noContactResponse);
68
 
        }
69
 
 
70
 
        
71
 
 
72
 
 
73
 
        CollisionObject();
74
 
 
75
 
 
76
 
        void    SetCollisionShape(CollisionShape* collisionShape)
77
 
        {
78
 
                m_collisionShape = collisionShape;
79
 
        }
80
 
 
81
 
        int     GetActivationState() const { return m_activationState1;}
82
 
        
83
 
        void SetActivationState(int newState);
84
 
 
85
 
        void ForceActivationState(int newState);
86
 
 
87
 
        void    activate();
88
 
 
89
 
        inline bool IsActive() const
90
 
        {
91
 
                return ((GetActivationState() != ISLAND_SLEEPING) && (GetActivationState() != DISABLE_SIMULATION));
92
 
        }
93
 
 
94
 
 
95
 
};
96
 
 
97
 
#endif //COLLISION_OBJECT_H