Hi, I’m new to Xenko and trying to identify limitations for a game design I have in mind, before i fully engage with it.
Intent
What I’m trying to achieve is this: Imagine a procedurally generated terrain that for example gets struck by a foreign object, like a meteor. In that case, I’d like for both the terrain mesh AND its collider to be updated at runtime. It is absolutely critical for the design, to be able to locally regenerate the procedural terrain AND do it very fast (or async which is why I’m looking towards using Xenko instead of for example Unity)
So in other words, I want to update only some select single points on the collider
Attempts
Now I tried to fiddle a bit with Xenko’s code and I ended up with something like this:
var physicsComponent = this.Entity.Get<PhysicsComponent>();
var colliderShape = physicsComponent.ColliderShape();
Now at this point, I can’t directly access the points of the shape, so I’d have to use reflection which means that from your PoV, its not intended to be used like that, and besides - its a read only list, probably for the same reason:
Type tInfo = physicsComponent.ColliderShape.GetType();
var property = tInfo.GetRuntimeProperty("Points");
var points = property.GetValue(shape) as IReadOnlyList<Vector3>;
Questions
So on that note:
- Is it possible to partially update a complex mesh-based collider at runtime “the right way”?
- If not, will there be support for it in the near future?