//updates given node without moving fixedComponent public void update_node(HikingRigidNode aNode, HikingRigidComponent fixedComponent, int depth, int maxDepth = 200) { //foreach connected body //TODO if we are OK, then just return //TODO max iteration stops here, output error message if (depth > maxDepth) { Debug.Log("reached max depth :("); return; } //updated //foreach //recurse /* * //TODO set this to nodes we actually want to recurse on * var node = aNode; * foreach(var e in node.parents) * { * if(e != fixedComponent) * { * update_node(node,e,depth+1); * } * }*/ }
//collides and attempts to resolve given component public bool collide_component(HikingRigidComponent aComponent) { bool r = false; //loop max iterations //foreach node //collide assuming linear motion //resolve node position linearly //resolve attached nodes using angular velocity and collision time //r = true; return(r); }