Beispiel #1
0
void Grapple::NotifyMove(bool collision)
{
  bool addNode = false;

  if (!attached)
    return;

  // Check if the character collide something.
  if (collision) {
      // Yes there has been a collision.
    if (delta_len.IsNotZero()) {
      // The character tryed to change the rope size.
      // There has been a collision, so we cancel the rope length change.
      ActiveCharacter().ChangePhysRopeSize (-delta_len);
      delta_len = 0;
    }
    return;
  }


  // While there is nodes to add, we add !
  while (TryAddNode())
    addNode = true;

  // If we have created nodes, we exit to avoid breaking what we
  // have just done !
  if (addNode)
    return;

  TryRemoveNodes();
}
Beispiel #2
0
    Node* ModelBuilder::AddNode(Model& model, const std::string& nodeTypeName, const std::vector<std::string>& args)
    {
        Node* temp = nullptr;
        bool valid = TryAddNode(model, nodeTypeName, args, temp);
        if (valid)
        {
            return temp;
        }

        throw utilities::InputException(utilities::InputExceptionErrors::invalidArgument, "Unknown node type");
    }