120 sceVu0FVECTOR world_from;
121 sceVu0FVECTOR world_to;
122 sceVu0FVECTOR world_up;
123 sceVu0FMATRIX frame_matrix;
127 sceVu0ApplyMatrix(world_from, frame_matrix,
from);
128 sceVu0ApplyMatrix(world_to, frame_matrix,
to);
130 sceVu0ApplyMatrix(world_up, frame_matrix,
up);
131 sceVu0SubVector(span, world_from, world_to);
132 position[0] = (world_from[0] + world_to[0]) / 2.0f;
133 position[1] = (world_from[1] + world_to[1]) / 2.0f;
134 position[2] = (world_from[2] + world_to[2]) / 2.0f;
136 sceVu0CopyVector(world_up,
up);
137 sceVu0SubVector(span,
from,
to);
155 if (!(
extent[0] <= 0.0f)) {
159 if (!(
extent[1] <= 0.0f)) {
163 if (!(
extent[2] <= 0.0f)) {
176 sceVu0Normalize(
direction, new_direction);
180 float horizontal_length = vuabs(
direction);
183 float horizontal_sine = 0.0f;
184 float horizontal_cosine;
186 if (horizontal_length == 0.0f) {
187 horizontal_cosine = 1.0f;
189 horizontal_cosine =
direction[2] / horizontal_length;
190 horizontal_sine = -
direction[0] / horizontal_length;
193 if (length == 0.0f) {
197 float horizontal_ratio = horizontal_length / length;
198 float vertical_ratio =
direction[1] / length;
201 inverse[0][0] = horizontal_cosine;
202 inverse[0][1] = -horizontal_sine * vertical_ratio;
203 inverse[0][2] = horizontal_sine * horizontal_ratio;
206 inverse[1][1] = -horizontal_ratio;
207 inverse[1][2] = -vertical_ratio;
209 inverse[2][0] = horizontal_sine;
210 inverse[2][1] = horizontal_cosine * vertical_ratio;
211 inverse[2][2] = -horizontal_cosine * horizontal_ratio;
217 sceVu0FMATRIX frame_matrix;
218 sceVu0FVECTOR world_from;
219 sceVu0FVECTOR world_to;
221 sceVu0FVECTOR end_extension;
222 sceVu0FVECTOR start_extension;
227 sceVu0ApplyMatrix(world_from, frame_matrix,
from);
229 sceVu0CopyVector(world_from,
from);
234 to_frame->GetLWMatrix(frame_matrix);
235 sceVu0ApplyMatrix(world_to, frame_matrix,
to);
237 sceVu0CopyVector(world_to,
to);
240 position[0] = (world_from[0] + world_to[0]) * 0.5f;
241 position[1] = (world_from[1] + world_to[1]) * 0.5f;
242 position[2] = (world_from[2] + world_to[2]) * 0.5f;
243 sceVu0SubVector(span, world_to, world_from);
244 sceVu0ScaleVector(end_extension, span, (
to_stretch - 1.0f) * 0.5f);
245 sceVu0ScaleVector(start_extension, span, (
from_stretch - 1.0f) * 0.5f);
246 sceVu0AddVector(world_to, world_to, end_extension);
247 sceVu0SubVector(world_from, world_from, start_extension);
248 sceVu0SubVector(span, world_to, world_from);
261 if (!(
extent[0] <= 0.0f)) {
265 if (!(
extent[1] <= 0.0f)) {
269 if (!(
extent[2] <= 0.0f)) {
void SetDir(CFrame *frame, float *from_position, float *to_position, float *up_direction, float half_width, float half_height)