Panda3D

physxShapeDesc.h

00001 // Filename: physxShapeDesc.h
00002 // Created by:  enn0x (08Sep09)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef PHYSXSHAPEDESC_H
00016 #define PHYSXSHAPEDESC_H
00017 
00018 #include "pandabase.h"
00019 #include "lpoint3.h"
00020 #include "lmatrix.h"
00021 
00022 #include "physxEnums.h"
00023 #include "physx_includes.h"
00024 
00025 class PhysxMaterial;
00026 
00027 ////////////////////////////////////////////////////////////////////
00028 //       Class : PhysxShapeDesc
00029 // Description : Abstract base class for shape descriptors.
00030 //               Descriptors for all the different shape types are
00031 //               derived from this class.
00032 ////////////////////////////////////////////////////////////////////
00033 class EXPCL_PANDAPHYSX PhysxShapeDesc : public PhysxEnums, public ReferenceCount {
00034 
00035 PUBLISHED:
00036   virtual void set_to_default() = 0;
00037   virtual bool is_valid() const = 0;
00038 
00039   void set_name(const char *name);
00040   void set_trigger(bool value);
00041   void set_local_pos(const LPoint3f &pos);
00042   void set_local_mat(const LMatrix4f &mat);
00043   void set_local_hpr(float h, float p, float r);
00044   void set_skin_width(float skinWidth);
00045   void set_shape_flag(const PhysxShapeFlag flag, bool value);
00046   void set_mass(float mass);
00047   void set_density(float density);
00048   void set_group(unsigned short group);
00049   void set_material(const PhysxMaterial &material);
00050   void set_material_index(unsigned short index);
00051 
00052   const char *get_name() const;
00053   LPoint3f get_local_pos() const;
00054   LMatrix4f get_local_mat() const;
00055   float get_skin_width() const;
00056   bool get_shape_flag(const PhysxShapeFlag flag) const;
00057   float get_mass() const;
00058   float get_density() const;
00059   unsigned short get_group() const;
00060   unsigned short get_material_index() const;
00061 
00062 public:
00063   virtual NxShapeDesc *ptr() const = 0;
00064 
00065 private:
00066   string _name;
00067 
00068 protected:
00069   INLINE PhysxShapeDesc();
00070   INLINE ~PhysxShapeDesc();
00071 };
00072 
00073 #include "physxShapeDesc.I"
00074 
00075 #endif // PHYSXSHAPEDESC_H
 All Classes Functions Variables Enumerations