ScummVM API documentation
dgCollisionCone.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_DGCOLLISIONCONE_H__AS235640FER__INCLUDED_)
23 #define AFX_DGCOLLISIONCONE_H__AS235640FER__INCLUDED_
24 
25 #include "dgCollisionConvex.h"
26 
27 #define DG_CONE_SEGMENTS 8
28 
29 
31 public:
32  dgCollisionCone(dgMemoryAllocator *const allocator, dgUnsigned32 signature, dgFloat32 radius, dgFloat32 height, const dgMatrix &matrix);
33  dgCollisionCone(dgWorld *const world, dgDeserialize deserialization, void *const userData);
34  virtual ~dgCollisionCone();
35 
36 private:
37  void Init(dgFloat32 radius, dgFloat32 height);
38  virtual dgVector SupportVertex(const dgVector &dir) const;
39  virtual dgVector SupportVertexSimd(const dgVector &dir) const;
40 
41  virtual dgInt32 CalculatePlaneIntersection(const dgVector &normal, const dgVector &origin, dgVector *const contactsOut) const;
42  virtual dgInt32 CalculatePlaneIntersectionSimd(const dgVector &normal, const dgVector &point, dgVector *const contactsOut) const;
43 
44  virtual dgFloat32 CalculateMassProperties(dgVector &inertia, dgVector &crossInertia, dgVector &centerOfMass) const;
45 // virtual void DebugCollision (const dgBody& myBody, DebugCollisionMeshCallback callback) const;
46  virtual void DebugCollision(const dgMatrix &matrix, OnDebugCollisionMeshCallback callback, void *const userData) const;
47 
48 
49 // virtual dgVector GetLocalCG () const;
50  virtual dgInt32 CalculateSignature() const;
51  virtual void SetCollisionBBox(const dgVector &p0, const dgVector &p1);
52  virtual void GetCollisionInfo(dgCollisionInfo *info) const;
53  virtual void Serialize(dgSerialize callback, void *const userData) const;
54 
55  dgFloat32 m_height;
56  dgFloat32 m_radius;
57  dgFloat32 m_sinAngle;
58 
59 // dgFloat32 m_delCosTetha;
60 // dgFloat32 m_delSinTetha;
61 // dgFloat32 m_tethaStep;
62 // dgFloat32 m_tethaStepInv;
63 
64  dgFloat32 m_amp;
65 
66  dgVector m_vertex[DG_CONE_SEGMENTS + 1];
67  static dgInt32 m_shapeRefCount;
68  static dgConvexSimplexEdge m_edgeArray[];
69 
70  friend class dgWorld;
71 };
72 
73 #endif
74 
Definition: dgCollision.h:73
Definition: dgCollisionConvex.h:29
Definition: dgVector.h:86
Definition: dgCollisionConvex.h:39
Definition: dgMatrix.h:41
Definition: dgMemory.h:80
Definition: dgWorld.h:118
Definition: dgCollisionCone.h:30