00001 // Filename: config_collide.cxx 00002 // Created by: drose (24Apr00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #include "config_collide.h" 00020 #include "collisionEntry.h" 00021 #include "collisionHandler.h" 00022 #include "collisionHandlerEvent.h" 00023 #include "collisionHandlerFloor.h" 00024 #include "collisionHandlerPhysical.h" 00025 #include "collisionHandlerPusher.h" 00026 #include "collisionHandlerQueue.h" 00027 #include "collisionNode.h" 00028 #include "collisionPlane.h" 00029 #include "collisionPolygon.h" 00030 #include "collisionRay.h" 00031 #include "collisionRecorder.h" 00032 #include "collisionSegment.h" 00033 #include "collisionSolid.h" 00034 #include "collisionSphere.h" 00035 #include "collisionVisualizer.h" 00036 #include "dconfig.h" 00037 00038 Configure(config_collide); 00039 NotifyCategoryDef(collide, ""); 00040 00041 ConfigureFn(config_collide) { 00042 init_libcollide(); 00043 } 00044 00045 // Set this false to stop the CollisionTraverser from automatically 00046 // clearing the velocity associated with its CollisionNodes after it 00047 // has traversed them. Mainly useful for visualizing the velocities. 00048 const bool auto_clear_velocity = config_collide.GetBool("auto-clear-velocity", true); 00049 00050 //////////////////////////////////////////////////////////////////// 00051 // Function: init_libcollide 00052 // Description: Initializes the library. This must be called at 00053 // least once before any of the functions or classes in 00054 // this library can be used. Normally it will be 00055 // called by the static initializers and need not be 00056 // called explicitly, but special cases exist. 00057 //////////////////////////////////////////////////////////////////// 00058 void 00059 init_libcollide() { 00060 static bool initialized = false; 00061 if (initialized) { 00062 return; 00063 } 00064 initialized = true; 00065 00066 CollisionEntry::init_type(); 00067 CollisionHandler::init_type(); 00068 CollisionHandlerEvent::init_type(); 00069 CollisionHandlerFloor::init_type(); 00070 CollisionHandlerPhysical::init_type(); 00071 CollisionHandlerPusher::init_type(); 00072 CollisionHandlerQueue::init_type(); 00073 CollisionNode::init_type(); 00074 CollisionPlane::init_type(); 00075 CollisionPolygon::init_type(); 00076 CollisionRay::init_type(); 00077 CollisionSegment::init_type(); 00078 CollisionSolid::init_type(); 00079 CollisionSphere::init_type(); 00080 00081 #ifdef DO_COLLISION_RECORDING 00082 CollisionRecorder::init_type(); 00083 CollisionVisualizer::init_type(); 00084 #endif 00085 00086 // Registration of writeable object's creation 00087 // functions with BamReader's factory 00088 CollisionNode::register_with_read_factory(); 00089 CollisionPlane::register_with_read_factory(); 00090 CollisionPolygon::register_with_read_factory(); 00091 CollisionRay::register_with_read_factory(); 00092 CollisionSegment::register_with_read_factory(); 00093 CollisionSphere::register_with_read_factory(); 00094 }