Skip to content

Commit

Permalink
simop.c indentation cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbau committed Aug 15, 2023
1 parent b07fafd commit 0f47fa0
Showing 1 changed file with 43 additions and 43 deletions.
86 changes: 43 additions & 43 deletions src/simop.c
Original file line number Diff line number Diff line change
Expand Up @@ -3409,54 +3409,54 @@ void SARSimApplyGCTL(sar_core_struct *core_ptr, sar_object_struct *obj_ptr)
}

/* Is door fully opened ? */
if (door_ptr->flags & SAR_OBJ_PART_FLAG_DOOR_OPENED)
{
/* Was rope previously in? */
if(hoist->rope_cur < hoist->contact_z_max)
if(door_ptr->flags & SAR_OBJ_PART_FLAG_DOOR_OPENED)
{
/* Hoist deployment was in so now it needs to
* be put out and its values initialized
*/
sar_position_struct *hoist_pos = &hoist->pos,
/* Was rope previously in? */
if(hoist->rope_cur < hoist->contact_z_max)
{
/* Hoist deployment was in so now it needs to
* be put out and its values initialized
*/
sar_position_struct *hoist_pos = &hoist->pos,
*hoist_offset = &hoist->offset;
double tx = hoist_offset->x,
ty = hoist_offset->y,
tz = hoist_offset->z;
double tx = hoist_offset->x,
ty = hoist_offset->y,
tz = hoist_offset->z;

/* Move to initial position at hoist center */
SFMOrthoRotate2D(
obj_ptr->dir.heading, &tx, &ty
);
hoist_pos->x = (float)(
obj_ptr->pos.x + tx
);
hoist_pos->y = (float)(
obj_ptr->pos.y + ty
);
hoist_pos->z = (float)(
obj_ptr->pos.z + tz -
hoist->rope_cur
);
/* Move to initial position at hoist center */
SFMOrthoRotate2D(
obj_ptr->dir.heading, &tx, &ty
);
hoist_pos->x = (float)(
obj_ptr->pos.x + tx
);
hoist_pos->y = (float)(
obj_ptr->pos.y + ty
);
hoist_pos->z = (float)(
obj_ptr->pos.z + tz -
hoist->rope_cur
);

/* Reset hoist values */
hoist->rope_cur = hoist->contact_z_max;
hoist->rope_cur_vis = hoist->rope_cur;
hoist->on_ground = 0;
}
else
{
/* Lower rope normally */
hoist->rope_cur += (rope_rate *
time_compensation * time_compression *
hoist_down_coeff);
if(hoist->rope_cur > hoist->rope_max)
hoist->rope_cur = hoist->rope_max;

/* Do not update rope_cur_vis, it will be updated
* in the other simulation calls
*/
}
/* Reset hoist values */
hoist->rope_cur = hoist->contact_z_max;
hoist->rope_cur_vis = hoist->rope_cur;
hoist->on_ground = 0;
}
else
{
/* Lower rope normally */
hoist->rope_cur += (rope_rate *
time_compensation * time_compression *
hoist_down_coeff);
if(hoist->rope_cur > hoist->rope_max)
hoist->rope_cur = hoist->rope_max;

/* Do not update rope_cur_vis, it will be updated
* in the other simulation calls
*/
}
}
}
}
}
Expand Down

0 comments on commit 0f47fa0

Please sign in to comment.