08-30-2013, 09:37 PM
That worked :D
It broke stuff a little, but it works :DD
So now if I want to negate friction when on a rail, I will just do this in cMinecart::HandlePhysics?
It broke stuff a little, but it works :DD
So now if I want to negate friction when on a rail, I will just do this in cMinecart::HandlePhysics?
Code:
if (
(BlockBelow != E_BLOCK_RAIL) &&
(BlockBelow != E_BLOCK_DETECTOR_RAIL) &&
(BlockBelow != E_BLOCK_POWERED_RAIL) &&
(BlockBelow != E_BLOCK_ACTIVATOR_RAIL)
)
{
//Friction
if (NextSpeed.SqrLength() > 0.0004f)
{
NextSpeed.x *= 0.7f/(1+a_Dt);
if ( fabs(NextSpeed.x) < 0.05 ) NextSpeed.x = 0;
NextSpeed.z *= 0.7f/(1+a_Dt);
if ( fabs(NextSpeed.z) < 0.05 ) NextSpeed.z = 0;
}
}