Panda3D
|
00001 //////////////////////////////////////////////////////////////////////// 00002 // Filename : aiCharacter.h 00003 // Created by : Deepak, John, Navin 00004 // Date : 8 Sep 09 00005 //////////////////////////////////////////////////////////////////// 00006 // 00007 // PANDA 3D SOFTWARE 00008 // Copyright (c) Carnegie Mellon University. All rights reserved. 00009 // 00010 // All use of this software is subject to the terms of the revised BSD 00011 // license. You should have received a copy of this license along 00012 // with this source code in a file named "LICENSE." 00013 // 00014 //////////////////////////////////////////////////////////////////// 00015 00016 #pragma warning (disable:4996) 00017 #pragma warning (disable:4005) 00018 #pragma warning(disable:4275) 00019 00020 00021 #ifndef _AICHARACTER_H 00022 #define _AICHARACTER_H 00023 00024 #include "aiBehaviors.h" 00025 00026 //////////////////////////////////////////////////////////////////////////////////////////////////////////////// 00027 // 00028 // Class : AICharacter 00029 // Description : This class is used for creating the ai characters. It assigns both physics and ai 00030 // attributes to the character. It also has an update function which updates the physics and ai 00031 // of the character. This update function is called by the AIWorld update. 00032 00033 //////////////////////////////////////////////////////////////////////////////////////////////////////////////// 00034 00035 class AIBehaviors; 00036 class AIWorld; 00037 00038 class EXPCL_PANDAAI AICharacter { 00039 public: 00040 double _mass; 00041 double _max_force; 00042 LVecBase3f _velocity; 00043 LVecBase3f _steering_force; 00044 string _name; 00045 double _movt_force; 00046 unsigned int _ai_char_flock_id; 00047 AIWorld *_world; 00048 AIBehaviors *_steering; 00049 NodePath _window_render; 00050 NodePath _ai_char_np; 00051 bool _pf_guide; 00052 00053 void update(); 00054 void set_velocity(LVecBase3f vel); 00055 void set_char_render(NodePath render); 00056 NodePath get_char_render(); 00057 00058 PUBLISHED: 00059 double get_mass(); 00060 void set_mass(double m); 00061 00062 LVecBase3f get_velocity(); 00063 00064 double get_max_force(); 00065 void set_max_force(double max_force); 00066 00067 NodePath get_node_path(); 00068 void set_node_path(NodePath np); 00069 00070 AIBehaviors * get_ai_behaviors(); 00071 00072 // This function is used to enable or disable the guides for path finding. 00073 void set_pf_guide(bool pf_guide); 00074 00075 AICharacter(string model_name, NodePath model_np, double mass, double movt_force, double max_force); 00076 ~AICharacter(); 00077 }; 00078 00079 #endif