Exemple #1
0
 private void AdjustObjectBoxCenterToSitOnSurface(OrientedBox objectBox, ObjectSurfaceData objectSurfaceData, DecorPaintObjectPlacementBrushElement brushElement)
 {
     if (brushElement.AlignToSurface)
     {
         objectBox.Center = objectSurfaceData.BasePosition + objectSurfaceData.SurfaceNormal * 0.5f * objectBox.GetSizeAlongDirection(objectSurfaceData.SurfaceNormal);
     }
     else
     {
         BoxFace boxFaceWhichFacesSurfaceNormal = objectBox.GetBoxFaceWhichFacesNormal(_workingBrushCircle.Plane.normal);
         Vector3 faceCenter = objectBox.GetBoxFaceCenter(boxFaceWhichFacesSurfaceNormal);
         Vector3 fromFaceCenterToBoxCenter = objectBox.Center - faceCenter;
         objectBox.Center = objectSurfaceData.BasePosition + fromFaceCenterToBoxCenter;
     }
 }