Panda3D
panda
src
collide
collisionHandler.h
1
// Filename: collisionHandler.h
2
// Created by: drose (16Mar02)
3
//
4
////////////////////////////////////////////////////////////////////
5
//
6
// PANDA 3D SOFTWARE
7
// Copyright (c) Carnegie Mellon University. All rights reserved.
8
//
9
// All use of this software is subject to the terms of the revised BSD
10
// license. You should have received a copy of this license along
11
// with this source code in a file named "LICENSE."
12
//
13
////////////////////////////////////////////////////////////////////
14
15
#ifndef COLLISIONHANDLER_H
16
#define COLLISIONHANDLER_H
17
18
#include "pandabase.h"
19
20
#include "typedReferenceCount.h"
21
#include "nodePath.h"
22
23
class
CollisionEntry
;
24
25
////////////////////////////////////////////////////////////////////
26
// Class : CollisionHandler
27
// Description : The abstract interface to a number of classes that
28
// decide what to do when a collision is detected. One
29
// of these must be assigned to the CollisionTraverser
30
// that is processing collisions in order to specify how
31
// to dispatch detected collisions.
32
////////////////////////////////////////////////////////////////////
33
class
EXPCL_PANDA_COLLIDE
CollisionHandler
:
public
TypedReferenceCount
{
34
public
:
35
CollisionHandler
();
36
37
virtual
void
begin_group();
38
virtual
void
add_entry(
CollisionEntry
*entry);
39
virtual
bool
end_group();
40
41
INLINE
bool
wants_all_potential_collidees()
const
;
42
INLINE
void
set_root(
const
NodePath
&root);
43
44
PUBLISHED:
45
static
TypeHandle
get_class_type() {
46
return
_type_handle;
47
}
48
49
public
:
50
static
void
init_type() {
51
TypedReferenceCount::init_type();
52
register_type(_type_handle,
"CollisionHandler"
,
53
TypedReferenceCount::get_class_type());
54
}
55
virtual
TypeHandle
get_type()
const
{
56
return
get_class_type();
57
}
58
virtual
TypeHandle
force_init_type() {init_type();
return
get_class_type();}
59
60
protected
:
61
bool
_wants_all_potential_collidees;
62
const
NodePath
*_root;
63
64
private
:
65
static
TypeHandle
_type_handle;
66
67
friend
class
CollisionTraverser
;
68
};
69
70
#include "collisionHandler.I"
71
72
#endif
73
74
75
CollisionHandler
The abstract interface to a number of classes that decide what to do when a collision is detected...
Definition:
collisionHandler.h:33
TypedReferenceCount
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
Definition:
typedReferenceCount.h:35
CollisionEntry
Defines a single collision event.
Definition:
collisionEntry.h:46
CollisionTraverser
This class manages the traversal through the scene graph to detect collisions.
Definition:
collisionTraverser.h:49
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition:
typeHandle.h:85
NodePath
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition:
nodePath.h:165
Generated on Wed May 17 2017 23:40:31 for Panda3D by
1.8.13