Complete disaster-recovery snapshot: engine/game source, game data assets, VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive. Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false, no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
60 lines
1.4 KiB
C++
60 lines
1.4 KiB
C++
#include "AdeptHeaders.hpp"
|
|
|
|
#include "Site.hpp"
|
|
#include "Entity.hpp"
|
|
|
|
//#############################################################################
|
|
//############################ Site #####################################
|
|
//#############################################################################
|
|
|
|
Site::Site(const LinearMatrix4D& local_to_parent, Entity *parent, const MString& site_name) :
|
|
Plug(Plug::DefaultData),
|
|
m_localToParent(local_to_parent),
|
|
m_name(site_name)
|
|
{
|
|
Check_Pointer(parent);
|
|
|
|
m_parent = parent;
|
|
}
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
//
|
|
Site::~Site()
|
|
{
|
|
DESTRUCTOR("Site");
|
|
}
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
//
|
|
void
|
|
Site::SaveToStream(MemoryStream *stream)
|
|
{
|
|
Check_Object(this);
|
|
Check_Pointer(stream);
|
|
|
|
YawPitchRoll rotation;
|
|
Point3D translation;
|
|
|
|
rotation = m_localToParent;
|
|
translation = m_localToParent;
|
|
|
|
*stream << rotation;
|
|
*stream << translation;
|
|
*stream << m_name;
|
|
}
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
//
|
|
LinearMatrix4D
|
|
Site::GetLocalToWorld()
|
|
{
|
|
Check_Object(this);
|
|
Check_Object(m_parent);
|
|
|
|
LinearMatrix4D local_to_world;
|
|
LinearMatrix4D parent_to_world = m_parent->GetLocalToWorld();
|
|
|
|
local_to_world.Multiply(m_localToParent, parent_to_world);
|
|
|
|
return local_to_world;
|
|
} |