[+] Inline support for gltf maps; add "inline" 0 property to an idStaticEntity or func_static to not inlude it in the map bsp. Defaults to 1

This commit is contained in:
HarrievG 2022-10-23 13:02:43 +02:00 committed by Robert Beckebans
parent 98ed96adf4
commit 9589ea300d

View file

@ -370,10 +370,11 @@ int idMapEntity::GetEntities( gltfData* data, EntityListRef entities, int sceneI
}
else
{
idStr classname = node->extras.strPairs.GetString( "classname" );
idStr classnameStr = node->extras.strPairs.GetString( "classname" );
bool skipInline = !node->extras.strPairs.GetBool("inline",true);
// skip everything that is not an entity
if( !classname.IsEmpty() )
if( !classnameStr.IsEmpty())
{
idMapEntity* newEntity = new( TAG_IDLIB_GLTF ) idMapEntity();
entities.Append( newEntity );
@ -418,7 +419,10 @@ int idMapEntity::GetEntities( gltfData* data, EntityListRef entities, int sceneI
#endif
// add meshes from all subnodes
ProcessSceneNode_r( newEntity, node, mat4_identity, worldToEntityTransform, data );
if (!skipInline)
{
ProcessSceneNode_r(newEntity, node, mat4_identity, worldToEntityTransform, data);
}
entityCount++;
}