Unfortunately, scaling is not possible on either dynamic or static meshes. Even if it was possible, scaling could not be applied to a static mesh, since static rigid bodies cannot be modified once initialised.
Your only option is to continously delete and re-create the rigid body. It works correctly for spheres/boxes, but maybe impractical in case of meshes since they take longer to initiliase. Here is an example:
sync on
sync rate 60
phy start
autocam off
`create rigid bodies
make object sphere 2,2
position object 2,0,0,0
phy make rigid body dynamic sphere 2
make object box 1,30,2,30
position object 1,0,-30,0
phy make rigid body static box 1
for i = 10 to 19
make object cube i,1
scale object i,100,300,100
position object i,sin((i-10)*36)*2,-30,cos((i-10)*36)*2
phy make rigid body dynamic box i
next i
position camera 0,-20,-50
g = 100
do
set cursor 0,0
print "press enter to scale"
`press enter to enlarge
if returnkey() = 1 and rkey = 0
rkey = 1
endif
if rkey = 1
if g < 300
g = g + 1
`get forces prior deletion
gosub getolddata
`delete old rigid body
phy delete rigid body 2
`scale
scale object 2,g,g,g
`re-initilise rigid body
phy make rigid body dynamic sphere 2
`apply old forces to new objecct
gosub applyolddata
endif
endif
phy update
sync
loop
`get object data
getolddata:
linx# = phy get rigid body linear velocity x(2)
liny# = phy get rigid body linear velocity y(2)
linz# = phy get rigid body linear velocity z(2)
angx# = phy get rigid body angular velocity x(2)
angy# = phy get rigid body angular velocity y(2)
angz# = phy get rigid body angular velocity z(2)
posx# = object position x(2)
posy# = object position y(2)
posz# = object position z(2)
rotx# = object angle x(2)
roty# = object angle y(2)
rotz# = object angle z(2)
return
applyolddata:
`apply to new object
phy set rigid body position 2,posx#, posy#,posz#
phy set rigid body rotation 2,rotx#, roty#, rotz#
phy set rigid body linear velocity 2,linx#,liny#,linz#
phy set rigid body angular velocity 2,angx#,angy#,angz#
return
Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why.
Programmers combine theory and practice: Nothing works and they don't know why.