Browse Source

fix ambiguous wrt in collision traversal

David Rose 24 years ago
parent
commit
86869cf402
2 changed files with 11 additions and 5 deletions
  1. 2 2
      panda/src/collide/collisionTraverser.cxx
  2. 9 3
      panda/src/sgmanip/nodePath.cxx

+ 2 - 2
panda/src/collide/collisionTraverser.cxx

@@ -360,8 +360,8 @@ reached_node(Node *node, NullAttributeWrapper &,
 	  entry._from = level_state.get_collider(c);
 	  entry._from = level_state.get_collider(c);
 	  entry._from_space = level_state.get_space(c);
 	  entry._from_space = level_state.get_space(c);
 	  
 	  
-	  LMatrix4f into_space_inv;
-	  get_rel_mat(NULL, node, into_space_inv, _graph_type);
+          NodePath root;
+	  LMatrix4f into_space_inv = root.get_mat(entry._into_node_path);
 	  entry._wrt_space = entry._from_space * into_space_inv;
 	  entry._wrt_space = entry._from_space * into_space_inv;
 	  entry._inv_wrt_space = 
 	  entry._inv_wrt_space = 
 	    entry._into_space * level_state.get_inv_space(c);
 	    entry._into_space * level_state.get_inv_space(c);

+ 9 - 3
panda/src/sgmanip/nodePath.cxx

@@ -1790,12 +1790,18 @@ set_mat(const NodePath &other, const LMatrix4f &mat) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 LMatrix4f NodePath::
 LMatrix4f NodePath::
 get_mat(const NodePath &other) const {
 get_mat(const NodePath &other) const {
-  nassertr(!is_empty(), LMatrix4f::ident_mat());
-
   NodeTransitionWrapper ntw(TransformTransition::get_class_type());
   NodeTransitionWrapper ntw(TransformTransition::get_class_type());
 
 
-  if (other.is_empty()) {
+  if (is_empty() && other.is_empty()) {
+    return LMatrix4f::ident_mat();
+
+  } else if (is_empty()) {
+    wrt(NULL, other.node(), other.begin(), other.end(),
+	ntw, _graph_type);
+
+  } else if (other.is_empty()) {
     wrt(node(), begin(), end(), (Node *)NULL, ntw, _graph_type);
     wrt(node(), begin(), end(), (Node *)NULL, ntw, _graph_type);
+
   } else {
   } else {
     wrt(node(), begin(), end(),
     wrt(node(), begin(), end(),
 	other.node(), other.begin(), other.end(),
 	other.node(), other.begin(), other.end(),