Need help scaling player: mounted images
by Conrad "Lynx" Wong · in Torque Game Engine · 03/04/2003 (10:37 pm) · 3 replies
I've managed to get it so I can dynamically rescale the player, and the eye and camera views, and the nametag seems to have relocated handily as well... But when I have the player, scaled up 5x size, pick up a rifle, the rifle stays mounted at the same old location that it would have on the 1x normal size player.
The relevant code looks to be in engine/game/ShapeBase.cc. I've tried:
Scaling the nodeTransform for the mount point (getMountTransform, getRenderMountTransform)
Scaling the data.mountTransform (getRenderImageTransform)
The first two just result in the weapon being scaled up, but still appearing at ground level, and applying the last as well results in the weapon being scaled up *again*, so it looks like the character is colliding with a *HUGE* rifle.
It looks like all transformations are being combined and multiplied together to form one matrix that is used to multiply all operations performed in rendering the gun... Which probably explains why all scaling just scaled the whole thing.
I do want the weapon to be scaled up, but I also want the weapon to appear at the correct point on the rescaled player.
Suggestions?
The relevant code looks to be in engine/game/ShapeBase.cc. I've tried:
Scaling the nodeTransform for the mount point (getMountTransform, getRenderMountTransform)
Scaling the data.mountTransform (getRenderImageTransform)
The first two just result in the weapon being scaled up, but still appearing at ground level, and applying the last as well results in the weapon being scaled up *again*, so it looks like the character is colliding with a *HUGE* rifle.
It looks like all transformations are being combined and multiplied together to form one matrix that is used to multiply all operations performed in rendering the gun... Which probably explains why all scaling just scaled the whole thing.
I do want the weapon to be scaled up, but I also want the weapon to appear at the correct point on the rescaled player.
Suggestions?
#2
The question is how to make sure images are placed on the correct locations of the mount point nodes. That part is not being handled by the player, it's being handled by ShapeBase.
03/04/2003 (11:15 pm)
No, I've already taken care of scaling the player himself. That part works great. I've fixed the collision bugs so the player correctly collides with other objects at different scales.The question is how to make sure images are placed on the correct locations of the mount point nodes. That part is not being handled by the player, it's being handled by ShapeBase.
#3
It works! Looks great!
03/04/2003 (11:35 pm)
Problem solved! I was incorrectly scaling the entire matrix for nodeTransform; I should have, and am now, extracting just the position, scaling that, and writing that back.It works! Looks great!
Torque 3D Owner Robert Blanchet Jr.