Panda3D
bulletConeShape.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file bulletConeShape.h
10  * @author enn0x
11  * @date 2010-01-24
12  */
13 
14 #ifndef __BULLET_CONE_SHAPE_H__
15 #define __BULLET_CONE_SHAPE_H__
16 
17 #include "pandabase.h"
18 
19 #include "bullet_includes.h"
20 #include "bullet_utils.h"
21 #include "bulletShape.h"
22 
23 /**
24  *
25  */
26 class EXPCL_PANDABULLET BulletConeShape : public BulletShape {
27 private:
28  // Only used by make_from_bam
29  INLINE BulletConeShape();
30 
31 PUBLISHED:
32  explicit BulletConeShape(PN_stdfloat radius, PN_stdfloat height, BulletUpAxis up=Z_up);
33  BulletConeShape(const BulletConeShape &copy);
34  INLINE ~BulletConeShape();
35 
36  INLINE PN_stdfloat get_radius() const;
37  INLINE PN_stdfloat get_height() const;
38 
39  MAKE_PROPERTY(radius, get_radius);
40  MAKE_PROPERTY(height, get_height);
41 
42 public:
43  virtual btCollisionShape *ptr() const;
44 
45 private:
46  btConeShape *_shape;
47  PN_stdfloat _radius;
48  PN_stdfloat _height;
49  BulletUpAxis _up;
50 
51 public:
52  static void register_with_read_factory();
53  virtual void write_datagram(BamWriter *manager, Datagram &dg);
54 
55 protected:
56  static TypedWritable *make_from_bam(const FactoryParams &params);
57  void fillin(DatagramIterator &scan, BamReader *manager);
58 
59 public:
60  static TypeHandle get_class_type() {
61  return _type_handle;
62  }
63  static void init_type() {
64  BulletShape::init_type();
65  register_type(_type_handle, "BulletConeShape",
66  BulletShape::get_class_type());
67  }
68  virtual TypeHandle get_type() const {
69  return get_class_type();
70  }
71  virtual TypeHandle force_init_type() {
72  init_type();
73  return get_class_type();
74  }
75 
76 private:
77  static TypeHandle _type_handle;
78 };
79 
80 #include "bulletConeShape.I"
81 
82 #endif // __BULLET_CONE_SHAPE_H__
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:110
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:63
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:38
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:36
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:35
virtual void fillin(DatagramIterator &scan, BamReader *manager)
This internal function is intended to be called by each class's make_from_bam() method to read in all...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22