|
|
@@ -50,6 +50,14 @@ operator = (const CollisionHandlerEvent::SortEntries &) {
|
|
|
// The event name will be based on the in_pattern
|
|
|
// string specified here, with all occurrences of the
|
|
|
// above strings replaced with the corresponding values.
|
|
|
+//
|
|
|
+// In general, the in_pattern event is thrown on the
|
|
|
+// first detection of a collision between two particular
|
|
|
+// nodes. In subsequent passes, as long as a collision
|
|
|
+// between those two nodes continues to be detected each
|
|
|
+// frame, the again_pattern is thrown. The first frame
|
|
|
+// in which the collision is no longer detected, the
|
|
|
+// out_pattern event is thrown.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
INLINE void CollisionHandlerEvent::
|
|
|
set_in_pattern(const string &in_pattern) {
|
|
|
@@ -68,6 +76,42 @@ get_in_pattern() const {
|
|
|
return _in_pattern;
|
|
|
}
|
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: CollisionHandlerEvent::set_again_pattern
|
|
|
+// Access: Public
|
|
|
+// Description: Sets the pattern string that indicates how the event
|
|
|
+// names are generated when a collision between two
|
|
|
+// particular nodes is *still* detected. This event is
|
|
|
+// each consecutive time a collision between two
|
|
|
+// particular nodes is detected, starting with the
|
|
|
+// second time.
|
|
|
+//
|
|
|
+// In general, the in_pattern event is thrown on the
|
|
|
+// first detection of a collision between two particular
|
|
|
+// nodes. In subsequent passes, as long as a collision
|
|
|
+// between those two nodes continues to be detected each
|
|
|
+// frame, the again_pattern is thrown. The first frame
|
|
|
+// in which the collision is no longer detected, the
|
|
|
+// out_pattern event is thrown.
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+INLINE void CollisionHandlerEvent::
|
|
|
+set_again_pattern(const string &again_pattern) {
|
|
|
+ _again_pattern = again_pattern;
|
|
|
+}
|
|
|
+
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: CollisionHandlerEvent::get_again_pattern
|
|
|
+// Access: Public
|
|
|
+// Description: Returns the pattern string that indicates how the
|
|
|
+// event names are generated when a collision between
|
|
|
+// two particular nodes is *still* detected. See
|
|
|
+// set_again_pattern() and set_in_pattern().
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+INLINE string CollisionHandlerEvent::
|
|
|
+get_again_pattern() const {
|
|
|
+ return _again_pattern;
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: CollisionHandlerEvent::set_out_pattern
|
|
|
@@ -78,12 +122,11 @@ get_in_pattern() const {
|
|
|
//
|
|
|
// In general, the in_pattern event is thrown on the
|
|
|
// first detection of a collision between two particular
|
|
|
-// nodes. Thereafter, as long as a collision between
|
|
|
-// those two nodes continues to be detected each frame,
|
|
|
-// no further events (associated with this particular
|
|
|
-// pair of nodes) are thrown. The first frame in which
|
|
|
-// the collision is no longer detected, the out_pattern
|
|
|
-// event is thrown.
|
|
|
+// nodes. In subsequent passes, as long as a collision
|
|
|
+// between those two nodes continues to be detected each
|
|
|
+// frame, the again_pattern is thrown. The first frame
|
|
|
+// in which the collision is no longer detected, the
|
|
|
+// out_pattern event is thrown.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
INLINE void CollisionHandlerEvent::
|
|
|
set_out_pattern(const string &out_pattern) {
|