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
7class CBoxVu0;
8class CCollision;
9class CCPoly;
10struct RenderInfo;
11class sceVif1Packet;
12
20void 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. */
26public:
27 short draw_on;
28 float clip_depth;
30 char unk_09;
35 char unk_0E;
36 char unk_0F;
37 float far_clip;
38 char use_color;
39 sceVu0FVECTOR color;
42 sceVu0FVECTOR unk_40;
43 short alpha_ref;
44 short blend_mode;
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. */
58class CFrame {
59public:
60 int flags;
62 sceVu0FVECTOR max;
63 sceVu0FVECTOR min;
64 sceVu0FVECTOR corner[8];
68 char name[32];
72 sceVu0FMATRIX world;
73 sceVu0FMATRIX inverse;
74 sceVu0FMATRIX local;
75 sceVu0FVECTOR scale;
76 sceVu0FVECTOR position;
77 sceVu0FVECTOR rotation;
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
117class CFrameVu1;
118
120enum _FRAMECONSTRAINT {
121 FRAME_CONSTRAINT_Z,
122 FRAME_CONSTRAINT_Y,
123 FRAME_CONSTRAINT_X
124};
125
126int FrameNameComp(char *left, char *right);
127void SetFrameAttr(CFrame *frame, int recurse);
128int LookAt(CFrameVu1 *frame, float *target, _FRAMECONSTRAINT constraint);
129int LookAt(CFrameVu1 *frame, CFrameVu1 *target, _FRAMECONSTRAINT constraint);
short draw_on
Definition frame.hpp:27
char clip_enable
Definition frame.hpp:29
short alpha_ref
Definition frame.hpp:43
char remake_pending
Definition frame.hpp:31
sceVu0FVECTOR color
Definition frame.hpp:39
char cull_enable
Definition frame.hpp:40
char ignore_depth
Definition frame.hpp:46
char ambient_boost
Definition frame.hpp:41
short billboard
Definition frame.hpp:48
float clip_depth
Definition frame.hpp:28
char program_option
Definition frame.hpp:32
float far_clip
Definition frame.hpp:37
char use_color
Definition frame.hpp:38
short eye_relative
Definition frame.hpp:47
char depth_write
Definition frame.hpp:45
char fog_enable
Definition frame.hpp:33
char far_clip_enable
Definition frame.hpp:34
short blend_mode
Definition frame.hpp:44
int flags
Definition frame.hpp:60
sceVu0FVECTOR corner[8]
Definition frame.hpp:64
char name[32]
Definition frame.hpp:68
int rot_type
Definition frame.hpp:80
sceVu0FMATRIX local
Definition frame.hpp:74
CFrame * elder
Definition frame.hpp:71
int no_rotation
Definition frame.hpp:79
CFrameAttr attr
Definition frame.hpp:65
sceVu0FVECTOR min
Definition frame.hpp:63
sceVu0FVECTOR scale
Definition frame.hpp:75
sceVu0FVECTOR position
Definition frame.hpp:76
int reference
Definition frame.hpp:67
sceVu0FMATRIX world
Definition frame.hpp:72
sceVu0FMATRIX inverse
Definition frame.hpp:73
sceVu0FVECTOR max
Definition frame.hpp:62
CCollision * collision
Definition frame.hpp:61
int world_valid
Definition frame.hpp:78
CFrame * child
Definition frame.hpp:69
int srt
Definition frame.hpp:81
CFrame * parent
Definition frame.hpp:66
sceVu0FVECTOR rotation
Definition frame.hpp:77
CFrame * brother
Definition frame.hpp:70