11 zoneID =
test_ray_zones(posX, posY, posZ, 0.0f, -1.0f, 0.0f, &
hitX, &
hitY, &
hitZ, &
hitDepth, &
nX, &
nY, &
nZ);
22s32
calculate_segment_intersection(
f32 A1x,
f32 A1z,
f32 A2x,
f32 A2z,
f32 B1x,
f32 B1z,
f32 B2x,
f32 B2z,
f32*
interX,
f32*
interZ,
f32*
squared_dist) {
52 }
else if (
disc > 0.0f) {
61 }
else if (
disc > 0.0f) {
122s32
calculate_line_segment_intersection(
f32 A1x,
f32 A1z,
f32 A2x,
f32 A2z,
f32 B1x,
f32 B1z,
f32 B2x,
f32 B2z,
f32*
interX,
f32*
interZ,
f32*
squared_dist) {
150 }
else if (
disc > 0.0f) {
159 }
else if (
disc > 0.0f) {
193 if (camSettings ==
NULL) {
236 camera->leadInterpAlpha = 1.0f;
237 camera->targetLeadAmount = 0.0f;
252 if (stickX != 0.0f) {
254 if (
camera->accumulatedStickLead > 0.0f) {
256 camera->accumulatedStickLead = stickX;
258 camera->accumulatedStickLead += stickX;
260 if (
camera->accumulatedStickLead <= -300.0f) {
263 if (
camera->targetLeadAmount > 0.0f) {
264 camera->leadInterpAlpha = 0.0f;
267 camera->accumulatedStickLead = -300.0f;
270 if (
camera->accumulatedStickLead < 0.0f) {
272 camera->accumulatedStickLead = stickX;
274 camera->accumulatedStickLead += stickX;
276 if (
camera->accumulatedStickLead >= 300.0f) {
279 if (
camera->targetLeadAmount < 0.0f) {
280 camera->leadInterpAlpha = 0.0f;
283 camera->accumulatedStickLead = 300.0f;
288 if (
camera->increasingLeadInterp) {
289 camera->leadInterpAlpha += 0.01f;
290 if (
camera->leadInterpAlpha > 1.0f) {
291 camera->leadInterpAlpha = 1.0f;
296 if (
camera->targetLeadAmount -
camera->leadAmount == 0.0f) {
297 camera->leadInterpAlpha = 0.0f;
302 if (
camera->targetLeadAmount -
camera->leadAmount > 0.0f) {
304 if (
camera->targetLeadAmount -
camera->leadAmount < 0.1) {
313 if (
camera->targetLeadAmount -
camera->leadAmount > -0.1) {
325 camera->leadInterpAlpha = 0.0f;
338 leadAmount =
camera->leadAmount;
341 if (settings !=
NULL) {
346 if (
camera->needsInitialConstrainDir) {
353 1.0f, &
X, &
Y, &
Z, &
W);
359 camera->leadConstrainDir = (
X > 0.0f) ? 1 : (
X < 0.0f) ? -1 : 0;
383 camera->leadInterpAlpha = 0.0f;
384 camera->leadAmount = 0.0f;
386 camera->prevLeadSettings = settings;
393 camera->leadConstrainDir = 0;
394 camera->prevLeadSettings = settings;
405 if (settings ==
NULL) {
419 settings =
camera->prevLeadSettings;
442 for (s32 i = 0; i <
zone->numTriangles; i++) {
444 zone->triangleTable[i].v2->x,
zone->triangleTable[i].v2->z,
451 zone->triangleTable[i].v3->x,
zone->triangleTable[i].v3->z,
458 zone->triangleTable[i].v1->x,
zone->triangleTable[i].v1->z,
468 camera->leadAmount = 0.0f;
472 camera->leadInterpAlpha = 0.0f;
BSS s32 PopupMenu_SelectedIndex
s32 calculate_segment_intersection(f32 A1x, f32 A1z, f32 A2x, f32 A2z, f32 B1x, f32 B1z, f32 B2x, f32 B2z, f32 *interX, f32 *interZ, f32 *squared_dist)
void apply_constraints_to_lead_amount(Camera *camera)
void update_camera_lead_amount(Camera *camera, f32 candidateLeadAmount)
CameraControlSettings * test_ray_zone(f32 posX, f32 posY, f32 posZ, Collider **zone)
void create_camera_leadplayer_matrix(Camera *camera)
s32 func_800328A4(CameraControlSettings *camSettings, f32 Px, f32 Pz)
s32 calculate_line_segment_intersection(f32 A1x, f32 A1z, f32 A2x, f32 A2z, f32 B1x, f32 B1z, f32 B2x, f32 B2z, f32 *interX, f32 *interZ, f32 *squared_dist)
union CameraControlSettings::@14 points
@ CAM_CONTROL_FIXED_POS_AND_ORIENTATION
@ CAM_CONTROL_CONSTRAIN_TO_LINE
@ CAM_CONTROL_CONSTAIN_BETWEEN_POINTS
@ CAM_CONTROL_LOOK_AT_POINT_CONSTAIN_TO_LINE
@ CAMERA_FLAG_SUPRESS_LEADING
s32 test_ray_zones(f32 startX, f32 startY, f32 startZ, f32 dirX, f32 dirY, f32 dirZ, f32 *hitX, f32 *hitY, f32 *hitZ, f32 *hitDepth, f32 *nx, f32 *ny, f32 *nz)
PlayerStatus * gPlayerStatusPtr
CollisionData gZoneCollisionData
PartnerStatus gPartnerStatus