Skip to content
Permalink
Browse files

Merge remote-tracking branch 'origin/master-3.0'

  • Loading branch information
xen2 committed Jan 12, 2019
2 parents b6333f3 + e1f48cc commit b54f35afaf7eb520b2897516e64633e4b2c99297
Showing with 24 additions and 1 deletion.
  1. +24 −1 sources/engine/Xenko.Assets/Physics/ColliderShapeAssetCompiler.cs
@@ -51,11 +51,34 @@ public override IEnumerable<Type> GetInputTypesToExclude(AssetItem assetItem)
yield return typeof(TextureAsset);
}

public override IEnumerable<ObjectUrl> GetInputFiles(AssetItem assetItem)
{
var asset = (ColliderShapeAsset)assetItem.Asset;
foreach (var desc in asset.ColliderShapes)
{
if (desc is ConvexHullColliderShapeDesc)
{
var convexHullDesc = desc as ConvexHullColliderShapeDesc;

if (convexHullDesc.Model != null)
{
var url = AttachedReferenceManager.GetUrl(convexHullDesc.Model);

if (!string.IsNullOrEmpty(url))
{
yield return new ObjectUrl(UrlType.Content, url);
}
}
}
}
}

protected override void Prepare(AssetCompilerContext context, AssetItem assetItem, string targetUrlInStorage, AssetCompilerResult result)
{
var asset = (ColliderShapeAsset)assetItem.Asset;

result.BuildSteps = new AssetBuildStep(assetItem);
result.BuildSteps.Add(new ColliderShapeCombineCommand(targetUrlInStorage, asset, assetItem.Package));
result.BuildSteps.Add(new ColliderShapeCombineCommand(targetUrlInStorage, asset, assetItem.Package) { InputFilesGetter = () => GetInputFiles(assetItem) });
}

public class ColliderShapeCombineCommand : AssetCommand<ColliderShapeAsset>

0 comments on commit b54f35a

Please sign in to comment.
You can’t perform that action at this time.