//===========================================================================// // 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; }