gwnavruntime/collision/collisionraycastquery.h Source File

collisionraycastquery.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 
8 // Primary contact: JAPA - secondary contact: NOBODY
9 #ifndef Navigation_RayCastQuery3D_H
10 #define Navigation_RayCastQuery3D_H
11 
15 
16 namespace Kaim
17 {
18 
22 
23 class CollisionRayCastQuery : public IAtomicQuery
24 {
25 public:
26  static QueryType GetStaticType() { return TypeCollisionRayCast; }
27  virtual QueryType GetType() const { return TypeCollisionRayCast; }
28 
29  virtual void BuildQueryBlob(BaseBlobHandler* blobHandler);
30  virtual void InitFromQueryBlob(World* world, void* blob);
31  virtual Ptr<BaseBlobHandler> CreateQueryBlobHandler() { return CreateStaticQueryBlobHandler(); }
32  static Ptr<BaseBlobHandler> CreateStaticQueryBlobHandler();
33 
34  // ---------------------------------- Public Member Functions ----------------------------------
35 
36  CollisionRayCastQuery() : m_world(KY_NULL), m_result(RayDidNotHit) {}
37  virtual ~CollisionRayCastQuery() {}
38 
42  void BindToWorld(World* world);
43 
49  void Initialize(const Vec3f& start, const Vec3f& dest);
50 
51  // ---------------------------------- Query framework functions ----------------------------------
52 
53  virtual void Advance(WorkingMemory* workingMemory);
54 
57  void PerformQuery(WorkingMemory* workingMemory = KY_NULL);
58 
59  // ---------------------------------- Accessors ----------------------------------
60 
61  CollisionRayCastResult GetResult() const { return m_result; }
62  const Vec3f& GetStartPos() const { return m_start; }
63  const Vec3f& GetDestPos() const { return m_dest; }
64 
65 public:
66 
67  World* m_world;
68  Vec3f m_start;
69  Vec3f m_dest;
70 
71  CollisionRayCastResult m_result;
72 };
73 
74 }
75 
76 #endif //Navigation_RayCastQuery3D_H
77 
#define KY_NULL
Null value.
Definition: types.h:247
virtual void Advance(WorkingMemory *workingMemory)
This function is called by the QueryQueue to process one step on the query.
QueryType
Enumerates all the type of query.
Definition: iquery.h:29
void PerformQuery(WorkingMemory *workingMemory=0)
Performs the query.
Definition: gamekitcrowddispersion.h:20
void BindToWorld(World *world)
Associates the query to this world, clears all the inputs and outputs and sets all other parameters t...
void Initialize()
Should be called by the derived class before trying to perform the query or to push it in a QueryQueu...
Definition: iquery.h:372