mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-26 07:27:18 +00:00
ModelBehaviorComponent pass
This commit is contained in:
parent
001f6a75eb
commit
5301346ed5
@ -3,7 +3,7 @@
|
||||
#include "ePhysicsBehaviorType.h"
|
||||
|
||||
ModelBehaviorComponent::ModelBehaviorComponent(Entity* parent) : Component(parent) {
|
||||
m_DirtyModelInfo = false;
|
||||
m_DirtyModelInfo = true;
|
||||
m_IsPickable = false;
|
||||
m_PhysicsType = ePhysicsBehaviorType::STANDARD;
|
||||
m_OriginalPosition = m_ParentEntity->GetDefaultPosition();
|
||||
@ -17,7 +17,7 @@ void ModelBehaviorComponent::Serialize(RakNet::BitStream* outBitStream, bool bIs
|
||||
outBitStream->Write(m_PhysicsType);
|
||||
outBitStream->Write(m_OriginalPosition);
|
||||
outBitStream->Write(m_OriginalRotation);
|
||||
m_DirtyModelInfo = false;
|
||||
if (!bIsInitialUpdate) m_DirtyModelInfo = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,11 @@ public:
|
||||
* Sets the original position of the model
|
||||
* @param pos the original position to set
|
||||
*/
|
||||
void SetPosition(const NiPoint3& pos) { m_OriginalPosition = pos; m_DirtyModelInfo = true; }
|
||||
void SetPosition(const NiPoint3& pos) {
|
||||
if (m_OriginalPosition == pos) return;
|
||||
m_OriginalPosition = pos;
|
||||
m_DirtyModelInfo = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the original rotation of the model
|
||||
@ -42,7 +46,11 @@ public:
|
||||
* Sets the original rotation of the model
|
||||
* @param rot the original rotation to set
|
||||
*/
|
||||
void SetRotation(const NiQuaternion& rot) { m_OriginalRotation = rot; m_DirtyModelInfo = true; }
|
||||
void SetRotation(const NiQuaternion& rot) {
|
||||
if (m_OriginalRotation == rot) return;
|
||||
m_OriginalRotation = rot;
|
||||
m_DirtyModelInfo = true;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user