Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions math32/box2.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (b *Box2) Center(optionalTarget *Vector2) *Vector2 {
return result.AddVectors(&b.min, &b.max).MultiplyScalar(0.5)
}

// Size calculates the size of this bounding box: the vector from
// Size calculates the size of this bounding box: the vector from
// its minimum point to its maximum point.
// Store pointer to the calculated size into optionalTarget, if not nil,
// and also returns it.
Expand All @@ -111,7 +111,7 @@ func (b *Box2) Size(optionalTarget *Vector2) *Vector2 {
} else {
result = optionalTarget
}
return result.SubVectors(&b.min, &b.max)
return result.SubVectors(&b.max, &b.min)
}

// ExpandByPoint may expand this bounding box to include the specified point.
Expand Down
4 changes: 2 additions & 2 deletions math32/box3.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (b *Box3) Center(optionalTarget *Vector3) *Vector3 {
return result.AddVectors(&b.Min, &b.Max).MultiplyScalar(0.5)
}

// Size calculates the size of this bounding box: the vector from
// Size calculates the size of this bounding box: the vector from
// its minimum point to its maximum point.
// Store pointer to the calculated size into optionalTarget, if not nil,
// and also returns it.
Expand All @@ -113,7 +113,7 @@ func (b *Box3) Size(optionalTarget *Vector3) *Vector3 {
} else {
result = optionalTarget
}
return result.SubVectors(&b.Min, &b.Max)
return result.SubVectors(&b.Max, &b.Min)
}

// ExpandByPoint may expand this bounding box to include the specified point.
Expand Down