Open Alan-FGR opened 6 years ago
@Alan-FGR have you tried to call SetBox instead of assigning shape type?
@gleblebedev no I haven't. I didn't even know there is such a method and personally I'm not a big fan of that kind of API, so Shape has a "Set___" for each shape type? That doesn't seem good API imho.
@Alan-FGR it sounds like a bug in urho3d. It does have the check you mentioned: https://github.com/xamarin/Urho3D/blob/master/Source/Urho3D/Physics/CollisionShape.cpp#L764 the constructor sets Size to Vector3.ONE so SetSize(Vector.One) won't have any effect.
Hi there. When you create a collision shape, say:
the shape size is
1,1,1
, although the shape doesn't show in the debugger and is not detectable by raycasts nor GetRigidBodies (which I've bound 😃)... and the strange part is that even when you do say this:for some reason that does not affect it at all, debugger still shows no collision shape whatsoever, but when you do this:
then it works properly.
My guess is that the shape has zero size although UrhoSharp shows 1, and when you set it to 1 for some reason the value is discarded possibly because it checks whether value is different, but that seems to be on Urho side (managed Shape.SetSize (Size property) and native CollisionShape_SetSize (C wrapper) don't check that).