mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 05:27:19 +00:00
use z axis
This commit is contained in:
parent
dffcbcd4d4
commit
930735860b
@ -19,8 +19,8 @@ void ChangeOrientationBehavior::Calculate(BehaviorContext* context, RakNet::BitS
|
||||
NiQuaternion::LookAt(sourceEntity->GetPosition(), destinationEntity->GetPosition())
|
||||
);
|
||||
} else if (this->m_toAngle){
|
||||
auto baseAngle = NiPoint3(this->m_angle, 0, 0);
|
||||
if (this->m_relative) baseAngle += sourceEntity->GetRotation().GetEulerAngles();
|
||||
auto baseAngle = NiPoint3(0, 0, this->m_angle);
|
||||
if (this->m_relative) baseAngle += sourceEntity->GetRotation().GetForwardVector();
|
||||
sourceEntity->SetRotation(NiQuaternion::FromEulerAngles(baseAngle));
|
||||
} else return;
|
||||
EntityManager::Instance()->SerializeEntity(sourceEntity);
|
||||
|
Loading…
Reference in New Issue
Block a user