Open charliefoxtwo opened 2 years ago
Correction - it seems to be a single geometry object which encompasses the entire object
For structures in Generals, GameObject.Colliders
contains a single collider that encompasses the entire object. This is great for a rough pass, but it seems like we'll need a more precise way for determining if the ray actually intersects the object or not. I wonder if there's a way to do this with the model itself?
Looked at this a little bit more, and basically Colliders
is set from the ObjectDefinition Geometry. Some objects may have multiple geometries via the AdditionalGeometry
property, but this doesn't seem to apply to any objects in Generals, so they all just get the one geometry.
Perhaps we need to use the geometry of the active W3DModelDraws defined by the ModelConditionState? This also means we'll need to update the quadtree when the state changes as well.
In OpenSAGE, the logic for determining whether an item has been selected seems to use
the axis-aligned bounding boxa single bounding sphere instead of the model geometry itself. This means that, especially for objects with varying geometry like the command center, the cursor can be nowhere near the model itself but still allow for selection. Generals/Zero Hour seem to use the model geometry or something similar.