Game Development Community

Rotating a waterblock

by Joseph Mueller · in Torque 3D Professional · 05/13/2014 (9:45 am) · 3 replies

I've run into a little problem with waterblocks. I need to rotate one 45 degrees to fit into my scene. When I do this, the bounding box stays where it was without rotating, causing the player to emit splashes where no water is visible. Any suggestions on how to rotate the bounding box with the waterblock?




#1
05/13/2014 (10:46 am)
Interesting, try doing a:
Waterblock.setPosition(Waterblock.position);
#2
05/13/2014 (11:17 am)
It has something to do with how the bounding box is declared in source. Some box types don't rotate, they just grow larger when the object is rotated. This has an "advantage" that collision test and so are faster then with the types that do rotate with the object.

The only solution is to modify the source to a box type that can rotate and do the usual stuff that they should do.
#3
05/13/2014 (11:29 am)
Lukas, I tried Waterblock.setTransform(Waterblock.position), also tried Waterblock.setTransform(Waterblock.getTransform()), no luck with either one. When the block is rotated, the bounding box actually gets resized somewhere. I need to figure out how to tie the bounding box to the waterblock's setTransform. Thanks!