Jump to content

Player scaling


newaged

Recommended Posts

I noticed that scaling down players in torquescript made them fall through the terrain constantly.

I changed this

Point3F Player::_move( player.cpp around line 4670 ) {
....
if (mFabs(distance.x) < mObjBox.len_x() &&
   mFabs(distance.y) < mObjBox.len_y() &&  
   mFabs(distance.z) < mObjBox.len_z())  
{ 

to this

if (mFabs(distance.x) < mScaledBox.len_x() &&  
  mFabs(distance.y) < mScaledBox.len_y() &&  
  mFabs(distance.z) < mScaledBox.len_z())  
{ 

and the problems stopped.

I don't know if this is something I should make a PR for, and I am not good enough with C++ or the engine to know if there is a better way to solve the problem, so I am bringing it up here.

Link to comment
Share on other sites

How did you change the scale? When you change it manually it works, the problem is, for the moment the change is happening the collision is disabled and the player may fall through, like if you change the size of an object you stand on, or scale yourself.

Link to comment
Share on other sites

Maybe it has something to do with the tolerance, maybe it doesn't, I don't know enough about the collision system to say. The changes I made do seem to work however, the default soldier still works fine even when scaled to 1/20th of his original size.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...