{
case ENone:
case ESprite:
{
//impossible to happen
throw new IllegalFormatCodePointException( 0 );
}
case EDoorSlideLeft:
{
slideAsDoor( true, true );
break;
}
case EDoorSlideRight:
{
slideAsDoor( true, false );
break;
}
case EDoorSwingClockwise:
{
swingAsDoor( true, false );
break;
}
case EDoorSwingCounterClockwise:
{
swingAsDoor( true, true );
break;
}
case EElevatorUp:
{
moveAsElevator( true );
break;
}
case EElevatorDown:
{
moveAsElevator( false );
break;
}
case EDoorHatch:
{
//rotate mesh
float angle = DoorSettings.DOOR_ANGLE_OPEN / DoorSettings.DOOR_TICKS_OPEN_CLOSE;
float rotX = LibMath.cosDeg( iStartupRotZ - 90.0f ) * angle;
float rotY = LibMath.sinDeg( iStartupRotZ - 90.0f ) * angle;
translateAndRotateXYZ
(
0.0f,
0.0f,
0.0f,
rotX * iDoorAnimation,
rotY * iDoorAnimation,
0.0f,
getAnchor(),
LibTransformationMode.EOriginalsToTransformed
);
//rotate mesh's bullet holes
BulletHole.rotateForWall( this, rotX, rotY, 0.0f );
break;
}
}
//check if door is open now
if ( iDoorAnimation == DoorSettings.DOOR_TICKS_OPEN_CLOSE )
{
toggleDoorTopNextTick = true;
//lock the door automatically after countdown
if ( iAutoLock )
{
iDoorLockedCountdown = iAutoLockDelay;
}
}
}
}
else
{
//close the door
if ( iDoorAnimation > 0 )
{
//decrease animation counter
--iDoorAnimation;
//disable auto lock
iDoorLockedCountdown = -1;
//translate mesh
switch ( iWallAction )
{
case ENone:
case ESprite:
{
//impossible to happen
throw new IllegalFormatCodePointException( 0 );
}
case EDoorSlideLeft:
{
slideAsDoor( false, true );