General QuestionHiding a certain mesh group within a mesh

jalexb88

Active member
Hey guys, quick question about mesh groups:
In NASSP we load the contact probes as a separate mesh that we delete at lunar contact. We are now working with a new lunar module mesh and would like to include the contact probes as part of the descent stage mesh itself (not a separate mesh) and what Id like to figure out is how to hide the mesh group of the probes at contact, a bit like what SetMeshVisibilityMode does, but instead of hiding the whole mesh, just the mesh group within it (contact probes). Is such a thing possible?

Last edited:

GLS

Well-known member
Orbiter Contributor
You can hide groups in a mesh with oapiEditMeshGroup().

fred18

Donator
What GLS proposed is surely the best way. A quick and dirty thing could also be to animate the group with a scale animation and scale them to 0 when needed calling setanimation. As said this is a quick and dirty thing

GLS

Well-known member
Orbiter Contributor
BTW: be sure to hide the shadow of the group as well, which is done putting the flag at 3.

jalexb88

Active member
Thanks for the help guys! The Delta Glider source code has excellent examples for the use of oapiEditMeshGroup(), so I was able to use that to help implement it in NASSP. Works great!

jalexb88

Active member
I thought the contact probes did rarely penetrate the soil, but rather break and rotate sideways...

https://images.nasa.gov/details-as11-40-5917.html

Yeah, ideally I guess we would animate the probes at contact so they bend sideways...one issue with this is it would be hard to make it look right I think, as the rate at which they bend would depend on the descent rate and what about the case where you only touch one footpad at a time? Or if one decides to liftoff again after touchdown? Of course I'm sure these would be possible with the right coding but I think the simpler method of just hiding the probes is a good one for now.

gattispilot

Tiring to use that edit mesh group. but nothing happens. This is in the load state
 GROUPEDITSPEC ges; //GROUPEDITSPEC grpSpec; //grpSpec.flags = GRPEDIT_SETUSERFLAG; //grpSpec.UsrFlag = 0x00000003;; // hide group and shadow ges.flags = GRPEDIT_SETUSERFLAG; ges.UsrFlag = 1; oapiEditMeshGroup(hOrbiterbridgerails, GRP_BAY11_LONGERON, &ges); oapiEditMeshGroup(hOrbiterbridgerails, GRP_BAY12_LONGERON, &ges); oapiEditMeshGroup(hOrbiterbridgerails, GRP_BAY13_LONGERON, &ges); 

 hOrbiterbridgerails = oapiLoadMeshGlobal("2016SPACESHUTTLE\\shuttlebridgerails"); mesh_bridgerail = AddMesh(hOrbiterbridgerails);//mesh 13 SetMeshVisibilityMode(mesh_bridgerail, MESHVIS_EXTERNAL | MESHVIS_VC | MESHVIS_EXTPASS); 

gattispilot

Not sure why this isn't working.
 GROUPEDITSPEC grpSpec; //GROUPEDITSPEC ges; //GROUPEDITSPEC grpSpec; //grpSpec.flags = GRPEDIT_SETUSERFLAG; //grpSpec.UsrFlag = 0x00000003;; // hide group and shadow //ges.flags = GRPEDIT_SETUSERFLAG; //ges.UsrFlag = 0x00000002; grpSpec.flags = GRPEDIT_SETUSERFLAG; grpSpec.UsrFlag = 0x00000002;; // hide group oapiEditMeshGroup(hOrbiterbridgerails, GRP_BAY11_LONGERON, &grpSpec); oapiEditMeshGroup(hOrbiterbridgerails, GRP_BAY12_LONGERON, &grpSpec); oapiEditMeshGroup(hOrbiterbridgerails, GRP_BAY13_LONGERON, &grpSpec); 

The flag for do not use this mesh group is 0x00000002
Vessel 0x00000001 Do not use this group to render ground shadows Vessel 0x00000002 Do not render this group Vessel 0x00000004 Do not apply lighting when rendering this group Vessel 0x00000008 Texture blending directive: additive with background

gattispilot

 hDevOrbiterMesh = GetDevMesh(vis, 0); //bridgerailmesh = GetDevMesh(vis, 12); GROUPEDITSPEC grpSpec; //GROUPEDITSPEC ges; //GROUPEDITSPEC grpSpec; //grpSpec.flags = GRPEDIT_SETUSERFLAG; //grpSpec.UsrFlag = 0x00000003;; // hide group and shadow //ges.flags = GRPEDIT_SETUSERFLAG; //ges.UsrFlag = 0x00000002; grpSpec.flags = GRPEDIT_SETUSERFLAG; grpSpec.UsrFlag = 0x00000002;; // hide group and shadow oapiEditMeshGroup(hDevOrbiterMesh, GRP_BAY11_LONGERON, &grpSpec);