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