00001 /* 00002 * Collision line based header 00003 * 00004 * This file is part of the "SoftPixel Engine" (Copyright (c) 2008 by Lukas Hermanns) 00005 * See "SoftPixelEngine.hpp" for license information. 00006 */ 00007 00008 #ifndef __SP_COLLISION_LINEBASED_H__ 00009 #define __SP_COLLISION_LINEBASED_H__ 00010 00011 00012 #include "Base/spStandard.hpp" 00013 #include "SceneGraph/Collision/spCollisionNode.hpp" 00014 00015 00016 namespace sp 00017 { 00018 namespace scene 00019 { 00020 00021 00022 class SP_EXPORT CollisionLineBased : public CollisionNode 00023 { 00024 00025 public: 00026 00027 virtual ~CollisionLineBased(); 00028 00029 /* === Functions === */ 00030 00031 virtual s32 getSupportFlags() const = 0; 00032 virtual f32 getMaxMovement() const; 00033 00039 dim::line3df getLine() const; 00040 00041 /* === Static functions === */ 00042 00043 static dim::obbox3df getBoundBoxFromLine(const dim::line3df &Line, f32 Radius); 00044 00045 /* === Inline functions === */ 00046 00048 inline void setRadius(f32 Radius) 00049 { 00050 Radius_ = Radius; 00051 } 00053 inline f32 getRadius() const 00054 { 00055 return Radius_; 00056 } 00057 00062 inline void setHeight(f32 Height) 00063 { 00064 Height_ = Height; 00065 } 00067 inline f32 getHeight() const 00068 { 00069 return Height_; 00070 } 00071 00072 protected: 00073 00074 /* === Functions === */ 00075 00076 CollisionLineBased( 00077 CollisionMaterial* Material, SceneNode* Node, const ECollisionModels Type, 00078 f32 Radius, f32 Height 00079 ); 00080 00081 /* === Members === */ 00082 00083 f32 Radius_, Height_; 00084 00085 }; 00086 00087 00088 } // /namespace scene 00089 00090 } // /namespace sp 00091 00092 00093 #endif 00094 00095 00096 00097 // ================================================================================