VR-Forces 4.1.1 Class Documentation
preferredTerraintypeConstraint.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2011 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*
6 * Copyright 2009 Autodesk, Inc. All rights reserved.
7 * This computer source code and related instructions and comments are the
8 * unpublished confidential and proprietary information of Autodesk, Inc. and
9 * are protected under applicable copyright and trade secret law. They may
10 * neither not be modified by you or any third party nor disclosed to, copied
11 * or used by any third party without the prior written consent of Autodesk, Inc.
12 */
13 
14 #pragma once
15 
17 
19 #include "kyruntime/core/inextmovemanager.h"
20 #include "kypathdata/navmesh/navmeshtypes.h"
21 #include "kypathdata/navmesh/navtriangleptr.h"
22 
23 namespace BHAVE
24 {
25  class DtPreferredTerrainTypeBodyAttribute;
26 
32 class DT_DLL_bhaveSim DtPreferredTerrainTypeConstraint : public Kaim::IConstraint
33 {
34 public:
35  KY_DECLARE_CONSTRAINT(DtPreferredTerrainTypeConstraint);
36 
38 
39  KyBool GetCost(Kaim::Bot* bot, const Kaim::PointWrapper& from, const Kaim::PointWrapper& to, KyFloat32& cost);
40  KyBool GetCost_PathFinding(Kaim::Bot& bot, const Kaim::PointWrapper& from, const Kaim::PointWrapper& to, KyFloat32& cost);
41  KyBool GetCost_PathFollowing(Kaim::Bot& bot, const Kaim::PointWrapper& from, const Kaim::PointWrapper& to, KyFloat32& cost);
42 
43  Kaim::NavTerrainTypeMask GetNavTerrainTypeMask(const Kaim::PointWrapper& pw, Kaim::Bot* bot);
44 
47  void SetDifficultyFactor(const KyFloat32& difficultyFactor);
48  const KyFloat32& GetDifficultyFactor() const;
49 
50  virtual void OnStartAstar(const Kaim::GraphVertexPtr& /*start*/, const Kaim::GraphVertexPtr& /*dest*/) { m_inAstar = KY_TRUE; }
51  virtual void OnPauseAstar(const Kaim::GraphVertexPtr& /*start*/, const Kaim::GraphVertexPtr& /*dest*/) { m_inAstar = KY_FALSE; }
52  virtual void OnResumeAstar(const Kaim::GraphVertexPtr& /*start*/, const Kaim::GraphVertexPtr& /*dest*/) { m_inAstar = KY_TRUE; }
53  virtual void OnFinishAstar(const Kaim::GraphVertexPtr& /*start*/, const Kaim::GraphVertexPtr& /*dest*/) { m_inAstar = KY_FALSE; }
54 
55 protected:
56  KyFloat32 GetCostRatio(const Kaim::NavTerrainTypeMask& terrainType) const;
57 
58  KyBool m_inAstar;
59  KyFloat32 m_difficultyFactor;
61 };
62 }
63 

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)