cEntity: Added mass to entities.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1430 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
@@ -33,6 +33,7 @@ cEntity::cEntity(eEntityType a_EntityType, double a_X, double a_Y, double a_Z)
|
||||
, m_HeadYaw( 0.0 )
|
||||
, m_Rot(0.0, 0.0, 0.0)
|
||||
, m_Pos(a_X, a_Y, a_Z)
|
||||
, m_Mass (0.001) //Default 1g
|
||||
, m_bDirtyHead(true)
|
||||
, m_bDirtyOrientation(true)
|
||||
, m_bDirtyPosition(true)
|
||||
@@ -506,6 +507,25 @@ void cEntity::SetHeadYaw(double a_HeadYaw)
|
||||
|
||||
|
||||
|
||||
void cEntity::SetMass(double a_Mass)
|
||||
{
|
||||
if (a_Mass > 0)
|
||||
{
|
||||
m_Mass = a_Mass;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Make sure that mass is not zero. 1g is the default because we
|
||||
//have to choose a number. It's perfectly legal to have a mass
|
||||
//less than 1g as long as is NOT equal or less than zero.
|
||||
m_Mass = 0.001;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cEntity::SetRotation(double a_Rotation)
|
||||
{
|
||||
m_Rot.x = a_Rotation;
|
||||
|
||||
Reference in New Issue
Block a user