~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Lukas Fittl
  • Date: 2006-09-20 01:57:27 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060920015727-gmoqlxwstx9wwqs3
Tags: 2.42a-1ubuntu1
* Merge from Debian unstable (Closes: Malone #55903). Remaining changes:
  - debian/genpot: Add python scripts from Lee June <blender@eyou.com> to
    generate a reasonable PO template from the sources. Since gettext is used
    in a highly nonstandard way, xgettext does not work for this job.
  - debian/rules: Call the scripts, generate po/blender.pot, and clean it up
    in the clean target.
  - Add a proper header to the generated PO template.
* debian/control: Build depend on libavformat-dev >= 3:0.cvs20060823-3.1,
  otherwise this package will FTBFS

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