tubeshowcase●1,668,423 videos♡ My collection 0
← Learn to Code

Learn to Code12:13

5.7: Complex Shapes in Box2D - The Nature of Code

The Coding Train ↗

From the creator

This video covers how to create shapes beyond rectangles and circles in Box2D using PolygonShape and by attaching multiple shapes to one body. Code: https://thecodingtrain.com/tracks/physics-libraries/physics-libraries/box2d/7-complex-shapes p5.js Web Editor Sketches: 🕹️ Polygon Bodies: https://editor.p5js.org/codingtrain/sketches/hiAzkgd8N 🕹️ Multi-shape Bodies: https://editor.p5js.org/codingtrain/sketches/ssItBjtrF 🎥 Previous: https://youtu.be/oBcv_P_YDrw 🎥 Next: https://youtu.be/4LYvltd07hk References: 🔗 Nature of Code: https://natureofcode.com 🔗 Nature of Code Processing Examples: https://github.com/nature-of-code/noc-examples-processing/tree/master/chp05_physicslibraries/box2d/NOC_5_5_MultiShapes 🔗 Box2D: https://box2d.org 🔗 JBox2d: https://github.com/jbox2d/jbox2d Timestamps: 0:00 Introduction 2:51 Custom Polygon 3:54 Convex shapes only 5:05 Box2d expects vertices in clockwise order 6:05 Look at example 7:25 Multiple shapes 9:04 Look at code 10:59 CreateFixture 11:44 Outro Editing by Mathieu Blanchette Animations by Jason Heglund Music from Epidemic Sound 🚂 Website: https://thecodingtrain.com/ 👾 Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide 🚩 Suggest Topics: https://github.com/CodingTrain/Suggestion-Box 💡 GitHub: https://github.com/CodingTrain 💬 Discord: https://thecodingtrain.com/discord 💖 Membership: http://youtube.com/thecodingtrain/join 🛒 Store: https://standard.tv/codingtrain 🖋️ Twitter: https://twitter.com/thecodingtrain 📸 I

Published 2015-08-06 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code