Commit 682e6dd3 authored by 魔大农's avatar 魔大农 🍀

Increased outline width, fixed some bugs and cleaned up code

parent f71149b4
No preview for this file type
......@@ -30,8 +30,8 @@ template <> unsigned MakeHash(const IntVector2& value)
Board::Board(): Object(MC->GetContext()),
indicateSingle_{false},
squares_{},
selectedSquare_{nullptr},
lastSelectedSquare_{nullptr}
selectedSquare_{},
lastSelectedSquare_{}
{
rootNode_ = MC->world_.scene_->CreateChild("Board");
StringVector tag{}; tag.Push(String("Board"));
......@@ -41,7 +41,13 @@ Board::Board(): Object(MC->GetContext()),
model_->SetMaterial(MC->GetMaterial("Board"));
model_->SetCastShadows(true);
//Fill board with squares
CreateSquares();
CreateIndicators();
SubscribeToEvent(E_SCENEUPDATE, URHO3D_HANDLER(Board, HandleSceneUpdate));
}
void Board::CreateSquares()
{
for (int i{0}; i < BOARD_WIDTH; ++i) for (int j{0}; j < BOARD_HEIGHT; ++j){
//Create base
Square* square{new Square};
......@@ -74,8 +80,9 @@ Board::Board(): Object(MC->GetContext()),
squares_[square->coords_] = square;
}
//Create Quatter indicators
}
void Board::CreateIndicators()
{
for (int i{0}; i < 6; ++i){
//Create base
Indicator* indicator{new Indicator};
......@@ -132,10 +139,7 @@ Board::Board(): Object(MC->GetContext()),
indicator->light2_->SetCastShadows(false);
indicators_.Push(SharedPtr<Indicator>(indicator));
}
SubscribeToEvent(E_SCENEUPDATE, URHO3D_HANDLER(Board, HandleSceneUpdate));
}
void Board::Reset()
{
......@@ -147,7 +151,7 @@ void Board::Reset()
}
DeselectAll();
Deselect();
}
void Board::Refuse()
......@@ -179,13 +183,15 @@ bool Board::IsFull() const
Vector3 Board::CoordsToPosition(IntVector2 coords)
{
return Vector3(0.5f + coords.x_ - BOARD_WIDTH/2,
return Vector3(0.5f + coords.x_ - BOARD_WIDTH / 2,
GetThickness(),
0.5f + coords.y_ - BOARD_HEIGHT/2);
0.5f + coords.y_ - BOARD_HEIGHT / 2);
}
void Board::HandleSceneUpdate(StringHash eventType, VariantMap& eventData)
{
(void)eventType;
for (Square* s: squares_.Values()){
s->slot_->SetMorphWeight(0, MC->Sine(2.3f, 0.0f, 1.0f));
......@@ -211,7 +217,10 @@ bool Board::PutPiece(Piece* piece, Square* square)
+ Vector3(Random(-0.05f, 0.05f),
0.0f,
Random(-0.05f, 0.05f)));
DeselectAll();
Deselect();
lastSelectedSquare_ = nullptr;
if (CheckQuatter())
MC->Quatter();
......@@ -223,6 +232,92 @@ bool Board::PutPiece(Piece* piece, Square* square)
return false;
}
}
bool Board::PutPiece(Piece* piece) {
if (!selectedSquare_){
SelectLast();
return false;
} else
return PutPiece(piece, selectedSquare_);
}
bool Board::PutPiece(Square* square) {
return PutPiece(MC->GetPickedPiece(), square);
}
bool Board::PutPiece(){
return PutPiece(MC->GetPickedPiece());
}
Square* Board::GetNearestSquare(Vector3 pos, bool free)
{
Square* nearest{};
for (Square* s : squares_.Values()){
if (!nearest ||
LucKey::Distance(s->node_->GetWorldPosition(), pos) <
LucKey::Distance(nearest->node_->GetWorldPosition(), pos))
if (s->free_ || !free)
nearest = s;
}
return nearest;
}
void Board::SelectNearestFreeSquare(Vector3 pos)
{
Square* square{GetNearestSquare(pos, true)};
if (square) Select(square);
}
void Board::SelectNearestSquare(Vector3 pos)
{
Square* square{GetNearestSquare(pos, false)};
if (square) Select(square);
}
void Board::SelectLast()
{
if (lastSelectedSquare_ && lastSelectedSquare_ != selectedSquare_)
Select(lastSelectedSquare_);
else if (!selectedSquare_)
SelectNearestFreeSquare();
}
void Board::Select(Square* square)
{
Deselect();
selectedSquare_ = square;
square->selected_ = true;
//Fade in slot and light
if (square->free_){
FX->FadeTo(square->slot_->GetMaterial(),
COLOR_GLOW);
} else {
FX->FadeTo(square->slot_->GetMaterial(),
Color(1.0f, 0.8f, 0.0f, 0.5f));
}
Indicate(square->coords_);
FX->FadeTo(square->light_, 0.42f);
}
void Board::Deselect()
{
HideIndicators();
if (!selectedSquare_) return;
//Fade out slot and light
FX->FadeOut(selectedSquare_->slot_->GetMaterial());
FX->FadeTo(selectedSquare_->light_, 0.023f);
lastSelectedSquare_ = selectedSquare_;
selectedSquare_->selected_ = false;
selectedSquare_ = nullptr;
}
void Board::Step(IntVector2 step)
{
if (selectedSquare_){
IntVector2 newCoords{selectedSquare_->coords_ + step};
if (squares_.Contains(newCoords)){
Select(squares_[newCoords].Get());
}
} else SelectLast();
}
bool Board::CheckQuatter()
{
......@@ -355,104 +450,17 @@ bool Board::CheckQuatter()
//No Quatter
return false;
}
Square* Board::GetNearestSquare(Vector3 pos, bool free)
{
Square* nearest{};
for (Square* s : squares_.Values()){
if (!nearest ||
LucKey::Distance(s->node_->GetWorldPosition(), pos) <
LucKey::Distance(nearest->node_->GetWorldPosition(), pos))
if (s->free_ || !free)
nearest = s;
}
return nearest;
}
void Board::SelectNearestFreeSquare(Vector3 pos)
{
Square* square{GetNearestSquare(pos, true)};
if (square) Select(square);
}
void Board::SelectNearestSquare(Vector3 pos)
{
Square* square{GetNearestSquare(pos, false)};
if (square) Select(square);
}
bool Board::SelectLast()
{
if (lastSelectedSquare_ && lastSelectedSquare_ != selectedSquare_) {
Select(lastSelectedSquare_);
return true;
} else if (!selectedSquare_) {
SelectNearestFreeSquare();
} else return false;
}
void Board::Select(Square* square)
{
if (selectedSquare_)
Deselect(selectedSquare_);
selectedSquare_ = square;
square->selected_ = true;
//Fade in slot and light
if (square->free_){
FX->FadeTo(square->slot_->GetMaterial(),
COLOR_GLOW);
} else {
FX->FadeTo(square->slot_->GetMaterial(),
Color(1.0f, 0.8f, 0.0f, 0.5f));
}
Indicate(square->coords_);
FX->FadeTo(square->light_, 0.42f);
}
void Board::Deselect(Square* square)
{
HideIndicators();
if (!square) return;
if (selectedSquare_ == square){
lastSelectedSquare_ = selectedSquare_;
selectedSquare_ = nullptr;
}
square->selected_ = false;
//Fade out slot and light
FX->FadeOut(square->slot_->GetMaterial());
FX->FadeTo(square->light_, 0.023f);
}
void Board::DeselectAll()
{
for (Square* s: squares_.Values()){
Deselect(s);
}
}
void Board::Step(IntVector2 step)
{
if (selectedSquare_){
IntVector2 newCoords{selectedSquare_->coords_ + step};
if (squares_.Contains(newCoords)){
Select(squares_[newCoords].Get());
}
} else SelectLast();
}
void Board::Indicate(IntVector2 first, IntVector2 last)
{
//Indicate single square
if (last == IntVector2(-1, -1)){
if (indicateSingle_){
FX->FadeTo(indicators_[0]->glow_, COLOR_GLOW, 2.3f, 1.0f);
FadeInIndicator(indicators_[0]);
FX->TransformTo(indicators_[0]->rootNode_,
CoordsToPosition(first) * Vector3(0.0f, 1.0f, 1.0f),
indicators_[0]->rootNode_->GetRotation(),
0.23f);
FX->FadeTo(indicators_[1]->glow_, COLOR_GLOW, 2.3f, 1.0f);
FadeInIndicator(indicators_[1]);
FX->TransformTo(indicators_[1]->rootNode_,
CoordsToPosition(first) * Vector3(1.0f, 1.0f, 0.0f),
indicators_[1]->rootNode_->GetRotation(),
......@@ -460,33 +468,36 @@ void Board::Indicate(IntVector2 first, IntVector2 last)
}
//Indicate row
} else if (first.y_ == last.y_){
FX->FadeTo(indicators_[0]->glow_, COLOR_GLOW, 2.3f, 1.0f);
FadeInIndicator(indicators_[0]);
indicators_[0]->rootNode_->SetPosition(CoordsToPosition(first) * Vector3(0.0f, 1.0f, 1.0f));
indicators_[0]->model1_->SetMorphWeight(1, static_cast<float>(first.y_ > 0 && first.y_ < 3));
indicators_[0]->model2_->SetMorphWeight(1, static_cast<float>(first.y_ > 0 && first.y_ < 3));
//Indicate column
} else if (first.x_ == last.x_){
FX->FadeTo(indicators_[1]->glow_, COLOR_GLOW, 2.3f, 1.0f);
FadeInIndicator(indicators_[1]);
indicators_[1]->rootNode_->SetPosition(CoordsToPosition(first) * Vector3(1.0f, 1.0f, 0.0f));
indicators_[1]->model1_->SetMorphWeight(1, static_cast<float>(first.x_ > 0 && first.x_ < 3));
indicators_[1]->model2_->SetMorphWeight(1, static_cast<float>(first.x_ > 0 && first.x_ < 3));
//Indicate first diagonal
} else if (first.x_ == 0 && last.y_ == 0){
FX->FadeTo(indicators_[3]->glow_, COLOR_GLOW, 2.3f, 1.0f);
FadeInIndicator(indicators_[3]);
//Indicate 2x2 blocks
} else if (last.x_ - first.x_ == 1) {
FX->FadeTo(indicators_[4]->glow_, COLOR_GLOW, 2.3f, 1.0f);
FadeInIndicator(indicators_[4]);
indicators_[4]->rootNode_->SetPosition(CoordsToPosition(first) * Vector3(0.0f, 1.0f, 1.0f));
FX->FadeTo(indicators_[5]->glow_, COLOR_GLOW, 2.3f, 1.0f);
FadeInIndicator(indicators_[5]);
indicators_[5]->rootNode_->SetPosition(CoordsToPosition(first) * Vector3(1.0f, 1.0f, 0.0f));
//Indicate other diagonal
} else
FX->FadeTo(indicators_[2]->glow_, COLOR_GLOW, 2.3f, 1.0f);
FadeInIndicator(indicators_[2]);
}
void Board::FadeInIndicator(Indicator* indicator)
{
FX->FadeTo(indicator->glow_, COLOR_GLOW, 2.3f, 1.0f);
}
void Board::HideIndicators()
{
for (SharedPtr<Indicator> i: indicators_){
for (SharedPtr<Indicator> i : indicators_){
FX->FadeOut(i.Get()->glow_);
}
}
......@@ -65,25 +65,14 @@ class Board : public Object
public:
Board();
Node* GetRootNode() const { return rootNode_; }
float GetThickness() const { return model_->GetBoundingBox().Size().y_; }
bool CheckQuatter();
bool PutPiece(Piece* piece, Square* square);
bool PutPiece(Piece* piece) {
if (!selectedSquare_){
SelectLast();
return false;
} else
return PutPiece(piece, selectedSquare_);
}
bool PutPiece(Square* square) {
return PutPiece(MC->GetPickedPiece(), square);
}
bool PutPiece(Piece* piece);
bool PutPiece(Square* square);
bool PutPiece();
bool PutPiece(){
return PutPiece(MC->GetPickedPiece());
}
bool CheckQuatter();
void Step(IntVector2 step);
Vector<SharedPtr<Square>> GetSquares() const { return squares_.Values(); }
......@@ -91,12 +80,10 @@ public:
Square* GetSelectedSquare() const { return selectedSquare_; }
Square* GetLastSelectedSquare() const { return lastSelectedSquare_; }
void Select(Square* square);
void Deselect(Square* square);
void Deselect() { Deselect(selectedSquare_); }
void Deselect();
void SelectNearestSquare(Vector3 pos = CAMERA->GetPosition());
void SelectNearestFreeSquare(Vector3 pos = CAMERA->GetPosition());
bool SelectLast();
void DeselectAll();
void SelectLast();
void Reset();
void Refuse();
......@@ -115,6 +102,9 @@ private:
Vector3 CoordsToPosition(IntVector2 coords);
void HandleSceneUpdate(StringHash eventType, VariantMap& eventData);
void Indicate(IntVector2 first, IntVector2 last = IntVector2(-1, -1));
void CreateSquares();
void CreateIndicators();
void FadeInIndicator(Indicator* indicator);
};
#endif // BOARD_H
......@@ -85,7 +85,8 @@ void EffectMaster::ArchTo(Node* node, Vector3 pos, Quaternion rot, float archHei
for (int i{0}; i < WAYPOINTS - 1; ++i){
float t{static_cast<float>(i) / WAYPOINTS};
posAnim->SetKeyFrame(delay + duration * t,
float t2 = 0.5f * (t + (0.5f + 0.5f * pow(2.0f * (t - 0.5f), 3.0f)));
posAnim->SetKeyFrame(delay + duration * t2,
node->GetPosition().Lerp(pos, t) + archHeight * Vector3::UP * Arch(t));
}
posAnim->SetKeyFrame(delay + duration, pos);
......
This diff is collapsed.
......@@ -37,10 +37,10 @@ typedef class Yad : public Object{
URHO3D_OBJECT(Yad, Object);
public:
Yad() : Object(MC->GetContext()) {}
SharedPtr<Node> node_;
SharedPtr<AnimatedModel> model_;
SharedPtr<Material> material_;
SharedPtr<Light> light_;
SharedPtr<Node> node_{};
SharedPtr<AnimatedModel> model_{};
SharedPtr<Material> material_{};
SharedPtr<Light> light_{};
bool hidden_{true};
bool dimmed_{false};
}Yad;
......@@ -54,17 +54,26 @@ public:
void ConstructYad();
private:
Input* input_;
HashSet<int> pressedKeys_;
HashSet<int> pressedMouseButtons_;
HashMap<int, HashSet<int>> pressedJoystickButtons_;
float idleTime_;
bool idle_;
Vector2 mousePos_;
Vector2 mouseMoveSinceClick_;
bool drag_;
float mouseIdleTime_;
bool actionDone_;
bool boardClick_;
bool tableClick_;
float sinceStep_;
float idleTime_;
float mouseIdleTime_;
Vector2 mousePos_;
Vector2 mouseMoveSinceClick_;
Vector2 smoothCamRotate_;
float smoothCamZoom_;
Yad* yad_;
Piece* rayPiece_;
Square* raySquare_;
void ResetIdle();
void SetIdle();
......@@ -72,25 +81,13 @@ private:
void HideYad();
void RevealYad();
Vector2 smoothCamRotate_;
float smoothCamZoom_;
HashSet<int> pressedKeys_;
HashSet<int> pressedMouseButtons_;
HashMap<int, HashSet<int>> pressedJoystickButtons_;
float sinceStep_;
bool actionDone_;
Yad* yad_;
Piece* rayPiece_;
Square* raySquare_;
Piece* RaycastToPiece();
Square* RaycastToSquare();
bool RaycastToBoard();
bool RaycastToTable();
void HandleUpdate(StringHash eventType, VariantMap &eventData);
void UpdateMousePos(bool delta);
void UpdateMousePos();
void UpdateYad();
Vector3 YadRaycast(bool& none);
......@@ -113,7 +110,7 @@ private:
void HandleCameraMovement(float t);
void Screenshot();
void HandleActionButtonPressed();
void ActionButtonPressed();
void Step(Vector3 step);
void HandleDownArrowPressed();
void HandleRightArrowPressed();
......@@ -121,6 +118,7 @@ private:
bool CorrectJoystickId(int joystickId);
void DimYad();
void RestoreYad();
void SelectionButtonPressed();
};
#endif // INPUTMASTER_H
......@@ -18,6 +18,7 @@
#include "luckey.h"
unsigned LucKey::IntVector2ToHash(IntVector2 vec) { return (MakeHash(vec.x_) & 0xffff) | (MakeHash(vec.y_) << 16); }
float LucKey::Delta(float lhs, float rhs, bool angle)
{
......@@ -36,17 +37,12 @@ float LucKey::Delta(float lhs, float rhs, bool angle)
float LucKey::Distance(const Vector3 from, const Vector3 to){
return (to - from).Length();
}
unsigned LucKey::IntVector2ToHash(IntVector2 vec) { return (MakeHash(vec.x_) & 0xffff) | (MakeHash(vec.y_) << 16); }
Vector3 LucKey::Scale(const Vector3 lhs, const Vector3 rhs) {
return Vector3(lhs.x_ * rhs.x_, lhs.y_ * rhs.y_, lhs.z_ * rhs.z_);
}
Urho3D::IntVector2 LucKey::Scale(const Urho3D::IntVector2 lhs, const Urho3D::IntVector2 rhs) {
return Urho3D::IntVector2(lhs.x_ * rhs.x_, lhs.y_ * rhs.y_);
}
Vector2 LucKey::Rotate(const Vector2 vec2, const float angle){
float x{vec2.x_};
float y{vec2.y_};
......@@ -63,14 +59,12 @@ float LucKey::RandomSign()
{
return Random(2)*2-1;
}
Color LucKey::RandomHairColor()
{
Color hairColor{};
hairColor.FromHSV(Random(0.1666f), Random(0.05f, 0.7f), Random(0.9f));
return hairColor;
}
Color LucKey::RandomSkinColor()
{
Color skinColor{};
......
......@@ -77,6 +77,12 @@
#include <Urho3D/DebugNew.h>
#define ENGINE GetSubsystem<Engine>()
#define CACHE GetSubsystem<ResourceCache>()
#define INPUT GetSubsystem<Input>()
#define GRAPHICS GetSubsystem<Graphics>()
#define TIME GetSubsystem<Time>()
namespace Urho3D {
class Drawable;
class Node;
......@@ -96,12 +102,10 @@ enum SixaxisButton { SB_SELECT, SB_LEFTSTICK, SB_RIGHTSTICK, SB_START,
SB_TRIANGLE, SB_CIRCLE, SB_CROSS, SB_SQUARE,
SB_PS };
int Cycle(int x, int min, int max);
float Cycle(float x, float min, float max);
unsigned IntVector2ToHash(IntVector2 vec);
float Delta(float lhs, float rhs, bool angle = false);
float Distance(const Vector3 from, const Vector3 to);
unsigned IntVector2ToHash(IntVector2 vec);
Vector3 Scale(const Vector3 lhs, const Vector3 rhs);
IntVector2 Scale(const IntVector2 lhs, const IntVector2 rhs);
Vector2 Rotate(const Vector2 vec2, const float angle);
......@@ -112,6 +116,9 @@ Color RandomHairColor();
float Sine(float x);
float Cosine(float x);
int Cycle(int x, int min, int max);
float Cycle(float x, float min, float max);
}
#endif // LUCKEY_H
......@@ -38,8 +38,6 @@ class Master : public Object
public:
Master();
protected:
// virtual void HandleUpdate(StringHash eventType, VariantMap &eventData);
};
#endif // MASTER_H
This diff is collapsed.
......@@ -53,7 +53,7 @@ typedef struct GameWorld
} GameWorld;
#define MC MasterControl::GetInstance()
#define FX MC->effectMaster_
#define FX MC->GetEffectMaster()
#define CAMERA MC->world_.camera_
#define BOARD MC->world_.board_
#define NUM_PIECES 16
......@@ -69,11 +69,9 @@ class MasterControl : public Application
public:
MasterControl(Context* context);
static MasterControl* GetInstance();
EffectMaster* GetEffectMaster() const { return effectMaster_; }
EffectMaster* effectMaster_;
GameWorld world_;
SharedPtr<ResourceCache> cache_;
SharedPtr<Graphics> graphics_;
virtual void Setup();
virtual void Start();
......@@ -81,6 +79,7 @@ public:
void Exit();
void CreateLights();
inline GameState GetGameState() const noexcept { return gameState_; }
inline GameState GetPreviousGameState() const noexcept { return previousGameState_; }
inline bool InPickState() const noexcept { return gameState_ == GameState::PLAYER1PICKS || gameState_ == GameState::PLAYER2PICKS; }
......@@ -88,35 +87,36 @@ public:
inline bool InPlayer1State() const noexcept { return gameState_ == GameState::PLAYER1PICKS || gameState_ == GameState::PLAYER1PUTS; }
inline bool InPlayer2State() const noexcept { return gameState_ == GameState::PLAYER2PICKS || gameState_ == GameState::PLAYER2PUTS; }
void NextPhase();
void NextSelectionMode();
void SetSelectionMode(SelectionMode mode);
void NextMusicState();
void TakeScreenshot();
float AttributesToAngle(int attributes) const { return (360.0f/NUM_PIECES * attributes) + 180.0f/NUM_PIECES + 23.5f; }
Vector3 AttributesToPosition(int attributes) const {
return Quaternion(AttributesToAngle(attributes), Vector3::UP) * Vector3::BACK * 7.0f
+ Vector3::DOWN * TABLE_DEPTH;
}
Piece* GetSelectedPiece() const;
Piece* GetPickedPiece() const;
int CountFreePieces();
Material* GetMaterial(String name) const { return cache_->GetResource<Material>("Materials/"+name+".xml"); }
Model* GetModel(String name) const { return cache_->GetResource<Model>("Models/"+name+".mdl"); }
Texture* GetTexture(String name) const { return cache_->GetResource<Texture>("Textures/"+name+".png"); }
Material* GetMaterial(String name) const { return CACHE->GetResource<Material>("Materials/"+name+".xml"); }
Model* GetModel(String name) const { return CACHE->GetResource<Model>("Models/"+name+".mdl"); }
Texture* GetTexture(String name) const { return CACHE->GetResource<Texture>("Textures/"+name+".png"); }
Sound* GetMusic(String name) const;
Sound* GetSample(String name) const;
void Quatter();
void SetPickedPiece(Piece* piece) { pickedPiece_ = piece; }
Piece* GetSelectedPiece() const { return selectedPiece_; }
Piece* GetPickedPiece() const { return pickedPiece_; }
void DeselectPiece();
void NextPhase();
void NextMusicState();
void NextSelectionMode();
void SetSelectionMode(SelectionMode mode);
void TakeScreenshot();
float Sine(const float freq, const float min = -1.0f, const float max = 1.0f, const float shift = 0.0f);
float Cosine(const float freq, const float min = -1.0f, const float max = 1.0f, const float shift = 0.0f);
private:
static MasterControl* instance_;
InputMaster* inputMaster_;
EffectMaster* effectMaster_;
SharedPtr<Node> leafyLightNode_;
SharedPtr<Light> leafyLight_;
......@@ -139,7 +139,7 @@ private:
void Reset();
void HandleUpdate(StringHash eventType, VariantMap& eventData);
void CameraSelectPiece();
void CameraSelectPiece(bool force = false);
void StepSelectPiece(bool next);
void SelectPrevious();
......@@ -150,7 +150,11 @@ private:
bool SelectLastPiece();
float lastReset_;
bool IsLame() { return GetSubsystem<Time>()->GetElapsedTime() - lastReset_ < (RESET_DURATION + 0.23f); }
bool IsLame() { return TIME->GetElapsedTime() - lastReset_ < (RESET_DURATION + 0.23f); }
void CreateJukebox();
void CreateSkybox();
void CreateTable();
void CreateBoardAndPieces();
};
#endif // MASTERCONTROL_H
......@@ -56,9 +56,10 @@ void Piece::Reset()
{
rootNode_->SetParent(MC->world_.scene_);
if (MC->GetSelectedPiece() == this){
if (MC->GetSelectedPiece() == this)
MC->DeselectPiece();
} else Deselect();
if (MC->GetPickedPiece() == this)
MC->SetPickedPiece(nullptr);
if (state_ != PieceState::FREE){
state_ = PieceState::FREE;
......@@ -117,6 +118,7 @@ void Piece::Pick()
if (state_ != PieceState::PUT){
state_ = PieceState::PICKED;
MC->SetPickedPiece(this);
if (MC->GetGameState() == GameState::PLAYER1PICKS)
rootNode_->SetParent(CAMERA->GetPocket(false));
if (MC->GetGameState() == GameState::PLAYER2PICKS)
......@@ -135,11 +137,8 @@ void Piece::Put(Vector3 position)
if (state_ == PieceState::PICKED){
state_ = PieceState::PUT;
MC->SetPickedPiece(nullptr);
rootNode_->SetParent(MC->world_.scene_);
FX->ArchTo(rootNode_, position, Quaternion(Random(-13.0f, 13.0f), Vector3::UP), 2.3f, 0.42f);
FX->ArchTo(rootNode_, position, Quaternion(Random(-13.0f, 13.0f), Vector3::UP), 2.3f, 0.5f);
}
}
void Piece::Put(Square* square)
{
BOARD->PutPiece(this, square);
}
......@@ -54,7 +54,6 @@ public:
PieceState GetState() const noexcept { return state_; }
void Pick();
void Put(Vector3 position);
void Put(Square* square);
void Reset();
int ToInt() const { return static_cast<int>(attributes_.to_ulong()); }
......
......@@ -22,25 +22,14 @@
QuatterCam::QuatterCam():
Object(MC->GetContext()),
distance_{12.0f},
targetDistance_{distance_},
targetPosition_{Vector3::UP * 0.42f},
smoothTargetPosition_{targetPosition_}