-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from Renardjojo/develop
V1.3.0
- Loading branch information
Showing
25 changed files
with
648 additions
and
227 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
Game: | ||
FPS: 60 # min 1 | ||
Scale: 4 # min 1 | ||
Scale: 2 # min 1 | ||
RandomSeed: -1 # -1: use random seed | ||
Physic: | ||
PhysicFrameRate: 60 # min 0 | ||
Friction: 0.85 # [0, 1] : 0 no friction, 1 max friction | ||
GravityX: 0 | ||
GravityY: 9.81 | ||
Bounciness: 0.7 # [0, 1] : 0 no bounciness, 1 full energie restitution | ||
ContinusCollisionMaxVelocity: 40 # min 0 | ||
FootBasasementWidth: 4 # min 2 | ||
FootBasasementHeight: 2 # min 2 | ||
Bounciness: 0.6 # [0, 1] : 0 no bounciness, 1 full energie restitution | ||
ContinuousCollisionMaxVelocity: 40 # min 0 | ||
FootBasementWidth: 6 # min 2 | ||
FootBasementHeight: 2 # min 2 | ||
CollisionPixelRatioStopMovement: 0.3 # min 0, max 1. Ratio of pixel with collision to detect a real collision | ||
IsGroundedDetection: 1.0 # min 0 | ||
InputReleaseImpulse: 1.0 # min 0. Velocity factor after release the pet | ||
GamePlay: | ||
CoyoteTimeCursorMovement: 0.05 # min 0. Record duration of the velocity before released the pet to preserve velocity with the mouse movement | ||
Window: | ||
ShowFrameBufferBackground: false | ||
UseFowardWindow: true | ||
ShowWindow: false | ||
UseMousePassThoughWindow: true | ||
UseForwardWindow: true # Define if the application should be displayed in forground | ||
ShowWindow: false # Display the window edge or not | ||
UseMousePassThoughWindow: true # Define if user can selection pet only with selected pixel or with the entire windows | ||
Debug: | ||
ShowEdgeDetection: false | ||
ShowEdgeDetection: false # Debug mode to display the result of the collision alogyrthm on the entire window |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
#pragma once | ||
|
||
#include "Engine/Vector2.hpp" | ||
|
||
#include <GLFW/glfw3.h> | ||
|
||
#include <vector> | ||
|
||
class Monitors | ||
{ | ||
protected: | ||
std::vector<GLFWmonitor*> monitors; | ||
|
||
private: | ||
static Monitors* s_instances; | ||
|
||
public: | ||
static Monitors& getInstance() | ||
{ | ||
return *s_instances; | ||
} | ||
|
||
public: | ||
void init() | ||
{ | ||
s_instances = this; | ||
|
||
int monitorCount; | ||
GLFWmonitor** pMonitors = glfwGetMonitors(&monitorCount); | ||
monitors.reserve(monitorCount); | ||
|
||
for (int i = 0; i < monitorCount; ++i) | ||
{ | ||
addMonitor(pMonitors[i]); | ||
} | ||
} | ||
|
||
void getMainMonitorWorkingArea(Vec2i& position, Vec2i& size) const | ||
{ | ||
getMonitorPosition(0, position); | ||
getMonitorSize(0, size); | ||
} | ||
|
||
Vec2i getMonitorsSize() const | ||
{ | ||
Vec2i size = Vec2i::zero(); | ||
const GLFWvidmode* currentVideoMode; | ||
for (int i = 0; i < monitors.size(); i++) | ||
{ | ||
currentVideoMode = glfwGetVideoMode(monitors[i]); | ||
size.x += currentVideoMode->width; | ||
size.y += currentVideoMode->height; | ||
} | ||
return size; | ||
} | ||
|
||
void getMonitorPosition(int index, Vec2i& position) const | ||
{ | ||
glfwGetMonitorPos(monitors[index], &position.x, &position.y); | ||
} | ||
|
||
void getMonitorSize(int index, Vec2i& size) const | ||
{ | ||
const GLFWvidmode* currentVideoMode; | ||
currentVideoMode = glfwGetVideoMode(monitors[index]); | ||
size.x = currentVideoMode->width; | ||
size.y = currentVideoMode->height; | ||
} | ||
|
||
Vec2i getMonitorPhysicalSize() const | ||
{ | ||
Vec2i sizeMM = Vec2i::zero(); | ||
int width_mm, height_mm; | ||
for (int i = 0; i < monitors.size(); i++) | ||
{ | ||
glfwGetMonitorPhysicalSize(monitors[i], &width_mm, &height_mm); | ||
sizeMM.x += width_mm; | ||
sizeMM.y += height_mm; | ||
} | ||
return sizeMM; | ||
} | ||
|
||
void addMonitor(GLFWmonitor* monitor) | ||
{ | ||
monitors.emplace_back(monitor); | ||
} | ||
|
||
void removeMonitor(const GLFWmonitor* monitor) | ||
{ | ||
for (int i = 0; i < monitors.size(); ++i) | ||
{ | ||
if (monitors[i] == monitor) | ||
{ | ||
monitors.erase(monitors.begin() + i); | ||
break; | ||
} | ||
} | ||
} | ||
|
||
int getMonitorsCount() const | ||
{ | ||
return monitors.size(); | ||
} | ||
}; |
Oops, something went wrong.