raylib 5.0.0.3__pp310-pypy310_pp73-manylinux2014_x86_64.whl → 5.5.0.0.dev3__pp310-pypy310_pp73-manylinux2014_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of raylib might be problematic. Click here for more details.
- pyray/__init__.pyi +298 -97
- raylib/__init__.pyi +295 -90
- raylib/_raylib_cffi.pypy310-pp73-x86_64-linux-gnu.so +0 -0
- raylib/build.py +47 -14
- raylib/defines.py +27 -5
- raylib/enums.py +16 -10
- raylib/glfw3.h.modified +5618 -0
- raylib/physac.h.modified +165 -0
- raylib/raygui.h.modified +865 -0
- raylib/raylib.h.modified +1441 -0
- raylib/raymath.h.modified +247 -0
- raylib/rlgl.h.modified +522 -0
- raylib/version.py +1 -1
- {raylib-5.0.0.3.dist-info → raylib-5.5.0.0.dev3.dist-info}/METADATA +76 -32
- raylib-5.5.0.0.dev3.dist-info/RECORD +21 -0
- {raylib-5.0.0.3.dist-info → raylib-5.5.0.0.dev3.dist-info}/WHEEL +1 -1
- raylib-5.0.0.3.dist-info/RECORD +0 -15
- {raylib-5.0.0.3.dist-info → raylib-5.5.0.0.dev3.dist-info}/LICENSE +0 -0
- {raylib-5.0.0.3.dist-info → raylib-5.5.0.0.dev3.dist-info}/top_level.txt +0 -0
raylib/physac.h.modified
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**********************************************************************************************
|
|
2
|
+
*
|
|
3
|
+
* Physac v1.1 - 2D Physics library for videogames
|
|
4
|
+
*
|
|
5
|
+
* DESCRIPTION:
|
|
6
|
+
*
|
|
7
|
+
* Physac is a small 2D physics engine written in pure C. The engine uses a fixed time-step thread loop
|
|
8
|
+
* to simulate physics. A physics step contains the following phases: get collision information,
|
|
9
|
+
* apply dynamics, collision solving and position correction. It uses a very simple struct for physic
|
|
10
|
+
* bodies with a position vector to be used in any 3D rendering API.
|
|
11
|
+
*
|
|
12
|
+
* CONFIGURATION:
|
|
13
|
+
*
|
|
14
|
+
* #define PHYSAC_IMPLEMENTATION
|
|
15
|
+
* Generates the implementation of the library into the included file.
|
|
16
|
+
* If not defined, the library is in header only mode and can be included in other headers
|
|
17
|
+
* or source files without problems. But only ONE file should hold the implementation.
|
|
18
|
+
*
|
|
19
|
+
* #define PHYSAC_DEBUG
|
|
20
|
+
* Show debug traces log messages about physic bodies creation/destruction, physic system errors,
|
|
21
|
+
* some calculations results and NULL reference exceptions.
|
|
22
|
+
*
|
|
23
|
+
* #define PHYSAC_AVOID_TIMMING_SYSTEM
|
|
24
|
+
* Disables internal timming system, used by UpdatePhysics() to launch timmed physic steps,
|
|
25
|
+
* it allows just running UpdatePhysics() automatically on a separate thread at a desired time step.
|
|
26
|
+
* In case physics steps update needs to be controlled by user with a custom timming mechanism,
|
|
27
|
+
* just define this flag and the internal timming mechanism will be avoided, in that case,
|
|
28
|
+
* timming libraries are neither required by the module.
|
|
29
|
+
*
|
|
30
|
+
* #define PHYSAC_MALLOC()
|
|
31
|
+
* #define PHYSAC_CALLOC()
|
|
32
|
+
* #define PHYSAC_FREE()
|
|
33
|
+
* You can define your own malloc/free implementation replacing stdlib.h malloc()/free() functions.
|
|
34
|
+
* Otherwise it will include stdlib.h and use the C standard library malloc()/free() function.
|
|
35
|
+
*
|
|
36
|
+
* COMPILATION:
|
|
37
|
+
*
|
|
38
|
+
* Use the following code to compile with GCC:
|
|
39
|
+
* gcc -o $(NAME_PART).exe $(FILE_NAME) -s -static -lraylib -lopengl32 -lgdi32 -lwinmm -std=c99
|
|
40
|
+
*
|
|
41
|
+
* VERSIONS HISTORY:
|
|
42
|
+
* 1.1 (20-Jan-2021) @raysan5: Library general revision
|
|
43
|
+
* Removed threading system (up to the user)
|
|
44
|
+
* Support MSVC C++ compilation using CLITERAL()
|
|
45
|
+
* Review DEBUG mechanism for TRACELOG() and all TRACELOG() messages
|
|
46
|
+
* Review internal variables/functions naming for consistency
|
|
47
|
+
* Allow option to avoid internal timming system, to allow app manage the steps
|
|
48
|
+
* 1.0 (12-Jun-2017) First release of the library
|
|
49
|
+
*
|
|
50
|
+
*
|
|
51
|
+
* LICENSE: zlib/libpng
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) 2016-2022 Victor Fisac (@victorfisac) and Ramon Santamaria (@raysan5)
|
|
54
|
+
*
|
|
55
|
+
* This software is provided "as-is", without any express or implied warranty. In no event
|
|
56
|
+
* will the authors be held liable for any damages arising from the use of this software.
|
|
57
|
+
*
|
|
58
|
+
* Permission is granted to anyone to use this software for any purpose, including commercial
|
|
59
|
+
* applications, and to alter it and redistribute it freely, subject to the following restrictions:
|
|
60
|
+
*
|
|
61
|
+
* 1. The origin of this software must not be misrepresented; you must not claim that you
|
|
62
|
+
* wrote the original software. If you use this software in a product, an acknowledgment
|
|
63
|
+
* in the product documentation would be appreciated but is not required.
|
|
64
|
+
*
|
|
65
|
+
* 2. Altered source versions must be plainly marked as such, and must not be misrepresented
|
|
66
|
+
* as being the original software.
|
|
67
|
+
*
|
|
68
|
+
* 3. This notice may not be removed or altered from any source distribution.
|
|
69
|
+
*
|
|
70
|
+
**********************************************************************************************/
|
|
71
|
+
// Function specifiers in case library is build/used as a shared library (Windows)
|
|
72
|
+
// NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll
|
|
73
|
+
// Allow custom memory allocators
|
|
74
|
+
//----------------------------------------------------------------------------------
|
|
75
|
+
// Defines and Macros
|
|
76
|
+
//----------------------------------------------------------------------------------
|
|
77
|
+
//----------------------------------------------------------------------------------
|
|
78
|
+
// Data Types Structure Definition
|
|
79
|
+
//----------------------------------------------------------------------------------
|
|
80
|
+
typedef enum PhysicsShapeType { PHYSICS_CIRCLE = 0, PHYSICS_POLYGON } PhysicsShapeType;
|
|
81
|
+
// Previously defined to be used in PhysicsShape struct as circular dependencies
|
|
82
|
+
typedef struct PhysicsBodyData *PhysicsBody;
|
|
83
|
+
// Matrix2x2 type (used for polygon shape rotation matrix)
|
|
84
|
+
typedef struct Matrix2x2 {
|
|
85
|
+
float m00;
|
|
86
|
+
float m01;
|
|
87
|
+
float m10;
|
|
88
|
+
float m11;
|
|
89
|
+
} Matrix2x2;
|
|
90
|
+
typedef struct PhysicsVertexData {
|
|
91
|
+
unsigned int vertexCount; // Vertex count (positions and normals)
|
|
92
|
+
Vector2 positions[24 /* Maximum number of vertex for polygons shapes*/]; // Vertex positions vectors
|
|
93
|
+
Vector2 normals[24 /* Maximum number of vertex for polygons shapes*/]; // Vertex normals vectors
|
|
94
|
+
} PhysicsVertexData;
|
|
95
|
+
typedef struct PhysicsShape {
|
|
96
|
+
PhysicsShapeType type; // Shape type (circle or polygon)
|
|
97
|
+
PhysicsBody body; // Shape physics body data pointer
|
|
98
|
+
PhysicsVertexData vertexData; // Shape vertices data (used for polygon shapes)
|
|
99
|
+
float radius; // Shape radius (used for circle shapes)
|
|
100
|
+
Matrix2x2 transform; // Vertices transform matrix 2x2
|
|
101
|
+
} PhysicsShape;
|
|
102
|
+
typedef struct PhysicsBodyData {
|
|
103
|
+
unsigned int id; // Unique identifier
|
|
104
|
+
bool enabled; // Enabled dynamics state (collisions are calculated anyway)
|
|
105
|
+
Vector2 position; // Physics body shape pivot
|
|
106
|
+
Vector2 velocity; // Current linear velocity applied to position
|
|
107
|
+
Vector2 force; // Current linear force (reset to 0 every step)
|
|
108
|
+
float angularVelocity; // Current angular velocity applied to orient
|
|
109
|
+
float torque; // Current angular force (reset to 0 every step)
|
|
110
|
+
float orient; // Rotation in radians
|
|
111
|
+
float inertia; // Moment of inertia
|
|
112
|
+
float inverseInertia; // Inverse value of inertia
|
|
113
|
+
float mass; // Physics body mass
|
|
114
|
+
float inverseMass; // Inverse value of mass
|
|
115
|
+
float staticFriction; // Friction when the body has not movement (0 to 1)
|
|
116
|
+
float dynamicFriction; // Friction when the body has movement (0 to 1)
|
|
117
|
+
float restitution; // Restitution coefficient of the body (0 to 1)
|
|
118
|
+
bool useGravity; // Apply gravity force to dynamics
|
|
119
|
+
bool isGrounded; // Physics grounded on other body state
|
|
120
|
+
bool freezeOrient; // Physics rotation constraint
|
|
121
|
+
PhysicsShape shape; // Physics body shape information (type, radius, vertices, transform)
|
|
122
|
+
} PhysicsBodyData;
|
|
123
|
+
typedef struct PhysicsManifoldData {
|
|
124
|
+
unsigned int id; // Unique identifier
|
|
125
|
+
PhysicsBody bodyA; // Manifold first physics body reference
|
|
126
|
+
PhysicsBody bodyB; // Manifold second physics body reference
|
|
127
|
+
float penetration; // Depth of penetration from collision
|
|
128
|
+
Vector2 normal; // Normal direction vector from 'a' to 'b'
|
|
129
|
+
Vector2 contacts[2]; // Points of contact during collision
|
|
130
|
+
unsigned int contactsCount; // Current collision number of contacts
|
|
131
|
+
float restitution; // Mixed restitution during collision
|
|
132
|
+
float dynamicFriction; // Mixed dynamic friction during collision
|
|
133
|
+
float staticFriction; // Mixed static friction during collision
|
|
134
|
+
} PhysicsManifoldData, *PhysicsManifold;
|
|
135
|
+
//----------------------------------------------------------------------------------
|
|
136
|
+
// Module Functions Declaration
|
|
137
|
+
//----------------------------------------------------------------------------------
|
|
138
|
+
// Physics system management
|
|
139
|
+
void InitPhysics(void); // Initializes physics system
|
|
140
|
+
void UpdatePhysics(void); // Update physics system
|
|
141
|
+
void ResetPhysics(void); // Reset physics system (global variables)
|
|
142
|
+
void ClosePhysics(void); // Close physics system and unload used memory
|
|
143
|
+
void SetPhysicsTimeStep(double delta); // Sets physics fixed time step in milliseconds. 1.666666 by default
|
|
144
|
+
void SetPhysicsGravity(float x, float y); // Sets physics global gravity force
|
|
145
|
+
// Physic body creation/destroy
|
|
146
|
+
PhysicsBody CreatePhysicsBodyCircle(Vector2 pos, float radius, float density); // Creates a new circle physics body with generic parameters
|
|
147
|
+
PhysicsBody CreatePhysicsBodyRectangle(Vector2 pos, float width, float height, float density); // Creates a new rectangle physics body with generic parameters
|
|
148
|
+
PhysicsBody CreatePhysicsBodyPolygon(Vector2 pos, float radius, int sides, float density); // Creates a new polygon physics body with generic parameters
|
|
149
|
+
void DestroyPhysicsBody(PhysicsBody body); // Destroy a physics body
|
|
150
|
+
// Physic body forces
|
|
151
|
+
void PhysicsAddForce(PhysicsBody body, Vector2 force); // Adds a force to a physics body
|
|
152
|
+
void PhysicsAddTorque(PhysicsBody body, float amount); // Adds an angular force to a physics body
|
|
153
|
+
void PhysicsShatter(PhysicsBody body, Vector2 position, float force); // Shatters a polygon shape physics body to little physics bodies with explosion force
|
|
154
|
+
void SetPhysicsBodyRotation(PhysicsBody body, float radians); // Sets physics body shape transform based on radians parameter
|
|
155
|
+
// Query physics info
|
|
156
|
+
PhysicsBody GetPhysicsBody(int index); // Returns a physics body of the bodies pool at a specific index
|
|
157
|
+
int GetPhysicsBodiesCount(void); // Returns the current amount of created physics bodies
|
|
158
|
+
int GetPhysicsShapeType(int index); // Returns the physics body shape type (PHYSICS_CIRCLE or PHYSICS_POLYGON)
|
|
159
|
+
int GetPhysicsShapeVerticesCount(int index); // Returns the amount of vertices of a physics body shape
|
|
160
|
+
Vector2 GetPhysicsShapeVertex(PhysicsBody body, int vertex); // Returns transformed position of a body shape (body position + vertex transformed position)
|
|
161
|
+
/***********************************************************************************
|
|
162
|
+
*
|
|
163
|
+
* PHYSAC IMPLEMENTATION
|
|
164
|
+
*
|
|
165
|
+
************************************************************************************/
|