Panda3D
 All Classes Functions Variables Enumerations
physxSphereShape.h
00001 // Filename: physxSphereShape.h
00002 // Created by:  enn0x (16Sep09)
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 PHYSXSPHERESHAPE_H
00016 #define PHYSXSPHERESHAPE_H
00017 
00018 #include "pandabase.h"
00019 #include "luse.h"
00020 
00021 #include "physxShape.h"
00022 #include "physx_includes.h"
00023 
00024 class PhysxSphereShapeDesc;
00025 
00026 ////////////////////////////////////////////////////////////////////
00027 //       Class : PhysxSphereShape
00028 // Description : A sphere shaped collision detection primitive. 
00029 //               Each shape is owned by an actor that it is attached
00030 //               to.
00031 //
00032 //               An instance can be created by calling the
00033 //               createShape() method of the PhysxActor object that
00034 //               should own it, with a PhysxSphereShapeDesc object
00035 //               as the parameter, or by adding the shape descriptor
00036 //               into the PhysxActorDesc class before creating the
00037 //               actor.
00038 //
00039 //               The shape is deleted by calling release() on the
00040 //               shape itself.
00041 ////////////////////////////////////////////////////////////////////
00042 class EXPCL_PANDAPHYSX PhysxSphereShape : public PhysxShape {
00043 
00044 PUBLISHED:
00045   INLINE PhysxSphereShape();
00046   INLINE ~PhysxSphereShape();
00047 
00048   void save_to_desc(PhysxSphereShapeDesc &shapeDesc) const;
00049 
00050   void set_radius(float radius);
00051 
00052   float get_radius() const;
00053 
00054 ////////////////////////////////////////////////////////////////////
00055 public:
00056   INLINE NxShape *ptr() const { return (NxShape *)_ptr; };
00057 
00058   void link(NxShape *shapePtr);
00059   void unlink();
00060 
00061 private:
00062   NxSphereShape *_ptr;
00063 
00064 ////////////////////////////////////////////////////////////////////
00065 public:
00066   static TypeHandle get_class_type() {
00067     return _type_handle;
00068   }
00069   static void init_type() {
00070     PhysxShape::init_type();
00071     register_type(_type_handle, "PhysxSphereShape", 
00072                   PhysxShape::get_class_type());
00073   }
00074   virtual TypeHandle get_type() const {
00075     return get_class_type();
00076   }
00077   virtual TypeHandle force_init_type() {
00078     init_type();
00079     return get_class_type();
00080   }
00081 
00082 private:
00083   static TypeHandle _type_handle;
00084 };
00085 
00086 #include "physxSphereShape.I"
00087 
00088 #endif // PHYSXSPHERESHAPE_H
 All Classes Functions Variables Enumerations