land animation not working - LOGGED
by Enel · in Torque 3D Professional · 11/13/2009 (10:54 am) · 11 replies
Torque 3D ver 1.0 Land animation not working..
About the author
Recent Threads
#2
Torque 3D ver 1.0 Land animation not working..
11/13/2009 (2:35 pm)
I've tried it, from about 1km up.....Torque 3D ver 1.0 Land animation not working..
#3
11/13/2009 (2:53 pm)
And you're right ... also no damage from falling.
#4
11/13/2009 (9:59 pm)
yes.. :(
#6
just one other thing, the player falls veeeery slowly, like he is a huge cotton ball weighing 100grams,
F8, fly up a bit, F7 to start falling, shoot, your shells fall way faster than you,
this is not correct,
where is terminal velocity?
11/14/2009 (5:47 am)
ok, that link fixed it, yay.just one other thing, the player falls veeeery slowly, like he is a huge cotton ball weighing 100grams,
F8, fly up a bit, F7 to start falling, shoot, your shells fall way faster than you,
this is not correct,
where is terminal velocity?
#7
Firstly go to the method _handleCollision()
Put all in comment except for the ending:
Then go in _move(), find this code:
And below it,paste this:
Then go a few lines ahead and find the bd redefenition,put it in a comment:
Then go to player.cs and use a lower value for landing:
11/14/2009 (7:51 am)
ok,i fixed landing.Firstly go to the method _handleCollision()
Put all in comment except for the ending:
if ( !isGhost() &&
collision.object &&
collision.object != mContactInfo.contactObject )
queueCollision( collision.object, mVelocity - collision.object->getVelocity() );Then go in _move(), find this code:
// Pick the surface most parallel to the face that was hit.
const Collision *collision = &collisionList[0];
const Collision *cp = collision + 1;
const Collision *ep = collision + collisionList.getCount();
for (; cp != ep; cp++)
{
if (cp->faceDot > collision->faceDot)
collision = cp;
}And below it,paste this:
F32 bd = -mDot( mVelocity, collision->normal);
// shake camera on ground impact
if( bd > mDataBlock->groundImpactMinSpeed && isControlObject() )
{
F32 ampScale = (bd - mDataBlock->groundImpactMinSpeed) / mDataBlock->minImpactSpeed;
CameraShake *groundImpactShake = new CameraShake;
groundImpactShake->setDuration( mDataBlock->groundImpactShakeDuration );
groundImpactShake->setFrequency( mDataBlock->groundImpactShakeFreq );
VectorF shakeAmp = mDataBlock->groundImpactShakeAmp * ampScale;
groundImpactShake->setAmplitude( shakeAmp );
groundImpactShake->setFalloff( mDataBlock->groundImpactShakeFalloff );
groundImpactShake->init();
gCamFXMgr.addFX( groundImpactShake );
}
if ( bd > mDataBlock->minImpactSpeed && !mMountPending )
{
if ( !isGhost() )
onImpact( collision->object, collision->normal * bd );
if (mDamageState == Enabled && mState != RecoverState)
{
// Scale how long we're down for
F32 value = (bd - mDataBlock->minImpactSpeed);
F32 range = (mDataBlock->minImpactSpeed * 0.9f);
U32 recover = mDataBlock->recoverDelay;
if (value < range)
recover = 1 + S32(mFloor( F32(recover) * value / range) );
//Con::printf("Used %d recover ticks", recover);
//Con::printf(" minImpact = %g, this one = %g", mDataBlock->minImpactSpeed, bd);
setState(RecoverState, recover);
}
}
if ( isServerObject() && bd > (mDataBlock->minImpactSpeed / 3.0f) )
{
mImpactSound = PlayerData::ImpactNormal;
setMaskBits(ImpactMask);
}Then go a few lines ahead and find the bd redefenition,put it in a comment:
// F32 bd = -mDot( mVelocity, collision->normal );
Then go to player.cs and use a lower value for landing:
minImpactSpeed = 10;
#8
Well done. That seems like a good fix.
*koff* guys ... trunk
Edit 11Feb2010:
You also need to turn player.cs "drag" down from 1.3 or they cause too much friction in the air and slow down too much. Even inverted numbers are okay but not over -.25 or they just keep speeding up and bouncing off things.
11/14/2009 (9:37 pm)
@Picasso/IvanWell done. That seems like a good fix.
*koff* guys ... trunk
Edit 11Feb2010:
You also need to turn player.cs "drag" down from 1.3 or they cause too much friction in the air and slow down too much. Even inverted numbers are okay but not over -.25 or they just keep speeding up and bouncing off things.
#11
06/10/2010 (1:09 pm)
Logged TQA-336
Associate Steve Acaster
[YorkshireRifles.com]