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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class cStairs // tolua_export
|
|
|
|
{ // tolua_export
|
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
|
|
|
|
static NIBBLETYPE RotationToMetaData(float a_Rotation) // tolua_export
|
|
|
|
{ // tolua_export
|
2012-06-14 09:06:06 -04:00
|
|
|
a_Rotation += 90 + 45; // So its not aligned with axis
|
2012-10-20 16:16:55 -04:00
|
|
|
NIBBLETYPE result = 0x0;
|
|
|
|
if (a_Rotation > 360.f)
|
|
|
|
{
|
|
|
|
a_Rotation -= 360.f;
|
|
|
|
}
|
|
|
|
if ((a_Rotation >= 0.f) && (a_Rotation < 90.f))
|
|
|
|
{
|
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-01-11 23:46:01 -05:00
|
|
|
} // tolua_export
|
|
|
|
} ; // tolua_export
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-06-14 09:06:06 -04:00
|
|
|
|