2013-01-11 23:46:01 -05:00
|
|
|
|
2012-06-14 09:06:06 -04:00
|
|
|
#pragma once
|
|
|
|
|
2013-01-11 23:46:01 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-03-09 09:35:43 -05:00
|
|
|
// tolua_begin
|
|
|
|
|
|
|
|
class cStairs
|
|
|
|
{
|
2012-06-14 09:06:06 -04:00
|
|
|
public:
|
2013-01-11 23:46:01 -05:00
|
|
|
/// Converts player rotation to stair rotation metadata. To get upside-down stairs, OR with 0x4
|
2013-03-09 09:35:43 -05:00
|
|
|
static NIBBLETYPE RotationToMetaData(double a_Rotation)
|
|
|
|
{
|
|
|
|
a_Rotation += 90 + 45; // So its not aligned with axis
|
|
|
|
NIBBLETYPE result = 0x0;
|
|
|
|
if (a_Rotation > 360)
|
2012-10-20 16:16:55 -04:00
|
|
|
{
|
2013-03-09 09:35:43 -05:00
|
|
|
a_Rotation -= 360;
|
2012-10-20 16:16:55 -04:00
|
|
|
}
|
2013-03-09 09:35:43 -05:00
|
|
|
if ((a_Rotation >= 0) && (a_Rotation < 90))
|
2012-10-20 16:16:55 -04:00
|
|
|
{
|
2013-01-11 23:46:01 -05:00
|
|
|
return 0x0;
|
2012-10-20 16:16:55 -04:00
|
|
|
}
|
|
|
|
else if ((a_Rotation >= 180) && (a_Rotation < 270))
|
|
|
|
{
|
2013-01-11 23:46:01 -05:00
|
|
|
return 0x1;
|
2012-10-20 16:16:55 -04:00
|
|
|
}
|
|
|
|
else if ((a_Rotation >= 90) && (a_Rotation < 180))
|
|
|
|
{
|
2013-01-11 23:46:01 -05:00
|
|
|
return 0x2;
|
2012-10-20 16:16:55 -04:00
|
|
|
}
|
2012-06-14 09:06:06 -04:00
|
|
|
else
|
2012-10-20 16:16:55 -04:00
|
|
|
{
|
2013-01-11 23:46:01 -05:00
|
|
|
return 0x3;
|
2012-10-20 16:16:55 -04:00
|
|
|
}
|
2013-03-09 09:35:43 -05:00
|
|
|
}
|
|
|
|
} ;
|
2013-01-11 23:46:01 -05:00
|
|
|
|
2013-03-09 09:35:43 -05:00
|
|
|
// tolua_end
|
2013-01-11 23:46:01 -05:00
|
|
|
|
|
|
|
|
2012-06-14 09:06:06 -04:00
|
|
|
|