ScummVM API documentation
dgCollisionEllipse.h
1 /* Copyright (c) <2003-2011> <Julio Jerez, Newton Game Dynamics>
2 *
3 * This software is provided 'as-is', without any express or implied
4 * warranty. In no event will the authors be held liable for any damages
5 * arising from the use of this software.
6 *
7 * Permission is granted to anyone to use this software for any purpose,
8 * including commercial applications, and to alter it and redistribute it
9 * freely, subject to the following restrictions:
10 *
11 * 1. The origin of this software must not be misrepresented; you must not
12 * claim that you wrote the original software. If you use this software
13 * in a product, an acknowledgment in the product documentation would be
14 * appreciated but is not required.
15 *
16 * 2. Altered source versions must be plainly marked as such, and must not be
17 * misrepresented as being the original software.
18 *
19 * 3. This notice may not be removed or altered from any source distribution.
20 */
21 
22 #if !defined(AFX_DGCOLLISIONELLIPSE_H__4969D514_69A9_4D96_82B2_E5B0EA3D413F__INCLUDED_)
23 #define AFX_DGCOLLISIONELLIPSE_H__4969D514_69A9_4D96_82B2_E5B0EA3D413F__INCLUDED_
24 
25 
26 
27 #include "dgCollisionSphere.h"
28 
29 
31 public:
32  dgCollisionEllipse(dgMemoryAllocator *const allocator, dgUnsigned32 signature, dgFloat32 rx, dgFloat32 ry, dgFloat32 rz, const dgMatrix &offsetMatrix);
33  dgCollisionEllipse(dgWorld *const world, dgDeserialize deserialization, void *const userData);
34  virtual ~dgCollisionEllipse();
35 
36 
37 protected:
38  virtual dgVector SupportVertex(const dgVector &dir) const;
39  virtual dgVector SupportVertexSimd(const dgVector &dir) const;
40 
41  virtual void CalcAABB(const dgMatrix &matrix, dgVector &p0, dgVector &p1) const;
42  virtual void CalcAABBSimd(const dgMatrix &matrix, dgVector &p0, dgVector &p1) const;
43 // virtual void DebugCollision (const dgBody& myBody, DebugCollisionMeshCallback callback) const;
44  virtual void DebugCollision(const dgMatrix &matrix, OnDebugCollisionMeshCallback callback, void *const userData) const;
45  virtual dgFloat32 RayCast(const dgVector &localP0, const dgVector &localP1, dgContactPoint &contactOut, OnRayPrecastAction preFilter, const dgBody *const body, void *const userData) const;
46  virtual dgFloat32 RayCastSimd(const dgVector &localP0, const dgVector &localP1, dgContactPoint &contactOut, OnRayPrecastAction preFilter, const dgBody *const body, void *const userData) const;
47 
48 private:
49  virtual dgInt32 CalculateSignature() const;
50  virtual void SetCollisionBBox(const dgVector &p0, const dgVector &p1);
51  virtual dgFloat32 CalculateMassProperties(dgVector &inertia, dgVector &crossInertia, dgVector &centerOfMass) const;
52 
53  virtual dgInt32 CalculatePlaneIntersection(const dgVector &normal, const dgVector &point, dgVector *const contactsOut) const;
54  virtual dgInt32 CalculatePlaneIntersectionSimd(const dgVector &normal, const dgVector &point, dgVector *const contactsOut) const;
55 
56  virtual void GetCollisionInfo(dgCollisionInfo *info) const;
57  virtual void Serialize(dgSerialize callback, void *const userData) const;
58 
59  dgVector m_scale;
60  dgVector m_invScale;
61 
62  friend class dgWorld;
63 };
64 
65 
66 #endif
67 
Definition: dgCollisionSphere.h:30
Definition: dgCollision.h:73
Definition: dgBody.h:85
Definition: dgVector.h:86
Definition: dgContact.h:88
Definition: dgCollisionEllipse.h:30
Definition: dgMatrix.h:41
Definition: dgMemory.h:80
Definition: dgWorld.h:118