mirror of
https://github.com/DarkflameUniverse/DarkflameServer
synced 2024-08-30 18:43:58 +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