diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-20 19:06:46 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-20 19:06:46 +0400 |
commit | 874c29cea8e6f9bc411fccf2d6f4cb07e94328d0 (patch) | |
tree | 5971e577cf7c02e05a1e37b5ad058c71a6744877 /source/gameengine/Physics/Bullet/CcdGraphicController.h | |
parent | 7555bfa793a2b0fc187c6211c56986f35b2d7b09 (diff) | |
parent | c5bc4e4fb1a33eda8c31f2ea02e91f32f74c8fa5 (diff) |
2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19323:HEAD
Notes:
* blenderbuttons and ICON_SNAP_PEEL_OBJECT were not merged.
Diffstat (limited to 'source/gameengine/Physics/Bullet/CcdGraphicController.h')
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdGraphicController.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/source/gameengine/Physics/Bullet/CcdGraphicController.h b/source/gameengine/Physics/Bullet/CcdGraphicController.h new file mode 100644 index 00000000000..8faa0944313 --- /dev/null +++ b/source/gameengine/Physics/Bullet/CcdGraphicController.h @@ -0,0 +1,74 @@ +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +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. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + + +#ifndef BULLET2_GRAPHICCONTROLLER_H +#define BULLET2_GRAPHICCONTROLLER_H + +#include "PHY_IGraphicController.h" + +#include "btBulletDynamicsCommon.h" +#include "LinearMath/btTransform.h" + +#include "PHY_IMotionState.h" +#include "MT_Point3.h" + +class CcdPhysicsEnvironment; +class btCollisionObject; + +///CcdGraphicController is a graphic object that supports view frustrum culling and occlusion +class CcdGraphicController : public PHY_IGraphicController +{ +public: + CcdGraphicController(CcdPhysicsEnvironment* phyEnv, PHY_IMotionState* motionState); + + virtual ~CcdGraphicController(); + + void setLocalAabb(const btVector3& aabbMin,const btVector3& aabbMax); + void setLocalAabb(const MT_Point3& aabbMin,const MT_Point3& aabbMax); + + PHY_IMotionState* GetMotionState() { return m_motionState; } + void getAabb(btVector3& aabbMin, btVector3& aabbMax); + + virtual void setBroadphaseHandle(btBroadphaseProxy* handle) { m_handle = handle; } + virtual btBroadphaseProxy* getBroadphaseHandle() { return m_handle; } + + //////////////////////////////////// + // PHY_IGraphicController interface + //////////////////////////////////// + + /** + * Updates the Aabb based on the motion state + */ + virtual bool SetGraphicTransform(); + + // client info for culling + virtual void* getNewClientInfo() { return m_newClientInfo; } + virtual void setNewClientInfo(void* clientinfo) { m_newClientInfo = clientinfo; } + virtual PHY_IGraphicController* GetReplica(class PHY_IMotionState* motionstate); + +private: + // unscaled aabb corner + btVector3 m_localAabbMin; + btVector3 m_localAabbMax; + + PHY_IMotionState* m_motionState; + CcdPhysicsEnvironment* m_phyEnv; + btBroadphaseProxy* m_handle; + void* m_newClientInfo; + +}; + +#endif //BULLET2_PHYSICSCONTROLLER_H |