Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/physics/physicalNode.h

Go to the documentation of this file.
00001 // Filename: physicalNode.h
00002 // Created by:  charles (01Aug00)
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 #ifndef PHYSICALNODE_H
00020 #define PHYSICALNODE_H
00021 
00022 #include "pandabase.h"
00023 #include "pandaNode.h"
00024 
00025 #include "pvector.h"
00026 
00027 #include "physical.h"
00028 #include "config_physics.h"
00029 
00030 ////////////////////////////////////////////////////////////////////
00031 //        Class : PhysicalNode
00032 //  Description : Graph node that encapsulated a series of physical
00033 //                objects
00034 ////////////////////////////////////////////////////////////////////
00035 class EXPCL_PANDAPHYSICS PhysicalNode : public PandaNode {
00036 private:
00037   pvector< PT(Physical) > _physicals;
00038 
00039 PUBLISHED:
00040   PhysicalNode(const string &name);
00041 
00042 protected:
00043   PhysicalNode(const PhysicalNode &copy);
00044 
00045 public:
00046   virtual ~PhysicalNode(void);
00047   virtual bool safe_to_flatten(void) const { return false; }
00048   virtual PandaNode *make_copy(void) const;
00049 
00050 PUBLISHED:
00051   INLINE void clear(void);
00052   INLINE Physical *get_physical(int index) const;
00053   INLINE int get_num_physicals(void) const;
00054   INLINE void add_physical(Physical *physical);
00055 
00056   void add_physicals_from(const PhysicalNode &other);
00057   void remove_physical(Physical *physical);
00058   void remove_physical(int index);
00059 
00060 public:
00061   static TypeHandle get_class_type(void) {
00062     return _type_handle;
00063   }
00064   static void init_type(void) {
00065     PandaNode::init_type();
00066     register_type(_type_handle, "PhysicalNode",
00067                   PandaNode::get_class_type());
00068   }
00069   virtual TypeHandle get_type(void) const {
00070     return get_class_type();
00071   }
00072   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00073 
00074 private:
00075   static TypeHandle _type_handle;
00076 };
00077 
00078 #include "physicalNode.I"
00079 
00080 #endif // PHYSICALNODE_H

Generated on Fri May 2 00:43:03 2003 for Panda by doxygen1.3