Change Physics Imposter Size Manually

So lets say we have a subdivided cube and then in the vertex shader its positions gets normalized turning it into a sphere of a certain displacement value (a cubeSphere).

The cubeSphere is originally 1 unit so the physics engine when adding a sphere Imposter makes it always at one unit. Sense I know my displacement amounts I am hoping to update the radius of the bounding sphere to match. I might figure it out here, but if anyone has done this before that would be nice to know.

?._physicsBody.shapes[id].boundingSphereRadius = #
?._physicsBody.shapes[id].radius = #

1 Like

(Wingy waves and then looks over P8’s shoulder to see what mad scientist experiment he is doing.) :slight_smile:

A little note: We have seen the BJS PhysicsImpostor.updateScaling() [something like that] … cause a physics missed-collision fall-thru. For example… if a sphere is on the ground, and then you up-scale its impostor size, it COULD fall thru the floor. A sneaky way to fix… is to apply up-Y-axis linear motion (impulse, force, etc) so the sphere is actually flying when the up-scale happens.

Fun! Likely off-topic. Note… that updateScaling() or whatever it is… wherever it is… (plugin or impostor class)… that thing does a “delete old impostor, add new one” action… to do its update, I think. FYI. Hope you’re doon well.

do you have a controller you can plug in? If so Ill share the scene with you if you promise not to tell or show anyone yet :wink:

1 Like

Thx for the offer, but no controllers here… other than the landlord and price tags on survival supplies. :slight_smile: