|
@@ -17,6 +17,52 @@
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: CollisionHandlerPhysical::set_center
|
|
|
|
|
+// Access: Published
|
|
|
|
|
+// Description: Specifies an arbitrary NodePath that the handler is
|
|
|
|
|
+// always considered to be facing. It does not detect
|
|
|
|
|
+// collisions with surfaces that appear to be facing
|
|
|
|
|
+// away from this NodePath. This works best when the
|
|
|
|
|
+// collision surfaces in question are polygons.
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+INLINE void CollisionHandlerPhysical::
|
|
|
|
|
+set_center(const NodePath ¢er) {
|
|
|
|
|
+ _center = center;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: CollisionHandlerPhysical::clear_center
|
|
|
|
|
+// Access: Published
|
|
|
|
|
+// Description: Clears the center NodePath specified with set_center.
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+INLINE void CollisionHandlerPhysical::
|
|
|
|
|
+clear_center() {
|
|
|
|
|
+ _center = NodePath();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: CollisionHandlerPhysical::get_center
|
|
|
|
|
+// Access: Published
|
|
|
|
|
+// Description: Returns the NodePath specified with set_center, or
|
|
|
|
|
+// the empty NodePath if nothing has been specified.
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+INLINE const NodePath &CollisionHandlerPhysical::
|
|
|
|
|
+get_center() const {
|
|
|
|
|
+ return _center;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: CollisionHandlerPhysical::has_center
|
|
|
|
|
+// Access: Published
|
|
|
|
|
+// Description: Returns true if a NodePath has been specified with
|
|
|
|
|
+// set_center(), false otherwise.
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+INLINE bool CollisionHandlerPhysical::
|
|
|
|
|
+has_center() const {
|
|
|
|
|
+ return !_center.is_empty();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: CollisionHandlerPhysical::ColliderDef::set_target
|
|
// Function: CollisionHandlerPhysical::ColliderDef::set_target
|
|
|
// Access: Public
|
|
// Access: Public
|