newaged Posted January 18, 2016 Share Posted January 18, 2016 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. Quote Link to comment Share on other sites More sharing options...
Duion Posted January 18, 2016 Share Posted January 18, 2016 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. Quote Link to comment Share on other sites More sharing options...
newaged Posted January 18, 2016 Author Share Posted January 18, 2016 I used the editor to change the scale. The player never dropped through the terrain when doing that, but after it fell for a short distance it would punch right through. Quote Link to comment Share on other sites More sharing options...
Duion Posted January 18, 2016 Share Posted January 18, 2016 What I found is, that the physics engine needs some kind of tolerance for collisions. In datablocks they are named "collisionTol" and "contactTol" , so maybe if you scale the player it's tolerance gets too small and so sometimes falls through. Quote Link to comment Share on other sites More sharing options...
newaged Posted January 18, 2016 Author Share Posted January 18, 2016 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. Quote Link to comment Share on other sites More sharing options...
rlranft Posted January 19, 2016 Share Posted January 19, 2016 The change you made is correct as far as I can see - before the player's collision box wasn't scaled with the player model, now it is. This filter using a scaled player collision box makes sense. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.