Changing shape flag breeds new entities? ( PhysX-3.3.0_ANDROID )

Hi! I want to figure out one thing.
When I create a shape for an actor and then raise a shape flag, let’s say… to switch the shape to a trigger shape, so I do it and see, that a new broad phase entity is created. Then if I switch the shape back to simulation shape or just switch true/false for the trigger shape more new entities are coming. And it seems that I don’t have the access to those entities, because when I release the actor owning those shapes, some shapes are not cleared and sooner or later I’m getting the error that no new entities are being created as I reached the maximum 32768 value.
Am I doing something wrong about the flags?

The procedure to for mutually exclusive shape flag such as the whether the shape is a trigger or simulation shape is to lower the uninterested flag first, then raise the interested flag when switching. However, the API should have checks in place that both do not get raised( I haven’t verified this myself, since I went by the API guide ). How are you verifying that new entities are getting created? …PVD ?

I’ve been experimenting and found out that you can raise any shape flag only once between fetchResults - Simulate cycle. If you do it twice, on the 32768 cycle it crashes. So I verified it the hard way =)
The thing is I need to switch from triggers to simulations many times and so I have to wrap it in like I do it only once… and causes troubles.

Solved.
If you create shapes via the actor like

mActor->createShape( ... );

those shapes are attached already and changing of the shape flag WILL breed new entities.

But if you create shapes via the physics like

mPhys->createShape( ... )

then you can change the flag as many times as you wish, but you can not do that after you attached the shape to the actor and released from physics. New entities are going to overload the memory.

And also you can not attach detach shapes from actors withing fetchResults - simulate more the 1 time. For the same reason.

Solved.
If you create shapes via the actor like

mActor->createShape( ... );

those shapes are attached already and changing of the shape flag WILL breed new entities.

But if you create shapes via the physics like

mPhys->createShape( ... )

then you can change the flag as many times as you wish, but you can not do that after you attached the shape to the actor and released from physics. New entities are going to overload the memory.

And also you can not attach detach shapes from actors withing fetchResults - simulate more the 1 time. For the same reason.