From fc4b36b1ecfeb971f39640d83f7a281067534d5a Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 26 Apr 2010 17:37:41 +0000 Subject: [PATCH] Compile PandAI with ppremake --- contrib/src/ai/Sources.pp | 82 +++++++++++++++++++++ contrib/src/ai/aiBehaviors.cxx | 84 +++++++++++----------- contrib/src/ai/aiBehaviors.h | 16 ++--- contrib/src/ai/aiCharacter.h | 17 ++--- contrib/src/ai/aiNode.h | 4 +- contrib/src/ai/aiPathFinder.h | 4 +- contrib/src/ai/aiWorld.h | 4 +- contrib/src/ai/arrival.h | 2 +- contrib/src/ai/evade.h | 2 +- contrib/src/ai/flee.h | 2 +- contrib/src/ai/flock.h | 4 +- contrib/src/ai/globals.h | 31 ++++---- contrib/src/ai/meshNode.h | 96 ++++++++++++------------- contrib/src/ai/obstacleAvoidance.h | 2 +- contrib/src/ai/pathFind.h | 2 +- contrib/src/ai/pathFollow.h | 2 +- contrib/src/ai/pursue.h | 2 +- contrib/src/ai/seek.h | 2 +- contrib/src/ai/wander.h | 2 +- contrib/src/contribbase/Sources.pp | 13 ++++ contrib/src/contribbase/contribbase.cxx | 15 ++++ 21 files changed, 247 insertions(+), 141 deletions(-) create mode 100755 contrib/src/ai/Sources.pp create mode 100644 contrib/src/contribbase/Sources.pp create mode 100644 contrib/src/contribbase/contribbase.cxx diff --git a/contrib/src/ai/Sources.pp b/contrib/src/ai/Sources.pp new file mode 100755 index 0000000000..21e1b8766d --- /dev/null +++ b/contrib/src/ai/Sources.pp @@ -0,0 +1,82 @@ +#define LOCAL_LIBS contribbase +#define BUILDING_DLL BUILDING_PANDAAI + +#define OTHER_LIBS \ + panda:c \ + express:c putil:c pandabase:c pandaexpress:m \ + interrogatedb:c prc:c dconfig:c dtoolconfig:m \ + dtoolutil:c dtoolbase:c dtool:m + +#begin lib_target + #define TARGET pandaai + + #define COMBINED_SOURCES ai_composite1.cxx + + #define SOURCES \ + aiBehaviors.h \ + aiCharacter.h \ + aiGlobals.h \ + aiNode.h \ + aiPathFinder.h \ + aiWorld.h \ + arrival.h \ + config_ai.h \ + evade.h \ + flee.h \ + flock.h \ + globals.h \ + meshNode.h \ + obstacleAvoidance.h \ + pathFind.h \ + pathFollow.h \ + pursue.h \ + seek.h \ + wander.h + + #define INCLUDED_SOURCES \ + aiBehaviors.cxx \ + aiCharacter.cxx \ + aiNode.cxx \ + aiPathFinder.cxx \ + aiWorld.cxx \ + ai_composite.cxx \ + ai_composite1.cxx \ + arrival.cxx \ + config_ai.cxx \ + evade.cxx \ + flee.cxx \ + flock.cxx \ + meshNode.cxx \ + obstacleAvoidance.cxx \ + pathFind.cxx \ + pathFollow.cxx \ + pursue.cxx \ + seek.cxx \ + wander.cxx + + + #define INSTALL_HEADERS \ + aiBehaviors.h \ + aiCharacter.h \ + aiGlobals.h \ + aiNode.h \ + aiPathFinder.h \ + aiWorld.h \ + arrival.h \ + config_ai.h \ + evade.h \ + flee.h \ + flock.h \ + globals.h \ + meshNode.h \ + obstacleAvoidance.h \ + pathFind.h \ + pathFollow.h \ + pursue.h \ + seek.h \ + wander.h + + #define IGATESCAN all + +#end lib_target + diff --git a/contrib/src/ai/aiBehaviors.cxx b/contrib/src/ai/aiBehaviors.cxx index c590598e6c..20b36a6ef5 100644 --- a/contrib/src/ai/aiBehaviors.cxx +++ b/contrib/src/ai/aiBehaviors.cxx @@ -6,7 +6,7 @@ // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // -// All use of this software is subject to the terms of the revised +// All use of this software is subject to the terms of the revised // BSD license. You should have received a copy of this license along // with this source code in a file named "LICENSE." // @@ -104,10 +104,10 @@ bool AIBehaviors::is_conflict() { //////////////////////////////////////////////////////////////////// // Function: accumulate_force -// Description: This function updates the individual steering forces +// Description: This function updates the individual steering forces // for each of the ai characters. -// These accumulated forces are eventually what -// comprise the resultant steering force of the +// These accumulated forces are eventually what +// comprise the resultant steering force of the // character. //////////////////////////////////////////////////////////////////// void AIBehaviors::accumulate_force(string force_type, LVecBase3f force) { @@ -160,10 +160,10 @@ void AIBehaviors::accumulate_force(string force_type, LVecBase3f force) { //////////////////////////////////////////////////////////////////// // Function: calculate_prioritized -// Description: This function updates the main steering force -// for the ai character using the accumulate function -// and checks for max force and arrival force. -// It finally returns this steering force which is +// Description: This function updates the main steering force +// for the ai character using the accumulate function +// and checks for max force and arrival force. +// It finally returns this steering force which is // accessed by the update function in the AICharacter // class. //////////////////////////////////////////////////////////////////// @@ -502,7 +502,7 @@ void AIBehaviors::pause_ai(string ai_type) { } case 8: { - if (BT_obstacle_avoidance != NULL) { + if (_obstacle_avoidance_obj != NULL) { turn_off("obstacle_avoidance"); turn_off("obstacle_avoidance_activate"); } @@ -628,7 +628,7 @@ void AIBehaviors::resume_ai(string ai_type) { // of the Seek class. // This is the function we want the user to call for // seek to be done. -// This function is overloaded to accept a NodePath or +// This function is overloaded to accept a NodePath or // an LVecBase3f. //////////////////////////////////////////////////////////////////// void AIBehaviors::seek(NodePath target_object, float seek_wt) { @@ -650,7 +650,7 @@ void AIBehaviors::seek(LVecBase3f pos, float seek_wt) { //////////////////////////////////////////////////////////////////// void AIBehaviors::flee(NodePath target_object, double panic_distance, double relax_distance, float flee_wt) { - _flee_obj = new Flee(_ai_char, target_object, panic_distance, + _flee_obj = new Flee(_ai_char, target_object, panic_distance, relax_distance, flee_wt); _flee_list.insert(_flee_list.end(), *_flee_obj); @@ -669,8 +669,8 @@ void AIBehaviors::flee(LVecBase3f pos, double panic_distance, //////////////////////////////////////////////////////////////////// // Function: pursue // Description: This function activates pursue. -// This is the function we want the user to call -// for pursue to be done. +// This is the function we want the user to call +// for pursue to be done. //////////////////////////////////////////////////////////////////// void AIBehaviors::pursue(NodePath target_object, float pursue_wt) { _pursue_obj = new Pursue(_ai_char, target_object, pursue_wt); @@ -683,7 +683,7 @@ void AIBehaviors::pursue(NodePath target_object, float pursue_wt) { // Description: This function activates evade_activate. //////////////////////////////////////////////////////////////////// void AIBehaviors::evade(NodePath target_object, double panic_distance, - double relax_distance, float evade_wt) { + double relax_distance, float evade_wt) { _evade_obj = new Evade(_ai_char, target_object, panic_distance, relax_distance, evade_wt); _evade_list.insert(_evade_list.end(), *_evade_obj); @@ -715,7 +715,7 @@ void AIBehaviors::arrival(double distance) { //////////////////////////////////////////////////////////////////// // Function: flock // Description: This function activates flock. -// This is the function we want the user to call for +// This is the function we want the user to call for // flock to be done. //////////////////////////////////////////////////////////////////// void AIBehaviors::flock(float flock_wt) { @@ -727,7 +727,7 @@ void AIBehaviors::flock(float flock_wt) { //////////////////////////////////////////////////////////////////// // Function: flock_activate -// Description: This function checks whether any other behavior +// Description: This function checks whether any other behavior // exists to work with flock. // When this is true, it calls the do_flock function. //////////////////////////////////////////////////////////////////// @@ -740,13 +740,13 @@ void AIBehaviors::flock_activate() { //////////////////////////////////////////////////////////////////// // Function: do_flock -// Description: This function contains the logic for flocking -// behavior. This is an emergent behavior and is +// Description: This function contains the logic for flocking +// behavior. This is an emergent behavior and is // obtained by combining three other behaviors which // are separation, cohesion and alignment based on // Craig Reynold's algorithm. Also, this behavior does // not work by itself. It works only when combined with -// other steering behaviors such as wander, pursue, +// other steering behaviors such as wander, pursue, // evade, seek and flee. //////////////////////////////////////////////////////////////////// LVecBase3f AIBehaviors::do_flock() { @@ -778,7 +778,7 @@ LVecBase3f AIBehaviors::do_flock() { * cos(_flock_group->_flock_vcone_angle * (_PI / 180))) && (dist_vect.length() < _flock_group->_flock_vcone_radius)) { // Separation force calculation. - LVecBase3f ai_char_to_units = _ai_char->_ai_char_np.get_pos() + LVecBase3f ai_char_to_units = _ai_char->_ai_char_np.get_pos() - _flock_group->_ai_char_list[i]->_ai_char_np.get_pos(); float to_units_dist = ai_char_to_units.length(); ai_char_to_units.normalize(); @@ -811,7 +811,7 @@ LVecBase3f AIBehaviors::do_flock() { cohesion_dir.normalize(); cohesion_force = cohesion_dir * _ai_char->_movt_force; } - else if (is_on(BT_seek) || is_on(BT_flee) || is_on(BT_pursue) || + else if (is_on(BT_seek) || is_on(BT_flee) || is_on(BT_pursue) || is_on(BT_evade) || is_on(BT_wander)) { _flock_done = true; turn_off("flock"); @@ -822,7 +822,7 @@ LVecBase3f AIBehaviors::do_flock() { // Calculate the resultant force on the ai character by taking into // account the separation, alignment and cohesion // forces along with their corresponding weights. - return (separation_force * _flock_group->_separation_wt + + return (separation_force * _flock_group->_separation_wt + avg_neighbor_heading * _flock_group->_alignment_wt + cohesion_force * _flock_group->_cohesion_wt); } @@ -830,10 +830,10 @@ LVecBase3f AIBehaviors::do_flock() { //////////////////////////////////////////////////////////////////// // Function: wander // Description: This function activates wander. -// This is the function we want the user to call +// This is the function we want the user to call // for flock to be done. //////////////////////////////////////////////////////////////////// -void AIBehaviors::wander(double wander_radius, int flag, double aoe, +void AIBehaviors::wander(double wander_radius, int flag, double aoe, float wander_weight) { _wander_obj = new Wander(_ai_char, wander_radius, flag, aoe, wander_weight); @@ -842,7 +842,7 @@ void AIBehaviors::wander(double wander_radius, int flag, double aoe, //////////////////////////////////////////////////////////////////// // Function: obstacle avoidance -// Description: This function activates obstacle avoidance for a +// Description: This function activates obstacle avoidance for a // given character. // This is the function we want the user to call for // obstacle avoidance to be performed. @@ -855,7 +855,7 @@ void AIBehaviors::obstacle_avoidance(float obstacle_avoidance_weight) { //////////////////////////////////////////////////////////////////// // Function: path_follow // Description: This function activates path following. -// This is the function we want the user to call for +// This is the function we want the user to call for // path following. //////////////////////////////////////////////////////////////////// void AIBehaviors::path_follow(float follow_wt) { @@ -889,9 +889,9 @@ void AIBehaviors::init_path_find(const char* navmesh_filename) { } //////////////////////////////////////////////////////////////////// -// Function: path_find_to (for pathfinding towards a +// Function: path_find_to (for pathfinding towards a // static position) -// Description: This function checks for the source and target in +// Description: This function checks for the source and target in // the navigation mesh for its availability and then // finds the best path via the A* algorithm // Then it calls the path follower to make the object @@ -902,9 +902,9 @@ void AIBehaviors::path_find_to(LVecBase3f pos, string type) { } //////////////////////////////////////////////////////////////////// -// Function: path_find_to (for pathfinding towards a moving +// Function: path_find_to (for pathfinding towards a moving // target (a NodePath)) -// Description: This function checks for the source and target in +// Description: This function checks for the source and target in // the navigation mesh for its availability and then // finds the best path via the A* algorithm // Then it calls the path follower to make the object @@ -916,11 +916,11 @@ void AIBehaviors::path_find_to(NodePath target, string type) { //////////////////////////////////////////////////////////////////// // Function: add_static_obstacle -// Description: This function allows the user to dynamically add +// Description: This function allows the user to dynamically add // obstacles to the // game environment. The function will update the nodes // within the bounding volume of the obstacle as non- -// traversable. Hence will not be considered by the +// traversable. Hence will not be considered by the // pathfinding algorithm. //////////////////////////////////////////////////////////////////// void AIBehaviors::add_static_obstacle(NodePath obstacle) { @@ -929,7 +929,7 @@ void AIBehaviors::add_static_obstacle(NodePath obstacle) { //////////////////////////////////////////////////////////////////// // Function: add_dynamic_obstacle -// Description: This function starts the pathfinding obstacle +// Description: This function starts the pathfinding obstacle // navigation for the passed in obstacle. //////////////////////////////////////////////////////////////////// void AIBehaviors::add_dynamic_obstacle(NodePath obstacle) { @@ -938,7 +938,7 @@ void AIBehaviors::add_dynamic_obstacle(NodePath obstacle) { //////////////////////////////////////////////////////////////////// // Function: behavior_status -// Description: This function returns the status of an AI Type +// Description: This function returns the status of an AI Type // whether it is active, paused or disabled. It returns // -1 if an invalid string is passed. //////////////////////////////////////////////////////////////////// @@ -1136,12 +1136,12 @@ string AIBehaviors::behavior_status(string ai_type) { break; case 10: - if (_seek_obj || _flee_obj || _pursue_obj || _evade_obj || _arrival_obj - || _flock_group || _wander_obj || _obstacle_avoidance_obj || + if (_seek_obj || _flee_obj || _pursue_obj || _evade_obj || _arrival_obj + || _flock_group || _wander_obj || _obstacle_avoidance_obj || _path_follow_obj) { if (is_on(BT_seek) || is_on(BT_flee) || is_on(BT_pursue)|| - is_on(BT_evade) || is_on(BT_arrival) || is_on(BT_flock) - || is_on(BT_wander) || is_on(BT_obstacle_avoidance) || + is_on(BT_evade) || is_on(BT_arrival) || is_on(BT_flock) + || is_on(BT_wander) || is_on(BT_obstacle_avoidance) || is_on("pathfollow") || is_on("pathfinding")) { return "active"; } @@ -1223,7 +1223,7 @@ int AIBehaviors::char_to_int(string ai_type) { //////////////////////////////////////////////////////////////////// // Function: turn_on -// Description: This function turns on any aiBehavior which is +// Description: This function turns on any aiBehavior which is // passed as a string. //////////////////////////////////////////////////////////////////// void AIBehaviors::turn_on(string ai_type) { @@ -1287,7 +1287,7 @@ void AIBehaviors::turn_on(string ai_type) { //////////////////////////////////////////////////////////////////// // Function: turn_off -// Description: This function turns off any aiBehavior which is +// Description: This function turns off any aiBehavior which is // passed as a string. //////////////////////////////////////////////////////////////////// void AIBehaviors::turn_off(string ai_type) { @@ -1401,7 +1401,7 @@ bool AIBehaviors::is_on(BehaviorType bt) { //////////////////////////////////////////////////////////////////// // Function: is_on -// Description: This function returns true if pathfollow or +// Description: This function returns true if pathfollow or // pathfinding is on //////////////////////////////////////////////////////////////////// bool AIBehaviors::is_on(string ai_type) { @@ -1436,7 +1436,7 @@ bool AIBehaviors::is_off(BehaviorType bt) { //////////////////////////////////////////////////////////////////// // Function: is_off -// Description: This function returns true if pathfollow or +// Description: This function returns true if pathfollow or // pathfinding is off //////////////////////////////////////////////////////////////////// bool AIBehaviors::is_off(string ai_type) { diff --git a/contrib/src/ai/aiBehaviors.h b/contrib/src/ai/aiBehaviors.h index 45c922b281..33800fb4a4 100644 --- a/contrib/src/ai/aiBehaviors.h +++ b/contrib/src/ai/aiBehaviors.h @@ -6,8 +6,8 @@ // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // -// All use of this software is subject to the terms of the revised -// BSD license. You should have received a copy of this license +// All use of this software is subject to the terms of the revised +// BSD license. You should have received a copy of this license // along with this source code in a file named "LICENSE." // //////////////////////////////////////////////////////////////////// @@ -92,7 +92,7 @@ public: Flee *_flee_obj; LVecBase3f _flee_force; - // This list is used if the ai character needs to flee from + // This list is used if the ai character needs to flee from // multiple onjects. ListFlee _flee_list; ListFlee::iterator _flee_itr; @@ -111,7 +111,7 @@ public: Arrival *_arrival_obj; LVecBase3f _arrival_force; - // Since Flock is a collective behavior the variables are + // Since Flock is a collective behavior the variables are // declared within the AIBehaviors class. float _flock_weight; LVecBase3f _flock_force; @@ -135,7 +135,7 @@ public: bool is_on(BehaviorType bt); bool is_off(BehaviorType bt); // special cases for pathfollow and pathfinding - bool is_on(string ai_type); + bool is_on(string ai_type); bool is_off(string ai_type); void turn_on(string ai_type); void turn_off(string ai_type); @@ -156,19 +156,19 @@ PUBLISHED: void flee(NodePath target_object, double panic_distance = 10.0, double relax_distance = 10.0, float flee_wt = 1.0); - void flee(LVecBase3f pos, double panic_distance = 10.0, + void flee(LVecBase3f pos, double panic_distance = 10.0, double relax_distance = 10.0, float flee_wt = 1.0); void pursue(NodePath target_object, float pursue_wt = 1.0); - void evade(NodePath target_object, double panic_distance = 10.0, + void evade(NodePath target_object, double panic_distance = 10.0, double relax_distance = 10.0, float evade_wt = 1.0); void arrival(double distance = 10.0); void flock(float flock_wt); - void wander(double wander_radius = 5.0, int flag =0, + void wander(double wander_radius = 5.0, int flag =0, double aoe = 0.0, float wander_weight = 1.0); void obstacle_avoidance(float feeler_length = 1.0); diff --git a/contrib/src/ai/aiCharacter.h b/contrib/src/ai/aiCharacter.h index d6d4ac07b3..d628a21818 100644 --- a/contrib/src/ai/aiCharacter.h +++ b/contrib/src/ai/aiCharacter.h @@ -6,7 +6,7 @@ // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // -// All use of this software is subject to the terms of the revised +// All use of this software is subject to the terms of the revised // BSD license. You should have received a copy of this license along // with this source code in a file named "LICENSE." // @@ -15,23 +15,20 @@ #ifndef AICHARACTER_H #define AICHARACTER_H -#include "aiBehaviors.h" -#include "aiWorld.h" - class AIBehaviors; class AIWorld; //////////////////////////////////////////////////////////////////// // Class : AICharacter // Description : This class is used for creating the ai characters. -// It assigns both physics and ai attributes to the -// character. It also has an update function which +// It assigns both physics and ai attributes to the +// character. It also has an update function which // updates the physics and ai of the character. -// This update function is called by the AIWorld +// This update function is called by the AIWorld // update. //////////////////////////////////////////////////////////////////// class AICharacter { - public: +public: double _mass; double _max_force; LVecBase3f _velocity; @@ -64,11 +61,11 @@ PUBLISHED: AIBehaviors * get_ai_behaviors(); - // This function is used to enable or disable the guides + // This function is used to enable or disable the guides // for path finding. void set_pf_guide(bool pf_guide); - AICharacter(string model_name, NodePath model_np, double mass, + AICharacter(string model_name, NodePath model_np, double mass, double movt_force, double max_force); ~AICharacter(); }; diff --git a/contrib/src/ai/aiNode.h b/contrib/src/ai/aiNode.h index 083ff245c3..e84947c865 100644 --- a/contrib/src/ai/aiNode.h +++ b/contrib/src/ai/aiNode.h @@ -6,7 +6,7 @@ // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // -// All use of this software is subject to the terms of the revised +// All use of this software is subject to the terms of the revised // BSD license. You should have received a copy of this license // along with this source code in a file named "LICENSE." // @@ -29,7 +29,7 @@ // on the mesh. //////////////////////////////////////////////////////////////////// class AINode { -public: +PUBLISHED: // This variable specifies whether the node is an obtacle or not. // Used for dynamic obstacle addition to the environment. // obstacle = false diff --git a/contrib/src/ai/aiPathFinder.h b/contrib/src/ai/aiPathFinder.h index 654240d913..8e71314b89 100644 --- a/contrib/src/ai/aiPathFinder.h +++ b/contrib/src/ai/aiPathFinder.h @@ -6,7 +6,7 @@ // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // -// All use of this software is subject to the terms of the revised +// All use of this software is subject to the terms of the revised // BSD license. You should have received a copy of this license along // with this source code in a file named "LICENSE." // @@ -32,7 +32,7 @@ AINode* find_in_mesh(NavMesh nav_mesh, LVecBase3f pos, int grid_size); // calculated using the manhattan method. //////////////////////////////////////////////////////////////////// class PathFinder { -public: +PUBLISHED: AINode *_src_node; AINode *_dest_node; vector _open_list; diff --git a/contrib/src/ai/aiWorld.h b/contrib/src/ai/aiWorld.h index 49a7a2da3f..2bb1838321 100644 --- a/contrib/src/ai/aiWorld.h +++ b/contrib/src/ai/aiWorld.h @@ -6,7 +6,7 @@ // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // -// All use of this software is subject to the terms of the revised +// All use of this software is subject to the terms of the revised // BSD license. You should have received a copy of this license along // with this source code in a file named "LICENSE." // @@ -25,7 +25,7 @@ class Flock; //////////////////////////////////////////////////////////////////// // Class : AICharPool // Description : This class implements a linked list of AI -// Characters allowing the user to add and delete +// Characters allowing the user to add and delete // characters from the linked list. // This will be used in the AIWorld class. //////////////////////////////////////////////////////////////////// diff --git a/contrib/src/ai/arrival.h b/contrib/src/ai/arrival.h index 8ec90fab6d..b66c286026 100644 --- a/contrib/src/ai/arrival.h +++ b/contrib/src/ai/arrival.h @@ -6,7 +6,7 @@ // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // -// All use of this software is subject to the terms of the revised +// All use of this software is subject to the terms of the revised // BSD license. You should have received a copy of this license // along with this source code in a file named "LICENSE." // diff --git a/contrib/src/ai/evade.h b/contrib/src/ai/evade.h index 017ee45c9a..b1d7c4396d 100644 --- a/contrib/src/ai/evade.h +++ b/contrib/src/ai/evade.h @@ -6,7 +6,7 @@ // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // -// All use of this software is subject to the terms of the revised +// All use of this software is subject to the terms of the revised // BSD license. You should have received a copy of this license // along with this source code in a file named "LICENSE." // diff --git a/contrib/src/ai/flee.h b/contrib/src/ai/flee.h index 9b0ae8c978..a6b2efee6e 100644 --- a/contrib/src/ai/flee.h +++ b/contrib/src/ai/flee.h @@ -6,7 +6,7 @@ // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // -// All use of this software is subject to the terms of the revised +// All use of this software is subject to the terms of the revised // BSD license. You should have received a copy of this license // along with this source code in a file named "LICENSE." // diff --git a/contrib/src/ai/flock.h b/contrib/src/ai/flock.h index 7e900631d3..18bf13cbac 100644 --- a/contrib/src/ai/flock.h +++ b/contrib/src/ai/flock.h @@ -6,7 +6,7 @@ // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // -// All use of this software is subject to the terms of the revised +// All use of this software is subject to the terms of the revised // BSD license. You should have received a copy of this license // along with this source code in a file named "LICENSE." // @@ -41,7 +41,7 @@ public: unsigned int _cohesion_wt; unsigned int _alignment_wt; - // This vector will hold all the ai characters which belong to + // This vector will hold all the ai characters which belong to // this flock. typedef std::vector AICharList; AICharList _ai_char_list; diff --git a/contrib/src/ai/globals.h b/contrib/src/ai/globals.h index 46d0a64b5b..9ff7b89a6a 100644 --- a/contrib/src/ai/globals.h +++ b/contrib/src/ai/globals.h @@ -1,21 +1,20 @@ -//////////////////////////////////////////////////////////////////////// -//! Filename : globals.h -//! Created by : Deepak, John, Navin -//! Date: 8 Sep 09 -//! -//////////////////////////////////////////////////////////////////////// -//! -//! PANDA3D SOFTWARE -//! Copyright(c) Carnegie Mellon University. All rights reserved. -//! -//! All use of this software is subjest to the terms of the revised BSD -//! license. You should have received a copy of this license along with this source code in a file named "LICENSE" - -//////////////////////////////////////////////////////////////////////// +// Filename: globals.h +// Created by: Deepak, John, Navin (26Apr10) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// #pragma warning (disable:4996) #pragma warning (disable:4005) -#pragma warning(disable:4275) +#pragma warning (disable:4275) #ifndef _GLOBALS_H #define _GLOBALS_H @@ -30,4 +29,4 @@ #include "genericAsyncTask.h" #include "asyncTaskManager.h" -#endif \ No newline at end of file +#endif diff --git a/contrib/src/ai/meshNode.h b/contrib/src/ai/meshNode.h index 7c4a67a8d4..3f559284c3 100644 --- a/contrib/src/ai/meshNode.h +++ b/contrib/src/ai/meshNode.h @@ -4,64 +4,64 @@ #include "globals.h" -//////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//! -//! Class : Node -//! Description : This class is used to assign the nodes on the mesh. It holds all the data necessary to -//! compute A* algorithm. It also maintains a lot of vital information such as the neighbor -//! nodes of each node and also its position on the mesh. -//! Note: The Mesh Generator which is a stand alone tool makes use of this class to generate the nodes on the -//! mesh. - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////// - +//////////////////////////////////////////////////////////////////// +// Class : Node +// Description : This class is used to assign the nodes on the mesh. +// It holds all the data necessary to compute A* +// algorithm. It also maintains a lot of vital +// information such as the neighbor nodes of each +// node and also its position on the mesh. +// Note: the Mesh Generator which is a stand alone +// tool makes use of this class to generate the nodes +// on the mesh. +/////////////////////////////////////////////////////////////////// class Node { public: - // This variable specifies whether the node is an obtacle or not. - // Used for dynamic obstacle addition to the environment. - // obstacle = false - // navigational = true - bool _type; + // This variable specifies whether the node is an obtacle or not. + // Used for dynamic obstacle addition to the environment. + // obstacle = false + // navigational = true + bool _type; - // This variable specifies the node status whether open, close or neutral. - // open = belongs to _open_list. - // close = belongs to _closed_list. - // neutral = unexamined node. - enum Status { - open, - close, - neutral - }; - Status _status; + // This variable specifies the node status whether open, close or neutral. + // open = belongs to _open_list. + // close = belongs to _closed_list. + // neutral = unexamined node. + enum Status { + open, + close, + neutral + }; + Status _status; - // The score is used to compute the traversal expense to nodes when using A*. - // _score = _cost + heuristic - int _score; - int _cost; - int _heuristic; + // The score is used to compute the traversal expense to nodes when using A*. + // _score = _cost + heuristic + int _score; + int _cost; + int _heuristic; - // Used to trace back the path after it is generated using A*. - Node *_prv_node; + // Used to trace back the path after it is generated using A*. + Node *_prv_node; - // Position of the node in the 2d grid. - int _grid_x, _grid_y; + // Position of the node in the 2d grid. + int _grid_x, _grid_y; - // Position of the node in 3D space. - LVecBase3f _position; + // Position of the node in 3D space. + LVecBase3f _position; - // Dimensions of each face / cell on the mesh. - // Height is given in case of expansion to a 3d mesh. Currently not used. - float _width, _length ,_height; - Node *_neighbours[8]; // anti-clockwise from top left corner. + // Dimensions of each face / cell on the mesh. + // Height is given in case of expansion to a 3d mesh. Currently not used. + float _width, _length ,_height; + Node *_neighbours[8]; // anti-clockwise from top left corner. - // The _next pointer is used for traversal during mesh generation from the model. - // Note: The data in this member is discarded when mesh data is written into navmesh.csv file. - Node *_next; + // The _next pointer is used for traversal during mesh generation from the model. + // Note: The data in this member is discarded when mesh data is written into navmesh.csv file. + Node *_next; - Node(int grid_x, int grid_y, LVecBase3f pos, float w, float l, float h); - ~Node(); + Node(int grid_x, int grid_y, LVecBase3f pos, float w, float l, float h); + ~Node(); - bool contains(float x, float y); + bool contains(float x, float y); }; -#endif \ No newline at end of file +#endif diff --git a/contrib/src/ai/obstacleAvoidance.h b/contrib/src/ai/obstacleAvoidance.h index e4e17cd66d..790db0b191 100644 --- a/contrib/src/ai/obstacleAvoidance.h +++ b/contrib/src/ai/obstacleAvoidance.h @@ -6,7 +6,7 @@ // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // -// All use of this software is subject to the terms of the revised +// All use of this software is subject to the terms of the revised // BSD license. You should have received a copy of this license // along with this source code in a file named "LICENSE." // diff --git a/contrib/src/ai/pathFind.h b/contrib/src/ai/pathFind.h index 2d33d46b2a..9584bbd234 100644 --- a/contrib/src/ai/pathFind.h +++ b/contrib/src/ai/pathFind.h @@ -6,7 +6,7 @@ // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // -// All use of this software is subject to the terms of the revised +// All use of this software is subject to the terms of the revised // BSD license. You should have received a copy of this license // along with this source code in a file named "LICENSE." // diff --git a/contrib/src/ai/pathFollow.h b/contrib/src/ai/pathFollow.h index 70d454d6eb..a92520503b 100644 --- a/contrib/src/ai/pathFollow.h +++ b/contrib/src/ai/pathFollow.h @@ -6,7 +6,7 @@ // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // -// All use of this software is subject to the terms of the revised +// All use of this software is subject to the terms of the revised // BSD license. You should have received a copy of this license // along with this source code in a file named "LICENSE." // diff --git a/contrib/src/ai/pursue.h b/contrib/src/ai/pursue.h index 0a1f471b69..55dab8d847 100644 --- a/contrib/src/ai/pursue.h +++ b/contrib/src/ai/pursue.h @@ -6,7 +6,7 @@ // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // -// All use of this software is subject to the terms of the revised +// All use of this software is subject to the terms of the revised // BSD license. You should have received a copy of this license // along with this source code in a file named "LICENSE." // diff --git a/contrib/src/ai/seek.h b/contrib/src/ai/seek.h index df40bfaac3..e5e5dc0fa2 100644 --- a/contrib/src/ai/seek.h +++ b/contrib/src/ai/seek.h @@ -6,7 +6,7 @@ // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // -// All use of this software is subject to the terms of the revised +// All use of this software is subject to the terms of the revised // BSD license. You should have received a copy of this license // along with this source code in a file named "LICENSE." // diff --git a/contrib/src/ai/wander.h b/contrib/src/ai/wander.h index e58ce23f13..106973a32f 100644 --- a/contrib/src/ai/wander.h +++ b/contrib/src/ai/wander.h @@ -6,7 +6,7 @@ // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // -// All use of this software is subject to the terms of the revised +// All use of this software is subject to the terms of the revised // BSD license. You should have received a copy of this license // along with this source code in a file named "LICENSE." // diff --git a/contrib/src/contribbase/Sources.pp b/contrib/src/contribbase/Sources.pp new file mode 100644 index 0000000000..1d6ebf40b4 --- /dev/null +++ b/contrib/src/contribbase/Sources.pp @@ -0,0 +1,13 @@ +#define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \ + dtoolutil:c dtoolbase:c dtool:m prc:c + +#begin lib_target + #define TARGET contribbase + + #define SOURCES \ + contribbase.cxx contribbase.h contribsymbols.h \ + + #define INSTALL_HEADERS \ + contribbase.h contribbase.h + +#end lib_target diff --git a/contrib/src/contribbase/contribbase.cxx b/contrib/src/contribbase/contribbase.cxx new file mode 100644 index 0000000000..2c1d4ae339 --- /dev/null +++ b/contrib/src/contribbase/contribbase.cxx @@ -0,0 +1,15 @@ +// Filename: contribbase.cxx +// Created by: rdb (26Apr10) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#include "contribbase.h"