Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Humans enhancement #46

Merged
merged 2 commits into from Oct 9, 2023
Merged

Humans enhancement #46

merged 2 commits into from Oct 9, 2023

Conversation

jmbau
Copy link
Collaborator

@jmbau jmbau commented Aug 13, 2023

Hereunder a mission file to see what is now possible:
humans_test.mis.txt

Copy link
Member

@hsanjuan hsanjuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, see comments.

src/humanio.c Outdated
Comment on lines 236 to 237
(MAX((int)value[0], 0) < SAR_ASSISTING_HUMANS_MAX)
? MAX((int)value[0], 0) : SAR_ASSISTING_HUMANS_MAX
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a CLIP function for this, if I'm understanding right. CLIP((int)value[0], 0, SAR_ASSISTING_HUMANS)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, done!

src/humanio.c Outdated
else if(!strcasecmp(buf, "Gender"))
{
/* Male is default gender.
* If Female, a breast will be drawn on torso.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully two breasts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, hopefully ! French <-> English translation issue... Done !

src/simop.c Outdated
Comment on lines 3413 to 3444
{
/* 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,
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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is something changing here or just indentation issue?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only indentation, no changes here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we leave the original? It looks like the second IF is indented too little.

@@ -0,0 +1,40 @@

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we put this on a separate PR? Seems out the "human improvement" scope

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lost in git, ONE MORE TIME...
I don't understand why it is in humans enhancement PR, I pushed this 2 days ago in the v3dconverter branch, but I didn't asked any PR for this branch because even if v3dconverter works (I did all Corsica scenery update new models with it), as written in readme.txt/FOREWORD: it's not yet finished !
How can I remove these files ? With .../Delete file ???

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems you pushed onto this branch too.

First check that the v3dconverter stuff is correctly committed in the other branch.

Then you can do git rebase -i master on this branch and select which commits to drop. I can do it for you too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can do it, I think that it will be less dangerous for the SarII project... This morning I read some documentation about rebase, but frankly speaking, it is not clear for me.

@hsanjuan
Copy link
Member

hsanjuan commented Aug 13, 2023

Hereunder a mission file to see what is now possible: humans_test.mis.txt

Perhaps we could put this as part of the test_world scenery? There's not much space (only a boat and a burning platform, but maybe a good excuse to add some land.

Yes, I will do it.

src/human.h Outdated Show resolved Hide resolved
src/humanio.c Outdated Show resolved Hide resolved
src/objio.c Outdated Show resolved Hide resolved
src/simop.c Outdated
Comment on lines 3413 to 3444
{
/* 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,
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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we leave the original? It looks like the second IF is indented too little.

jmbau and others added 2 commits October 9, 2023 10:11
- Add a 'Gender' parameter in /data/humans.ini
- Body shape now depends of weight and gender (very basic Body Mass Index use)
- Up to 4 assistants instead of 1 per victim
- Victim and assistant(s) can now be any of defined human, and not only blue/red and green guys
- Documentation updated
@hsanjuan hsanjuan merged commit 1da0bd6 into master Oct 9, 2023
1 check failed
@hsanjuan hsanjuan deleted the humans_enhancement branch October 9, 2023 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants