Atoms Crowd  4.1.0
HeightField.h
1 #pragma once
2 // ===========================================================================
3 // Copyright (c) 2015 Toolchefs Ltd. All rights reserved.
4 //
5 // Use of this software is subject to the terms of the Toolchefs license
6 // agreement provided at the time of installation or download, or which
7 // otherwise accompanies this software in either electronic or hard copy form.
8 // ===========================================================================
9 
10 #include <Atoms/Globals.h>
11 #include <AtomsCore/AtomsMath.h>
12 
13 namespace Atoms
14 {
16  class ATOMS_EXPORT HeightField
17  {
18  public:
19 
20  enum FieldType
21  {
22  kDefault = 0,
23  kMesh,
24  kHeightField
25  };
26 
27  class HitResult
28  {
29  public:
30  AtomsCore::Vector3f point;
31  AtomsCore::Vector3f normal;
33  float t;
34  unsigned int faceId;
35  };
36 
37  HeightField();
38 
39  virtual ~HeightField();
40 
41  virtual bool intersect(
42  const AtomsCore::Vector3f& orig,
43  const AtomsCore::Vector3f& dir,
44  HitResult& result,
45  bool bothDirection = false
46  ) const = 0;
47 
48  virtual bool closestPoint(
49  const AtomsCore::Vector3f& orig,
50  HitResult& result
51  ) const = 0;
52 
53  virtual void buildIntersectionGrid(short gridMode);
54 
55  virtual size_t typeId() const = 0;
56 
57  };
58 }
Atoms::HeightField::HitResult
Definition: HeightField.h:28
AtomsCore::Vector2f
AtomsMath::Vector2f Vector2f
Vector2 class.
Definition: AtomsMath.h:55
Atoms
Atoms namespace.
Definition: Agent.h:28
Atoms::HeightField
Container for all agent types.
Definition: HeightField.h:17
AtomsCore::Vector3f
AtomsMath::Vector3f Vector3f
Vector3 class.
Definition: AtomsMath.h:58