This file contains 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> // Siv3D v0.6.14 | |
//既約分数n/m角形の頂点を求める | |
LineString makeRegularRationalShapeLineString(const Vec2& center, double r, int32 n, int32 m) | |
{ | |
LineString points(n); | |
for (auto i : step(n)) | |
{ | |
const double theta = Math::TwoPi / n * i * m; | |
points[i] = center + Circular(r, theta); |
This file contains 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> // Siv3D v0.6.14 | |
//InputAndPair と InputOrPair は、2つの入力を組み合わせた入力を表すクラスです。 | |
//二つの入力が、downとupを必ず交互によびだすとき、そのペアもdownとupを必ず交互によびだします。 | |
//InputManageFlag は、入力と一緒にペアを作ることが出来るフラグです。 | |
// update(bool currentPressed) で、入力の状態を更新します。 | |
//※おそらくOpenSiv3Dの実装内にあるInputStateを縮小したもの | |
This file contains 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.6.14 | |
//宣言 | |
class MiniWindow { | |
public: | |
MiniWindow(const Rect& rect, double scale ,const Color& backgroundColor = ColorF(0.4)); | |
void update(const Size parentSceneSize); |
This file contains 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
class ScrollBar | |
{ | |
public: | |
using Config = Config::ScrollBar; | |
constexpr static int32 Thickness = Config::TrackMargin * 2 + Config::ThumbThickness; | |
constexpr static int32 MinLength = Config::TrackMargin * 2 + Config::ThumbMinLength; | |
constexpr static double ThumbRoundness = Config::ThumbThickness * 0.5; |
This file contains 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> // Siv3D v0.6.14 | |
struct Ball | |
{ | |
P2Body body; | |
double r; | |
Color color; | |
}; | |
void Main() |
This file contains 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> | |
struct Electrification { | |
Float2 scale; | |
float time; | |
float speed; | |
uint32 octaves; | |
}; | |
void Main() { |
This file contains 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> // Siv3D v0.6.14 | |
MultiPolygon createLogoPolygon() { | |
Bezier3 bezier(Vec2(230, 429), Vec2(404, 490), Vec2(573, 375), Vec2(573, 277)); | |
Bezier3 bezier2(Vec2(573, 277), Vec2(573, 194), Vec2(467, 141), Vec2(425, 244)); | |
Bezier3 bezier3(Vec2(401, 245), Vec2(456, 124), Vec2(626, 165), Vec2(626, 304)); | |
Bezier3 bezier4(Vec2(626, 304), Vec2(626, 440), Vec2(420, 530), Vec2(230, 429)); | |
auto moveBy = [](Bezier3& bezier, Vec2 v) { | |
bezier.p0 += v; |
This file contains 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> | |
class NeighbourSearcher { | |
struct DistancePoint { | |
double distance; | |
int32 x; | |
int32 y; | |
auto operator<=>(const DistancePoint&) const = default; | |
}; |
This file contains 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> | |
# include "Multiplayer_Photon.hpp" | |
# include "PHOTON_APP_ID.SECRET" | |
SIV3D_CONCEPT_URBG | |
Array<Vec2> createPieceEdgePoints(URBG&& urbg) { | |
double centerX = Random(-0.15, 0.15, urbg) + 0.5; | |
double headwidth = Random(0.25, 0.35, urbg); | |
double headheight = -Random(0.12, 0.18, urbg); | |
double neckWidth = Random(0.12, 0.18, urbg); |
This file contains 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> // Siv3D v0.6.12 | |
void Main() | |
{ | |
const PixelShader wavePropagatePS = HLSL{ U"wave_propagate.hlsl", U"PS" }; | |
if (not wavePropagatePS) | |
{ | |
throw Error{ U"Failed to load a shader file" }; | |
} |
NewerOlder