Panda3D
bulletConvexPointCloudShape.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 bulletConvexPointCloudShape.h
10  * @author enn0x
11  * @date 2010-01-30
12  */
13 
14 #ifndef __BULLET_CONVEX_POINT_CLOUD_SHAPE_H__
15 #define __BULLET_CONVEX_POINT_CLOUD_SHAPE_H__
16 
17 #include "pandabase.h"
18 
19 #include "bullet_includes.h"
20 #include "bulletShape.h"
21 
22 #include "geom.h"
23 #include "pta_LVecBase3.h"
24 
25 /**
26  *
27  */
28 class EXPCL_PANDABULLET BulletConvexPointCloudShape : public BulletShape {
29 private:
30  // Only used by make_from_bam
32 
33 PUBLISHED:
34  explicit BulletConvexPointCloudShape(const PTA_LVecBase3 &points, LVecBase3 scale=LVecBase3(1.));
35  explicit BulletConvexPointCloudShape(const Geom *geom, LVecBase3 scale=LVecBase3(1.));
38 
39  int get_num_points() const;
40 
41  MAKE_PROPERTY(num_points, get_num_points);
42 
43 public:
44  virtual btCollisionShape *ptr() const;
45 
46 private:
47  btConvexPointCloudShape *_shape;
48  LVecBase3 _scale;
49 
50 public:
51  static void register_with_read_factory();
52  virtual void write_datagram(BamWriter *manager, Datagram &dg);
53 
54 protected:
55  static TypedWritable *make_from_bam(const FactoryParams &params);
56  void fillin(DatagramIterator &scan, BamReader *manager);
57 
58 public:
59  static TypeHandle get_class_type() {
60  return _type_handle;
61  }
62  static void init_type() {
63  BulletShape::init_type();
64  register_type(_type_handle, "BulletConvexPointCloudShape",
65  BulletShape::get_class_type());
66  }
67  virtual TypeHandle get_type() const {
68  return get_class_type();
69  }
70  virtual TypeHandle force_init_type() {
71  init_type();
72  return get_class_type();
73  }
74 
75 private:
76  static TypeHandle _type_handle;
77 };
78 
80 
81 #endif // __BULLET_CONVEX_POINT_CLOUD_SHAPE_H__
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
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:35
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
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:63
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...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
A container for geometry primitives.
Definition: geom.h:54
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:36
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A class to retrieve the individual data elements previously stored in a Datagram.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:38