Skip to content

SetBoundingBox doesn't set _size. #41

@SPapandreou

Description

@SPapandreou

Implementation of SetBoundingBox() in BoundingBox.cs should be like this:

   ```
     /// <summary>
    /// Configures the bounding box with the specified center and scope (half-size).
    /// </summary>
    public void SetBoundingBox(Vector3d center, Vector3d scope)
    {
        this._center = center;
        _scope = scope;
        _size = scope * (Fixed64)2;
        _min = this._center - Scope;
        _max = this._center + Scope;
        _isDirty = true;
    }
    ```

Without setting the size, the BoundingBox will deserialize with _min == _max == _center.
With changing it a bit, this can probably be optimized to remove the extra multiplication with 2.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions