forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathodeSpace.h
More file actions
147 lines (121 loc) · 4.18 KB
/
odeSpace.h
File metadata and controls
147 lines (121 loc) · 4.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
// Filename: odeSpace.h
// Created by: joswilso (27Dec06)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////
#ifndef ODESPACE_H
#define ODESPACE_H
#include "pandabase.h"
#include "typedObject.h"
#include "luse.h"
#include "bitMask.h"
//included for collision tests
#include "odeWorld.h"
#include "odeJointGroup.h"
#include "ode_includes.h"
class OdeGeom;
class OdeTriMeshGeom;
class OdeSimpleSpace;
class OdeHashSpace;
class OdeQuadTreeSpace;
////////////////////////////////////////////////////////////////////
// Class : OdeSpace
// Description :
////////////////////////////////////////////////////////////////////
class EXPCL_PANDAODE OdeSpace : public TypedObject {
friend class OdeGeom;
static const int MAX_CONTACTS;
public:
OdeSpace(dSpaceID id);
PUBLISHED:
virtual ~OdeSpace();
void destroy();
INLINE bool is_empty() const;
INLINE void set_cleanup(int mode);
INLINE int get_cleanup() const;
int query(const OdeGeom& geom) const;
int query(const OdeSpace& space) const;
INLINE int get_num_geoms() const;
INLINE void get_AABB(LVecBase3f &min, LVecBase3f &max) const;
EXTENSION(INLINE PyObject *get_AA_bounds() const);
INLINE int is_space();
INLINE int get_class() const;
INLINE void set_category_bits(const BitMask32 &bits);
INLINE void set_collide_bits(const BitMask32 &bits);
INLINE BitMask32 get_category_bits();
INLINE BitMask32 get_collide_bits();
INLINE void enable();
INLINE void disable();
INLINE int is_enabled();
void set_auto_collide_world(OdeWorld&);
void set_auto_collide_joint_group(OdeJointGroup&);
void add(OdeGeom& geom);
void add(OdeSpace& space);
void remove(OdeGeom& geom);
void remove(OdeSpace& space);
void clean();
OdeGeom get_geom(int i); // Not INLINE because of forward declaration
//static int get_surface_type(OdeSpace * self, dGeomID o1);
INLINE OdeSpace get_space() const;
virtual void write(ostream &out = cout, unsigned int indent=0) const;
operator bool () const;
OdeSimpleSpace convert_to_simple_space() const;
OdeHashSpace convert_to_hash_space() const;
OdeQuadTreeSpace convert_to_quad_tree_space() const;
EXTENSION(PyObject *convert() const);
EXTENSION(INLINE PyObject *get_converted_geom(int i) const);
EXTENSION(INLINE PyObject *get_converted_space() const);
void auto_collide();
EXTENSION(int collide(PyObject* arg, PyObject* near_callback));
int set_collide_id(int collide_id, dGeomID id);
int set_collide_id(OdeGeom& geom, int collide_id);
void set_surface_type( int surface_type, dGeomID id);
void set_surface_type(OdeGeom& geom, int surface_type);
int get_surface_type(dGeomID o1);
int get_surface_type(OdeGeom& geom);
int get_collide_id(dGeomID o1);
int get_collide_id(OdeGeom& geom);
INLINE void set_collision_event(const string &event_name);
INLINE string get_collision_event();
public:
static void auto_callback(void*, dGeomID, dGeomID);
INLINE dSpaceID get_id() const;
static OdeWorld* _static_auto_collide_world;
static OdeSpace* _static_auto_collide_space;
static dJointGroupID _static_auto_collide_joint_group;
static int contactCount;
string _collision_event;
protected:
dSpaceID _id;
OdeWorld* _auto_collide_world;
dJointGroupID _auto_collide_joint_group;
public:
static TypeHandle get_class_type() {
return _type_handle;
}
static void init_type() {
TypedObject::init_type();
register_type(_type_handle, "OdeSpace",
TypedObject::get_class_type());
}
virtual TypeHandle get_type() const {
return get_class_type();
}
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
private:
static TypeHandle _type_handle;
typedef pmap<dGeomID, int> GeomSurfaceMap;
GeomSurfaceMap _geom_surface_map;
typedef pmap<dGeomID, int> GeomCollideIdMap;
GeomCollideIdMap _geom_collide_id_map;
};
#include "odeSpace.I"
#endif