Files
firestorm/Gameleap/code/mw4/Libraries/Adept/EntityAttribute.cpp
T
Cyd 2b8ca921cb Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS
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.
2026-06-24 21:28:16 -05:00

84 lines
2.5 KiB
C++

//===========================================================================//
// File: EntityAttribute.hpp //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 08/25/97 JMA Infrastructure changes //
// 08/25/97 ECH Infrastructure changes //
//---------------------------------------------------------------------------//
// Copyright (C) 1994-97, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#include "AdeptHeaders.hpp"
#include "EntityAttribute.hpp"
//#############################################################################
//##################### LocalToWorldAttributeEntry ######################
//#############################################################################
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
LocalToWorldAttributeEntry::LocalToWorldAttributeEntry(
Entity::AttributeID attribute_ID,
const char *attribute_name
):
AttributeEntry(
attribute_ID,
attribute_name,
LinearMatrix4DClassID,
NULL
)
{
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
LocalToWorldAttributeEntry::~LocalToWorldAttributeEntry()
{
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void
LocalToWorldAttributeEntry::GetValue(
Entity *entity,
void *new_value
)
{
Check_Object(entity);
Check_Pointer(new_value);
*Cast_Pointer(LinearMatrix4D*, new_value) = entity->GetLocalToWorld();
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
bool
LocalToWorldAttributeEntry::GetChangedValue(
Entity *entity,
void *new_value,
void *current_value,
Scalar diff_threshold
)
{
Check_Object(entity);
Check_Pointer(new_value);
Check_Pointer(current_value);
if (
!Close_Enough(
entity->GetLocalToWorld(),
*Cast_Pointer(LinearMatrix4D*, current_value),
diff_threshold
)
)
{
*Cast_Pointer(LinearMatrix4D*, new_value) =
entity->GetLocalToWorld();
return true;
}
return false;
}