Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/questsystem5/src/bullet/BulletCollision/CollisionDispatch/btCollisionObject.cpp @ 2961

Last change on this file since 2961 was 2908, checked in by dafrick, 16 years ago

Reverted to revision 2906 (because I'm too stupid to merge correctly, 2nd try will follow shortly. ;))

  • Property svn:eol-style set to native
File size: 2.0 KB
Line 
1/*
2Bullet Continuous Collision Detection and Physics Library
3Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
4
5This software is provided 'as-is', without any express or implied warranty.
6In no event will the authors be held liable for any damages arising from the use of this software.
7Permission is granted to anyone to use this software for any purpose,
8including commercial applications, and to alter it and redistribute it freely,
9subject to the following restrictions:
10
111. 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.
122. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
133. This notice may not be removed or altered from any source distribution.
14*/
15
16
17#include "btCollisionObject.h"
18
19btCollisionObject::btCollisionObject()
20        :       m_broadphaseHandle(0),
21                m_collisionShape(0),
22                m_rootCollisionShape(0),
23                m_collisionFlags(btCollisionObject::CF_STATIC_OBJECT),
24                m_islandTag1(-1),
25                m_companionId(-1),
26                m_activationState1(1),
27                m_deactivationTime(btScalar(0.)),
28                m_friction(btScalar(0.5)),
29                m_restitution(btScalar(0.)),
30                m_userObjectPointer(0),
31                m_internalType(CO_COLLISION_OBJECT),
32                m_hitFraction(btScalar(1.)),
33                m_ccdSweptSphereRadius(btScalar(0.)),
34                m_ccdMotionThreshold(btScalar(0.)),
35                m_checkCollideWith(false)
36{
37       
38}
39
40btCollisionObject::~btCollisionObject()
41{
42}
43
44void btCollisionObject::setActivationState(int newState) 
45{ 
46        if ( (m_activationState1 != DISABLE_DEACTIVATION) && (m_activationState1 != DISABLE_SIMULATION))
47                m_activationState1 = newState;
48}
49
50void btCollisionObject::forceActivationState(int newState)
51{
52        m_activationState1 = newState;
53}
54
55void btCollisionObject::activate(bool forceActivation)
56{
57        if (forceActivation || !(m_collisionFlags & (CF_STATIC_OBJECT|CF_KINEMATIC_OBJECT)))
58        {
59                setActivationState(ACTIVE_TAG);
60                m_deactivationTime = btScalar(0.);
61        }
62}
63
64
65
Note: See TracBrowser for help on using the repository browser.