True Axis Physics SDK 1.2.0.1 Beta Documentation
www.trueaxis.com

CollisionObjectLineList.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------------
00002 // File Name: CollisionObjectLineList.h
00003 // Description:
00006 //
00007 // Copyright (C) 2004 - 2006 True Axis Pty Ltd, Australia. 
00008 // All Rights Reserved.
00009 //
00010 // History:
00011 //      Created File.
00012 //---------------------------------------------------------------------------------
00013 
00014 #ifndef TA_COLLISIONOBJECTLINELIST_H
00015 #define TA_COLLISIONOBJECTLINELIST_H
00016 
00017 #ifndef TA_ARRAY_H
00018 #include "../Common/Array.h"
00019 #endif // TA_ARRAY_H
00020 
00021 #ifndef TA_COLLISIONOBJECTSIMPLE_H
00022 #include "CollisionObjectSimple.h"
00023 #endif // TA_COLLISIONOBJECTSIMPLE_H
00024 
00025 #ifndef TA_COLLISION_H
00026 #include "Collision.h"
00027 #endif // TA_COLLISION_H
00028 
00029 TA_OBFUSCATION_SKIP_PASS_2
00030 
00031 namespace TA
00032 {
00033 
00034 struct MFrame;
00035 class CollisionObjectCachedPolyData;
00036 
00037 class TAPHYSICS_CLASS CollisionObjectLineList : public CollisionObjectSimple
00038 {
00039 public:
00040     TA_OBFUSCATION_RESERVED_ON
00041     void Initialise(const Vec3* v3PointList, int nNumLines);
00042     void Finalise();
00044 
00045     #ifndef TA_WRAPPER  
00046     void Serialise(Serialiser& serialiser, const Version& version);
00047     #endif // TA_WRAPPER
00048 
00049     bool Serialisable() const { return true; }
00050     
00051     AABB CalculateBoundingBox() const;
00052     void CalculateMass(float fDensity, float& fMass, Vec3& v3CenterOfMass, Mat33& m33Inertia) const;
00053         
00054     virtual void Render(const MFrame& mFrame);
00055 
00056     virtual bool TestLineForCollision(
00057         const Vec3& v3Start,
00058         const Vec3& v3Normal,
00059         float fLength,
00060         Collision& collision) const { return false; }
00061     int GetNumLines() const;
00062     
00063     static CollisionObjectLineList* TAC_CALL CreateNew();
00064 
00065     TA_OBFUSCATION_RESERVED_OFF
00066 
00067 #ifndef DOXYGEN
00068     TA_DEFINE_FRIEND_SIMPLE_VS_COMPLEX_COLLISION(TestLineListAgainstCachedPolyData)
00069 
00070     TA_DEFINE_FRIEND_SIMPLE_VS_SIMPLE_COLLISION(TestSphereAgainstLineList)
00071     TA_DEFINE_FRIEND_SIMPLE_VS_SIMPLE_COLLISION(TestCylinderAgainstLineList)
00072     TA_DEFINE_FRIEND_SIMPLE_VS_SIMPLE_COLLISION(TestCapsuleAgainstLineList) 
00073     TA_DEFINE_FRIEND_SIMPLE_VS_SIMPLE_COLLISION(TestLineListAgainstConvexObject)
00074 
00075 #endif // DOXYGEN
00076 
00077 private:
00078     struct Line
00079     {
00080         Vec3 v3Start;
00081         Vec3 v3End;
00082     };
00083     Array<Line, false> m_lineList;
00084 
00085     CollisionObjectLineList();
00086     ~CollisionObjectLineList();
00087 
00088     virtual const char* GetFileHeaderString() const { return "TAColObjLines"; }
00089 };
00090 
00091 inline int CollisionObjectLineList::GetNumLines() const { return m_lineList.GetSize(); }
00092 
00093 #ifndef DOXYGEN
00094 
00095 TA_DEFINE_SIMPLE_VS_COMPLEX_COLLISION(TestLineListAgainstCachedPolyData)
00096 
00097 #endif // DOXYGEN
00098 
00099 }
00100 
00101 #endif // TA_COLLISIONOBJECTLINELIST_H


© Copyright 2004-2006 TRUE AXIS PTY LTD Australia. All rights reserved.