DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
Loading...
Searching...
No Matches
frame.hpp
1
#pragma once
2
3
#include "common.h"
4
5
#include <libvu0.h>
6
7
class
CBoxVu0
;
8
class
CCollision
;
9
class
CCPoly
;
10
struct
RenderInfo
;
11
class
sceVif1Packet
;
12
20
void
DevInit();
21
22
/* The per-frame drawing attributes, kept inside the frame rather than beside it. SetAttr copies
23
them one field per mask bit, so a field's position and width are settled while its meaning is
24
not — which is why most of them are still unnamed. */
25
class
CFrameAttr
{
26
public
:
27
short
draw_on
;
28
float
clip_depth
;
29
char
clip_enable
;
30
char
unk_09;
31
char
remake_pending
;
32
char
program_option
;
33
char
fog_enable
;
34
char
far_clip_enable
;
35
char
unk_0E;
36
char
unk_0F;
37
float
far_clip
;
38
char
use_color
;
39
sceVu0FVECTOR
color
;
40
char
cull_enable
;
41
char
ambient_boost
;
42
sceVu0FVECTOR unk_40;
43
short
alpha_ref
;
44
short
blend_mode
;
45
char
depth_write
;
46
char
ignore_depth
;
47
short
eye_relative
;
48
short
billboard
;
50
CFrameAttr
();
51
52
void
Initialize();
53
};
54
55
/* A node of the scene hierarchy: a transform with a name, linked to its neighbours rather than
56
held in an array. The world matrix is cached and world_valid says whether the cache still
57
holds; everything that moves a frame clears it. */
58
class
CFrame
{
59
public
:
60
int
flags
;
61
CCollision
*
collision
;
62
sceVu0FVECTOR
max
;
63
sceVu0FVECTOR
min
;
64
sceVu0FVECTOR
corner
[8];
65
CFrameAttr
attr
;
66
CFrame
*
parent
;
67
int
reference
;
68
char
name
[32];
69
CFrame
*
child
;
70
CFrame
*
brother
;
71
CFrame
*
elder
;
72
sceVu0FMATRIX
world
;
73
sceVu0FMATRIX
inverse
;
74
sceVu0FMATRIX
local
;
75
sceVu0FVECTOR
scale
;
76
sceVu0FVECTOR
position
;
77
sceVu0FVECTOR
rotation
;
78
int
world_valid
;
79
int
no_rotation
;
80
int
rot_type
;
81
int
srt
;
83
float (*GetInverseMatrix())[4];
84
CFrame
&operator=(
CFrame
&other);
85
86
CFrame
();
87
88
void
SetPosition(
float
x,
float
y,
float
z);
89
void
SetPosition(
float
*
position
);
90
void
SetScale(
float
x,
float
y,
float
z);
91
void
SetScale(
float
*
scale
);
92
int
GetFrameNum();
93
void
SetParent(
CFrame
*
parent
);
94
void
SetBrother(
CFrame
*
brother
);
95
void
SetChild(
CFrame
*
child
);
96
void
SetReference(
CFrame
*
reference
);
97
void
DeleteReference();
98
void
GetLWMatrix(sceVu0FMATRIX matrix);
99
void
SetTransMatrix(sceVu0FMATRIX matrix);
100
void
SetTransMatrix(
float
*quaternion);
101
CFrame
*SearchFrame(
char
*
name
);
102
void
GetBoundBox(
CBoxVu0
*box,
int
children);
103
void
ScaleBoundBox(
float
*
scale
);
104
void
SetAttr(
CFrameAttr
&
attr
,
int
children,
int
mask);
105
void
GetWorldPosition(
float
*world_point,
float
*local_point);
106
void
SetRotation(
float
x,
float
y,
float
z);
107
void
GetRotation(
float
*
rotation
);
108
void
SetRotType(
int
type);
109
void
SetCollision(
CCollision
*
collision
);
110
int
PickUpNearPoly(
CCPoly
*poly,
const
CBoxVu0
&box);
111
112
virtual
int
DrawVu1(
unsigned
int
*packet,
RenderInfo
*info);
113
virtual
int
DrawVu1(
sceVif1Packet
*packet,
RenderInfo
*info);
114
virtual
void
Initialize();
115
};
116
117
class
CFrameVu1
;
118
120
enum
_FRAMECONSTRAINT {
121
FRAME_CONSTRAINT_Z,
122
FRAME_CONSTRAINT_Y,
123
FRAME_CONSTRAINT_X
124
};
125
126
int
FrameNameComp(
char
*left,
char
*right);
127
void
SetFrameAttr(
CFrame
*frame,
int
recurse);
128
int
LookAt(
CFrameVu1
*frame,
float
*target, _FRAMECONSTRAINT constraint);
129
int
LookAt(
CFrameVu1
*frame,
CFrameVu1
*target, _FRAMECONSTRAINT constraint);
CBoxVu0
Definition
collision.hpp:26
CCPoly
Definition
collision.hpp:46
CCollision
Definition
collision.hpp:76
CFrameAttr
Definition
frame.hpp:25
CFrameAttr::draw_on
short draw_on
Definition
frame.hpp:27
CFrameAttr::clip_enable
char clip_enable
Definition
frame.hpp:29
CFrameAttr::alpha_ref
short alpha_ref
Definition
frame.hpp:43
CFrameAttr::remake_pending
char remake_pending
Definition
frame.hpp:31
CFrameAttr::color
sceVu0FVECTOR color
Definition
frame.hpp:39
CFrameAttr::cull_enable
char cull_enable
Definition
frame.hpp:40
CFrameAttr::ignore_depth
char ignore_depth
Definition
frame.hpp:46
CFrameAttr::ambient_boost
char ambient_boost
Definition
frame.hpp:41
CFrameAttr::billboard
short billboard
Definition
frame.hpp:48
CFrameAttr::clip_depth
float clip_depth
Definition
frame.hpp:28
CFrameAttr::program_option
char program_option
Definition
frame.hpp:32
CFrameAttr::far_clip
float far_clip
Definition
frame.hpp:37
CFrameAttr::use_color
char use_color
Definition
frame.hpp:38
CFrameAttr::eye_relative
short eye_relative
Definition
frame.hpp:47
CFrameAttr::depth_write
char depth_write
Definition
frame.hpp:45
CFrameAttr::fog_enable
char fog_enable
Definition
frame.hpp:33
CFrameAttr::far_clip_enable
char far_clip_enable
Definition
frame.hpp:34
CFrameAttr::blend_mode
short blend_mode
Definition
frame.hpp:44
CFrameVu1
Definition
framevu1.hpp:15
CFrame
Definition
frame.hpp:58
CFrame::flags
int flags
Definition
frame.hpp:60
CFrame::corner
sceVu0FVECTOR corner[8]
Definition
frame.hpp:64
CFrame::name
char name[32]
Definition
frame.hpp:68
CFrame::rot_type
int rot_type
Definition
frame.hpp:80
CFrame::local
sceVu0FMATRIX local
Definition
frame.hpp:74
CFrame::elder
CFrame * elder
Definition
frame.hpp:71
CFrame::no_rotation
int no_rotation
Definition
frame.hpp:79
CFrame::attr
CFrameAttr attr
Definition
frame.hpp:65
CFrame::min
sceVu0FVECTOR min
Definition
frame.hpp:63
CFrame::scale
sceVu0FVECTOR scale
Definition
frame.hpp:75
CFrame::position
sceVu0FVECTOR position
Definition
frame.hpp:76
CFrame::reference
int reference
Definition
frame.hpp:67
CFrame::world
sceVu0FMATRIX world
Definition
frame.hpp:72
CFrame::inverse
sceVu0FMATRIX inverse
Definition
frame.hpp:73
CFrame::max
sceVu0FVECTOR max
Definition
frame.hpp:62
CFrame::collision
CCollision * collision
Definition
frame.hpp:61
CFrame::world_valid
int world_valid
Definition
frame.hpp:78
CFrame::child
CFrame * child
Definition
frame.hpp:69
CFrame::srt
int srt
Definition
frame.hpp:81
CFrame::parent
CFrame * parent
Definition
frame.hpp:66
CFrame::rotation
sceVu0FVECTOR rotation
Definition
frame.hpp:77
CFrame::brother
CFrame * brother
Definition
frame.hpp:70
RenderInfo
Definition
renderinfo.hpp:16
sceVif1Packet
Definition
libpkt.h:10
ps2
include
frame.hpp
Generated by
1.9.8