this post was submitted on 09 Feb 2024
7 points (100.0% liked)

Bevy

2 readers
1 users here now

A community for discussion around the bevy game engine! https://bevyengine.org/

founded 11 months ago
MODERATORS
7
Implemented door placement (files.mastodon.social)
submitted 9 months ago* (last edited 9 months ago) by Shatur@lemmy.ml to c/bevy@programming.dev
 

Boolean operations in 3D are quite heavy. But fortunately, each wall can be represented as two 2D planes.

To determine which 2D shape I need to cut from the mentioned planes, I add a special plane in Blender with "Cutout" name. This is what The Sims series do.

And for all doors located on a wall I triangulate combined vertices using earcutr. The library API doesn't fit well with Bevy, but it does the trick.

The project is open source, so if you are interested in the implementation, you can take a look at the wall module. I organize my modules as plugins, so you can copy the module and its submodules into your game with some minor edits and enable WallPlugin.

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here