I attached a collision sphere to an avatar names “Girl”.
And export a model names “Box”,create from a box in 3DsMax7, and export it as “pos” type.
When I run an application and control the girl walking through the box.
The collision sphere hasn’t touch the box yet,
but the program detect as they are collide already. (as a picture above)
This is only a vague recollection… I seem to recall that there might be a small error in the handling of scale factors in the collision system.
Is it possible that there is a scale factor applied to the girl or the box? Perhaps the sphere is being rendered smaller than it actually is, or something like that.
I believe that the collision system works for uniform scales. The thing it doesn’t handle well is non-uniform scales. The problem is that under a non-uniform scale, a sphere is no longer a sphere, and requires a more complex, more expensive intersection test.
I have little interest in supporting this more complex, more expensive intersection test. Spheres are enough work. So that’s why non-uniform scales are not supported by the collision system, and we have no plans for supporting them.
Usually it is a problem when there is a non-uniform scale on the object the sphere is colliding into, and more often then not when there is a non-uniform scale on a wall, it was used to construct the wall and has no other purpose. In this case, it is easy to do:
wall.flattenLight()
which applies the scale onto the vertices and removes it. This is generally a good thing to do anyway, since it improves rendering performance. Otherwise Panda has to apply that scale to the wall every frame in real time.
thank you for clearing uniform scaling. So we can setScale(3) or setScale(.0001) and it would still work? For some reason i think we had problems with that too during pyweek AFF: Iron Angels game(https://discourse.panda3d.org/viewtopic.php?t=3087&highlight=pyweek). But we had problems with every thing then…