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.9 | |
class RandomTree { | |
//drawする三角の頂点index保持用 | |
struct ThreeSizeT { | |
size_t first; | |
size_t second; | |
size_t third; | |
}; |
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 | |
struct GridCollisionInfo { | |
Vec2 pos; | |
std::array<Array<Size>, 4> collidedEdges; | |
bool collided() { | |
return xCollided() or yCollided(); | |
} | |
bool xCollided() { | |
return (bool)collidedEdges[0] or (bool)collidedEdges[2]; |
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
#pragma once | |
namespace s3d { | |
class Step3D | |
{ | |
public: | |
class Iterator | |
{ | |
public: |
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 | |
Ray transformedRay(const Ray& ray, const Mat4x4& mat) { | |
return Ray(mat.transformPoint(ray.getOrigin()), mat.transformPoint(ray.getDirection()).withLength(1)); | |
} | |
struct HexFace { | |
static Vec3 getFaceNormal(uint8 i) { | |
static std::array<Vec3, 6> normals{ | |
Vec3{-1, 0, 0}, |
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> | |
void dragVec2(Vec2& v, bool& dragging, double r = 5) { | |
if (v.asCircle(r).leftClicked())dragging = true; | |
if (MouseL.up()) { | |
if (KeySpace.pressed()) { | |
constexpr Point step{ 10,10 }; | |
v = Floor(v / step + Vec2{0.5, 0.5})* step; | |
} | |
dragging = false; |
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 <iostream> | |
#include <vector> | |
#include <algorithm> | |
//game rule | |
// player should reduce unknowns or pick knowns in one turn | |
// so, player can't pick not match pair from knowns | |
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" }; | |
} |
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> | |
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> // 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; |
OlderNewer