This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # include <Siv3D.hpp> // OpenSiv3D v0.4.3 | |
| struct NoiseUnit | |
| { | |
| double value; | |
| Vec2 gradient; | |
| Vec2 curl; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # include <Siv3D.hpp> // OpenSiv3D v0.4.3 | |
| class Graph | |
| { | |
| using NodeID = int; | |
| using Patch = Array<NodeID>; | |
| private: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # include <Siv3D.hpp> // OpenSiv3D v0.4.3 | |
| Array<Polygon> createPolygons(RectF rect, double density) | |
| { | |
| Array<Vec2> centers = PoissonDisk2D(rect.size.asPoint(), density).getPoints(); | |
| centers.each([=](Vec2& v) { v.moveBy(rect.tl()); }); | |
| centers.keep_if([=](Vec2 v) { return rect.contains(v); }); | |
| Array<Polygon> polygons; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # include <Siv3D.hpp> // OpenSiv3D v0.4.2 | |
| struct Leaf | |
| { | |
| Vec2 pos; | |
| bool reached = false; | |
| Leaf(Vec2 _pos) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # include <Siv3D.hpp> // OpenSiv3D v0.4.2 | |
| RectF GetRectFrom2Pts(Vec2 _p1, Vec2 _p2) | |
| { | |
| Vec2 size(Abs(_p1.x - _p2.x), Abs(_p1.y - _p2.y)); | |
| if (_p1.x < _p2.x) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # include <Siv3D.hpp> // OpenSiv3D v0.4.2 | |
| RectF GetRectFrom2Pts(Vec2 _p1, Vec2 _p2) | |
| { | |
| Vec2 size(Abs(_p1.x - _p2.x), Abs(_p1.y - _p2.y)); | |
| if (_p1.x < _p2.x) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # include <Siv3D.hpp> // OpenSiv3D v0.4.2 | |
| struct Player | |
| { | |
| Texture texture; | |
| Vec2 pos; | |
| Player(Vec2 _pos = Scene::CenterF()) | |
| : texture(Emoji(U"🐭")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # include <Siv3D.hpp> // OpenSiv3D v0.4.2 | |
| struct PolyPad | |
| { | |
| String shape_name; | |
| double edge_length; | |
| Polygon poly; | |
| Polygon appearance; | |
| Color color; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # include <Siv3D.hpp> // OpenSiv3D v0.3.2 | |
| using ContourPaths = Array<Array<Array<Vec2>>>; | |
| class AnimatedCharacter | |
| { | |
| private: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # include <Siv3D.hpp> // OpenSiv3D v0.3.2 | |
| Image CreateNoiseImage(double _density) | |
| { | |
| Grid<double> grid(Window::Size()); | |
| const PerlinNoise noise(Random(0, 100000)); | |
| for (auto p : step(grid.size())) | |
| { |
NewerOlder