DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
Loading...
Searching...
No Matches
collision.hpp
1
#pragma once
2
3
#include "common.h"
4
5
#include <libvu0.h>
6
10
// clang-format off
11
enum
AreaKind {
12
AREA_KIND_NONE = 0,
13
AREA_KIND_FADE_OUT = 2,
14
AREA_KIND_AMBIENT_0 = 3,
15
AREA_KIND_AMBIENT_1 = 4,
16
AREA_KIND_HIGH_CAMERA = 10,
17
};
18
19
// clang-format on
20
21
struct
MDT_HEADER
;
22
26
class
CBoxVu0
{
27
public
:
28
sceVu0FVECTOR
max
;
29
sceVu0FVECTOR
min
;
30
};
31
35
class
CCPolyInfo
{
36
public
:
37
float
unk_00;
38
float
unk_04;
39
float
unk_08;
40
float
unk_0c;
41
};
42
46
class
CCPoly
{
47
public
:
48
sceVu0FVECTOR
vertex
[3];
49
sceVu0FVECTOR
normal
;
51
union
{
52
CCPolyInfo
info
;
54
struct
{
55
s16
ground_kind
;
56
s16
foot_sound
;
57
s16
area_kind
;
58
s16
ignore_mask
;
59
u8 unk_48[8];
60
} attr;
61
};
62
} __attribute__((aligned(16)));
63
67
class
CCPolyBox
{
68
public
:
69
CCPoly
poly
;
70
CBoxVu0
box
;
71
};
72
76
class
CCollision
{
77
public
:
78
sceVu0FVECTOR
max
;
79
sceVu0FVECTOR
min
;
81
virtual
int
GetPolygon(
int
index, sceVu0FMATRIX v0, sceVu0FMATRIX v1, sceVu0FMATRIX v2);
82
virtual
int
GetMaxY(
float
*position);
83
virtual
sceVu0FVECTOR *GetVertexAddress(
int
*count);
84
virtual
int
Intersection(
float
*from,
float
*to,
float
*hit);
85
virtual
int
PickUpNearPoly(
CCPoly
*poly,
float
*position,
float
radius);
86
virtual
int
PickUpNearPoly(
CCPoly
*poly,
const
CBoxVu0
&box);
87
virtual
int
PickUpNearPoly(
CCPoly
*poly);
88
virtual
void
Initialize();
89
90
void
CreateBBox();
91
};
92
96
class
CCollisionMDT
:
public
CCollision
{
97
public
:
98
MDT_HEADER
*
model
;
99
CCPolyBox
*
mesh
;
100
int
mesh_count
;
102
/* The same three fields Initialize clears, cleared again here because construction cannot
103
reach a virtual of its own class. */
104
CCollisionMDT
() {
105
model
= 0;
106
mesh
= 0;
107
mesh_count
= 0;
108
}
109
110
virtual
int
GetPolygon(
int
index, sceVu0FMATRIX v0, sceVu0FMATRIX v1, sceVu0FMATRIX v2);
111
virtual
int
GetMaxY(
float
*position);
112
virtual
sceVu0FVECTOR *GetVertexAddress(
int
*count);
113
virtual
int
Intersection(
float
*from,
float
*to,
float
*hit);
114
virtual
int
PickUpNearPoly(
CCPoly
*poly,
float
*position,
float
radius);
115
virtual
int
PickUpNearPoly(
CCPoly
*poly,
const
CBoxVu0
&box);
116
virtual
int
PickUpNearPoly(
CCPoly
*poly);
117
virtual
void
Initialize();
118
};
119
120
STATIC_ASSERT(
sizeof
(
CCPoly
) == 0x50);
121
STATIC_ASSERT(
sizeof
(
CBoxVu0
) == 0x20);
122
131
int
CheckHit(
CCPoly
*poly,
int
count,
float
*from,
float
*to,
float
*hit_point,
int
nearest,
int
mode);
132
141
int
GetFootPoly(
float
*position,
float
depth,
CCPoly
*found,
float
*ground,
CCPoly
*polys,
int
count,
int
mode);
CBoxVu0
Definition
collision.hpp:26
CBoxVu0::min
sceVu0FVECTOR min
Definition
collision.hpp:29
CBoxVu0::max
sceVu0FVECTOR max
Definition
collision.hpp:28
CCPolyBox
Definition
collision.hpp:67
CCPolyBox::poly
CCPoly poly
Definition
collision.hpp:69
CCPolyBox::box
CBoxVu0 box
Definition
collision.hpp:70
CCPolyInfo
Definition
collision.hpp:35
CCPoly
Definition
collision.hpp:46
CCPoly::foot_sound
s16 foot_sound
Definition
collision.hpp:56
CCPoly::area_kind
s16 area_kind
Definition
collision.hpp:57
CCPoly::info
CCPolyInfo info
Definition
collision.hpp:52
CCPoly::ignore_mask
s16 ignore_mask
Definition
collision.hpp:58
CCPoly::normal
sceVu0FVECTOR normal
Definition
collision.hpp:49
CCPoly::vertex
sceVu0FVECTOR vertex[3]
Definition
collision.hpp:48
CCPoly::ground_kind
s16 ground_kind
Definition
collision.hpp:55
CCollisionMDT
Definition
collision.hpp:96
CCollisionMDT::mesh
CCPolyBox * mesh
Definition
collision.hpp:99
CCollisionMDT::mesh_count
int mesh_count
Definition
collision.hpp:100
CCollisionMDT::model
MDT_HEADER * model
Definition
collision.hpp:98
CCollision
Definition
collision.hpp:76
CCollision::min
sceVu0FVECTOR min
Definition
collision.hpp:79
CCollision::max
sceVu0FVECTOR max
Definition
collision.hpp:78
MDT_HEADER
Definition
mdt.hpp:10
ps2
include
collision.hpp
Generated by
1.9.8