Open Ralith opened 3 years ago
Can we merge this?
It should be tested first, and I'd like to see the discussion points addressed. Especially given that the QBVH isn't shared, I'm not sure it's worth the trouble vs. just duplicating geometry as needed.
Should the transformation be more general? Translation/rotation can be expressed elsewhere, but maybe someone wants to skew? GLTF at least doesn't support anything beyond translation + rotation + nonuniform scaling, but there's not much downside to an arbitrary transform matrix here.
My usecase is exactly this, our data comes from regular gltf files and so we inherit their transforms and need to pass those onto runtime systems like the physics system. Switching to uniforrm scaling wouldn't help us.
Is any of this worth the extra code? Downstream code can always just make another TriMesh with whatever vertices it likes. Collision geometry usually isn't that big, especially for repeated objects. The composite shape abstraction makes the implementation pretty concise, but even so...
We're actually running into this - having to runtime duplicate triangle data just to get a scaled clone of the TriMesh, having this upstreamed / merged would benefit us for sure.
We're actually running into this - having to runtime duplicate triangle data just to get a scaled clone of the TriMesh
The question is, is doing that duplication causing you any concrete problems?
We're actually running into this - having to runtime duplicate triangle data just to get a scaled clone of the TriMesh
The question is, is doing that duplication causing you any concrete problems?
Yes. We have transforms changing at runtime, including scale. It's both CPU and memory overhead we want to avoid.
Any update on this?
Allows reuse of collision geometry between scaled objects, e.g. encoded in a GLTF file.
I think this change is more or less complete, albeit untested, but I'd like to discuss some questions before moving forwards:
QBVH
and perhaps its existing users. Losing support for some cases of GLTF is a shame, but maybe nobody uses nonuniform scaling much in practice?TriMesh
with whatever vertices it likes. Collision geometry usually isn't that big, especially for repeated objects. The composite shape abstraction makes the implementation pretty concise, but even so...