Skip to content

Commit

Permalink
Fixing BVH building on OBJ
Browse files Browse the repository at this point in the history
  • Loading branch information
BrentFarris committed Apr 30, 2024
1 parent 3db52d4 commit 1f0fa53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/editor/content/content_opener/obj_opener.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (o ObjOpener) Handles(adi asset_info.AssetDatabaseInfo) bool {
return adi.Type == editor_config.AssetTypeObj
}

func buildBVH(m load_result.Mesh, e *engine.Entity, bvh *collision.BVH) *collision.BVH {
func buildBVH(m load_result.Mesh, e *engine.Entity) *collision.BVH {
tris := make([]collision.DetailedTriangle, len(m.Indexes)/3)
group := sync.WaitGroup{}
construct := func(from, to int) {
Expand Down Expand Up @@ -120,7 +120,7 @@ func load(host *engine.Host, adi asset_info.AssetDatabaseInfo, e *engine.Entity,
return err
}
mesh = rendering.NewMesh(adi.ID, m.Verts, m.Indexes)
buildBVH(m, e, bvh)
bvh.Insert(buildBVH(m, e))
}
host.MeshCache().AddMesh(mesh)
drawing := rendering.Drawing{
Expand Down

0 comments on commit 1f0fa53

Please sign in to comment.