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

panda/src/physics/physicsObject.h

Go to the documentation of this file.
00001 // Filename: physicsObject.h
00002 // Created by:  charles (13Jun00)
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 PHYSICS_OBJECT_H
00020 #define PHYSICS_OBJECT_H
00021 
00022 #include <pandabase.h>
00023 #include <typedReferenceCount.h>
00024 #include <luse.h>
00025 
00026 ////////////////////////////////////////////////////////////////////
00027 //       Class : PhysicsObject
00028 // Description : A body on which physics will be applied.  If you're
00029 //               looking to add physical motion to your class, do
00030 //               NOT derive from this.  Derive from Physical instead.
00031 ////////////////////////////////////////////////////////////////////
00032 class EXPCL_PANDAPHYSICS PhysicsObject : public TypedReferenceCount {
00033 private:
00034   // physical
00035   LPoint3f _position;
00036   LPoint3f _last_position;
00037   LVector3f _velocity;
00038 
00039   // angular
00040   LOrientationf _orientation;
00041   LVector3f _rotation;
00042 
00043   float _terminal_velocity;
00044   float _mass;
00045 
00046   bool _process_me;
00047   bool _oriented;
00048 
00049 PUBLISHED:
00050   PhysicsObject(void);
00051   PhysicsObject(const PhysicsObject &copy);
00052   virtual ~PhysicsObject(void);
00053   const PhysicsObject &operator =(const PhysicsObject &other);
00054 
00055   static const float _default_terminal_velocity;
00056 
00057   INLINE void set_mass(float);
00058   INLINE float get_mass(void) const;
00059 
00060   INLINE void set_position(const LPoint3f &pos);
00061   INLINE void set_position(float x, float y, float z);
00062   INLINE LPoint3f get_position(void) const;
00063 
00064   INLINE void set_position_HandOfGod(const LPoint3f &pos);
00065 
00066   INLINE void set_last_position(const LPoint3f &pos);
00067   INLINE LPoint3f get_last_position(void) const;
00068 
00069   INLINE void set_velocity(const LVector3f &vel);
00070   INLINE void set_velocity(float x, float y, float z);
00071   INLINE LVector3f get_velocity(void) const;
00072 
00073   INLINE void set_active(bool flag);
00074   INLINE bool get_active(void) const;
00075 
00076   INLINE void set_oriented(bool flag);
00077   INLINE bool get_oriented(void) const;
00078 
00079   INLINE void set_terminal_velocity(float tv);
00080   INLINE float get_terminal_velocity(void) const;
00081 
00082   INLINE void set_orientation(const LOrientationf &orientation);
00083   INLINE LOrientationf get_orientation(void) const;
00084 
00085   INLINE void set_rotation(const LVector3f &rotation);
00086   INLINE LVector3f get_rotation(void) const;
00087 
00088   virtual LMatrix4f get_inertial_tensor(void) const;
00089   virtual LMatrix4f get_lcs(void) const;
00090   virtual PhysicsObject *make_copy(void) const;
00091 
00092 public:
00093   static TypeHandle get_class_type() {
00094     return _type_handle;
00095   }
00096   static void init_type() {
00097     TypedReferenceCount::init_type();
00098     register_type(_type_handle, "PhysicsObject",
00099                   TypedReferenceCount::get_class_type());
00100   }
00101   virtual TypeHandle get_type() const {
00102     return get_class_type();
00103   }
00104   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00105 
00106 private:
00107   static TypeHandle _type_handle;
00108 };
00109 
00110 #include "physicsObject.I"
00111 
00112 #endif // __PHYSICS_OBJECT_H__

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