MCPcopy Create free account
hub / github.com/cuberite/cuberite / CheckConnection

Method CheckConnection

src/Generating/PieceGenerator.cpp:475–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

473
474
475bool cPieceGenerator::CheckConnection(
476 const cPiece::cConnector & a_ExistingConnector,
477 const Vector3i & a_ToPos,
478 const cPiece & a_Piece,
479 const cPiece::cConnector & a_NewConnector,
480 int a_NumCCWRotations,
481 const cPlacedPieces & a_OutPieces
482)
483{
484 // For each placed piece, test the hitbox against the new piece:
485 cCuboid RotatedHitBox = a_Piece.RotateHitBoxToConnector(a_NewConnector, a_ToPos, a_NumCCWRotations);
486 RotatedHitBox.Sort();
487 for (cPlacedPieces::const_iterator itr = a_OutPieces.begin(), end = a_OutPieces.end(); itr != end; ++itr)
488 {
489 if ((*itr)->GetHitBox().DoesIntersect(RotatedHitBox))
490 {
491 return false;
492 }
493 }
494 return true;
495}
496
497
498

Callers

nothing calls this directly

Calls 6

SortMethod · 0.80
beginMethod · 0.80
endMethod · 0.80
DoesIntersectMethod · 0.45
GetHitBoxMethod · 0.45

Tested by

no test coverage detected