Forum

Stride Sphere Model and its Bounding Sphere

hey,

a Sphere [Stride.Models] does have a Bounding Sphere, which could be meaningful for checking spatial reations. However, there seems to be a difference between the Model the Entity is created with and the ModelComponent, which it also has. which one is relevant for the Sphere [Stride.Models] and what is actually the difference between them.

also, it seems that both of them are not initialized with the actual radius when the sphere is created (and manual initialization only works for the BoundingSphere [Model]. should this considered to be a bug (thinking that the BoundingSphere is a property that is part of the Model in any case).

BoundingSphere

Hey, the BoundingSphere is not in use in Stride, from what I can see in the code. Use BoundingBox instead…

The difference is that the ModelComponent one is updated by the component processor, you shouldn’t touch that one, it’s used for internal computations.

To get the runtime values, connect the sphere to a running scene graph, the values should get populated then.

hey,
thanks for trying to clarify but i think i still don’t get it. trying something similar to get the BoundingBox also results in a Box with no dimensions (i.e. not initialized). is it the right way trying to retrieve these things via Entity->GetComponent->Model[Modelcomponent]->BoundingBox[Model] ?

grafik

Also, I just had a look at PrimitiveProceduralModelBase.cs and
according to these lines both, a BoundingBox and a BoundingSphere should be initialized on creation of one of these models - right?

sorry, the stride docs are not very elaborate on how to use these properties…

Yes, they should both be set on the model… That’s very odd indeed. I’ll have a look.