Panda3D
Loading...
Searching...
No Matches
bulletMinkowskiSumShape.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 bulletMinkowskiSumShape.h
10 * @author enn0x
11 * @date 2013-08-15
12 */
13
14#ifndef __BULLET_MINKOWSKI_SUM_SHAPE_H__
15#define __BULLET_MINKOWSKI_SUM_SHAPE_H__
16
17#include "pandabase.h"
18
19#include "bullet_includes.h"
20#include "bullet_utils.h"
21#include "bulletShape.h"
22
23#include "transformState.h"
24
25/**
26 *
27 */
28class EXPCL_PANDABULLET BulletMinkowskiSumShape : public BulletShape {
29private:
30 // Only used by make_from_bam
32
33PUBLISHED:
34 explicit BulletMinkowskiSumShape(const BulletShape *shape_a, const BulletShape *shape_b);
37
38 void set_transform_a(const TransformState *ts);
39 void set_transform_b(const TransformState *ts);
40 CPT(TransformState) get_transform_a() const;
41 CPT(TransformState) get_transform_b() const;
42
43 INLINE const BulletShape *get_shape_a() const;
44 INLINE const BulletShape *get_shape_b() const;
45
46 MAKE_PROPERTY(transform_a, get_transform_a, set_transform_a);
47 MAKE_PROPERTY(transform_b, get_transform_b, set_transform_b);
48 MAKE_PROPERTY(shape_a, get_shape_a);
49 MAKE_PROPERTY(shape_b, get_shape_b);
50
51public:
52 virtual btCollisionShape *ptr() const;
53
54private:
55 btMinkowskiSumShape *_shape;
56
57 CPT(BulletShape) _shape_a;
58 CPT(BulletShape) _shape_b;
59
60 // This is stored temporarily during read.
61 PN_stdfloat _margin;
62
63public:
64 static void register_with_read_factory();
65 virtual void write_datagram(BamWriter *manager, Datagram &dg);
67 BamReader *manager);
68 virtual bool require_fully_complete() const;
69
70protected:
71 static TypedWritable *make_from_bam(const FactoryParams &params);
72 void fillin(DatagramIterator &scan, BamReader *manager);
73
74public:
75 static TypeHandle get_class_type() {
76 return _type_handle;
77 }
78 static void init_type() {
79 BulletShape::init_type();
80 register_type(_type_handle, "BulletMinkowskiSumShape",
81 BulletShape::get_class_type());
82 }
83 virtual TypeHandle get_type() const {
84 return get_class_type();
85 }
86 virtual TypeHandle force_init_type() {
87 init_type();
88 return get_class_type();
89 }
90
91private:
92 static TypeHandle _type_handle;
93};
94
96
97#endif // __BULLET_MINKOWSKI_SUM_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...
Indicates a coordinate-system transform on vertices.
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.
virtual bool require_fully_complete() const
Some objects require all of their nested pointers to have been completed before the objects themselve...
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.
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
This is our own Panda specialization on the default STL list.
Definition plist.h:35
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(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.