Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/kicklib/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionObject.cpp @ 7957

Last change on this file since 7957 was 5781, checked in by rgrieder, 15 years ago

Reverted trunk again. We might want to find a way to delete these revisions again (x3n's changes are still available as diff in the commit mails).

  • Property svn:eol-style set to native
File size: 2.1 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_anisotropicFriction(1.f,1.f,1.f),
21        m_hasAnisotropicFriction(false),
22        m_contactProcessingThreshold(1e30f),
23                m_broadphaseHandle(0),
24                m_collisionShape(0),
25                m_rootCollisionShape(0),
26                m_collisionFlags(btCollisionObject::CF_STATIC_OBJECT),
27                m_islandTag1(-1),
28                m_companionId(-1),
29                m_activationState1(1),
30                m_deactivationTime(btScalar(0.)),
31                m_friction(btScalar(0.5)),
32                m_restitution(btScalar(0.)),
33                m_userObjectPointer(0),
34                m_internalType(CO_COLLISION_OBJECT),
35                m_hitFraction(btScalar(1.)),
36                m_ccdSweptSphereRadius(btScalar(0.)),
37                m_ccdMotionThreshold(btScalar(0.)),
38                m_checkCollideWith(false)
39{
40       
41}
42
43btCollisionObject::~btCollisionObject()
44{
45}
46
47void btCollisionObject::setActivationState(int newState) 
48{ 
49        if ( (m_activationState1 != DISABLE_DEACTIVATION) && (m_activationState1 != DISABLE_SIMULATION))
50                m_activationState1 = newState;
51}
52
53void btCollisionObject::forceActivationState(int newState)
54{
55        m_activationState1 = newState;
56}
57
58void btCollisionObject::activate(bool forceActivation)
59{
60        if (forceActivation || !(m_collisionFlags & (CF_STATIC_OBJECT|CF_KINEMATIC_OBJECT)))
61        {
62                setActivationState(ACTIVE_TAG);
63                m_deactivationTime = btScalar(0.);
64        }
65}
66
67
68
Note: See TracBrowser for help on using the repository browser.