Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Rubberduckycooly
GitHub Repository: Rubberduckycooly/RSDKv5-Decompilation
Path: blob/master/RSDKv5/RSDK/Scene/Legacy/v4/CollisionLegacyv4.hpp
1188 views
1
2
namespace Legacy
3
{
4
5
namespace v4
6
{
7
8
enum CollisionSides {
9
CSIDE_FLOOR = 0,
10
CSIDE_LWALL = 1,
11
CSIDE_RWALL = 2,
12
CSIDE_ROOF = 3,
13
CSIDE_LENTITY = 4, // Added in Origins Plus
14
CSIDE_RENTITY = 5, // Added in Origins Plus
15
};
16
17
enum CollisionModes {
18
CMODE_FLOOR = 0,
19
CMODE_LWALL = 1,
20
CMODE_ROOF = 2,
21
CMODE_RWALL = 3,
22
};
23
24
enum CollisionSolidity {
25
SOLID_ALL = 0,
26
SOLID_TOP = 1,
27
SOLID_LRB = 2,
28
SOLID_NONE = 3,
29
SOLID_TOP_NOGRIP = 4,
30
};
31
32
enum ObjectCollisionTypes {
33
C_TOUCH = 0,
34
C_SOLID = 1,
35
C_SOLID2 = 2,
36
C_PLATFORM = 3,
37
};
38
39
enum ObjectCollisionFlags {
40
C_BOX = 0x10000,
41
};
42
43
struct CollisionSensor {
44
int32 xpos;
45
int32 ypos;
46
int32 angle;
47
bool32 collided;
48
};
49
50
extern int32 collisionLeft;
51
extern int32 collisionTop;
52
extern int32 collisionRight;
53
extern int32 collisionBottom;
54
55
extern int32 collisionTolerance;
56
57
extern CollisionSensor sensors[7];
58
59
#if !RETRO_USE_ORIGINAL_CODE
60
int32 AddDebugHitbox(uint8 type, Entity *entity, int32 left, int32 top, int32 right, int32 bottom);
61
#endif
62
63
Hitbox *GetHitbox(Entity *entity);
64
65
void FindFloorPosition(Entity *player, CollisionSensor *sensor, int32 startYPos);
66
void FindLWallPosition(Entity *player, CollisionSensor *sensor, int32 startXPos);
67
void FindRoofPosition(Entity *player, CollisionSensor *sensor, int32 startYPos);
68
void FindRWallPosition(Entity *player, CollisionSensor *sensor, int32 startXPos);
69
70
void FloorCollision(Entity *player, CollisionSensor *sensor);
71
void LWallCollision(Entity *player, CollisionSensor *sensor);
72
void RoofCollision(Entity *player, CollisionSensor *sensor);
73
void RWallCollision(Entity *player, CollisionSensor *sensor);
74
75
void SetPathGripSensors(Entity *player);
76
void ProcessPathGrip(Entity *player);
77
void ProcessAirCollision(Entity *player);
78
79
void ProcessTileCollisions(Entity *player);
80
81
void TouchCollision(Entity *thisEntity, int32 thisLeft, int32 thisTop, int32 thisRight, int32 thisBottom, Entity *otherEntity, int32 otherLeft,
82
int32 otherTop, int32 otherRight, int32 otherBottom);
83
void BoxCollision(Entity *thisEntity, int32 thisLeft, int32 thisTop, int32 thisRight, int32 thisBottom, Entity *otherEntity, int32 otherLeft,
84
int32 otherTop, int32 otherRight, int32 otherBottom); // Standard
85
void BoxCollision2(Entity *thisEntity, int32 thisLeft, int32 thisTop, int32 thisRight, int32 thisBottom, Entity *otherEntity, int32 otherLeft,
86
int32 otherTop, int32 otherRight, int32 otherBottom); // Updated (?)
87
void PlatformCollision(Entity *thisEntity, int32 thisLeft, int32 thisTop, int32 thisRight, int32 thisBottom, Entity *otherEntity, int32 otherLeft,
88
int32 otherTop, int32 otherRight, int32 otherBottom);
89
90
void ObjectFloorCollision(int32 xOffset, int32 yOffset, int32 cPath);
91
void ObjectLWallCollision(int32 xOffset, int32 yOffset, int32 cPath);
92
void ObjectRoofCollision(int32 xOffset, int32 yOffset, int32 cPath);
93
void ObjectRWallCollision(int32 xOffset, int32 yOffset, int32 cPath);
94
95
void ObjectFloorGrip(int32 xOffset, int32 yOffset, int32 cPath);
96
void ObjectLWallGrip(int32 xOffset, int32 yOffset, int32 cPath);
97
void ObjectRoofGrip(int32 xOffset, int32 yOffset, int32 cPath);
98
void ObjectRWallGrip(int32 xOffset, int32 yOffset, int32 cPath);
99
void ObjectLEntityGrip(int32 xOffset, int32 yOffset, int32 cPath); // Added in Origins Plus
100
void ObjectREntityGrip(int32 xOffset, int32 yOffset, int32 cPath); // Added in Origins Plus
101
102
} // namespace v4
103
104
} // namespace Legacy
105