diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /mdlobjects | |
| download | archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.tar.xz archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.zip | |
Diffstat (limited to 'mdlobjects')
| -rw-r--r-- | mdlobjects/dmeblankbodypart.cpp | 35 | ||||
| -rw-r--r-- | mdlobjects/dmebodygroup.cpp | 51 | ||||
| -rw-r--r-- | mdlobjects/dmebodygrouplist.cpp | 77 | ||||
| -rw-r--r-- | mdlobjects/dmebodypart.cpp | 35 | ||||
| -rw-r--r-- | mdlobjects/dmeboneflexdriver.cpp | 163 | ||||
| -rw-r--r-- | mdlobjects/dmebonemask.cpp | 38 | ||||
| -rw-r--r-- | mdlobjects/dmebonemasklist.cpp | 37 | ||||
| -rw-r--r-- | mdlobjects/dmeboneweight.cpp | 36 | ||||
| -rw-r--r-- | mdlobjects/dmecollisionmodel.cpp | 47 | ||||
| -rw-r--r-- | mdlobjects/dmehitbox.cpp | 49 | ||||
| -rw-r--r-- | mdlobjects/dmehitboxset.cpp | 32 | ||||
| -rw-r--r-- | mdlobjects/dmelod.cpp | 38 | ||||
| -rw-r--r-- | mdlobjects/dmelodlist.cpp | 81 | ||||
| -rw-r--r-- | mdlobjects/dmemdllist.cpp | 36 | ||||
| -rw-r--r-- | mdlobjects/dmesequence.cpp | 40 | ||||
| -rw-r--r-- | mdlobjects/dmesequencelist.cpp | 37 | ||||
| -rw-r--r-- | mdlobjects/mdlobjects.vpc | 68 |
17 files changed, 900 insertions, 0 deletions
diff --git a/mdlobjects/dmeblankbodypart.cpp b/mdlobjects/dmeblankbodypart.cpp new file mode 100644 index 0000000..0f5a5ec --- /dev/null +++ b/mdlobjects/dmeblankbodypart.cpp @@ -0,0 +1,35 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Dme blank/empty body part base class +// +//===========================================================================// + + +#include "datamodel/dmelementfactoryhelper.h" +#include "mdlobjects/dmeblankbodypart.h" + + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + + +//----------------------------------------------------------------------------- +// Expose this class to the scene database +//----------------------------------------------------------------------------- +IMPLEMENT_ELEMENT_FACTORY( DmeBlankBodyPart, CDmeBlankBodyPart ); + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeBlankBodyPart::OnConstruction() +{ +} + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeBlankBodyPart::OnDestruction() +{ +}
\ No newline at end of file diff --git a/mdlobjects/dmebodygroup.cpp b/mdlobjects/dmebodygroup.cpp new file mode 100644 index 0000000..d05f453 --- /dev/null +++ b/mdlobjects/dmebodygroup.cpp @@ -0,0 +1,51 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Dme version of a body group +// +//===========================================================================// + +#include "mdlobjects/dmebodygroup.h" +#include "datamodel/dmelementfactoryhelper.h" +#include "mdlobjects/dmelodlist.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + + +//----------------------------------------------------------------------------- +// Expose this class to the scene database +//----------------------------------------------------------------------------- +IMPLEMENT_ELEMENT_FACTORY( DmeBodyGroup, CDmeBodyGroup ); + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CDmeBodyGroup::OnConstruction() +{ + m_BodyParts.Init( this, "bodyParts" ); +} + +void CDmeBodyGroup::OnDestruction() +{ +} + + +//----------------------------------------------------------------------------- +// Finds a body part by name +//----------------------------------------------------------------------------- +CDmeLODList *CDmeBodyGroup::FindBodyPart( const char *pName ) +{ + int nCount = m_BodyParts.Count(); + for ( int i = 0; i < nCount; ++i ) + { + CDmeLODList *pLODList = CastElement< CDmeLODList >( m_BodyParts[ i ] ); + if ( !pLODList ) + continue; + + if ( !Q_stricmp( pName, pLODList->GetName() ) ) + return pLODList; + } + + return NULL; +} diff --git a/mdlobjects/dmebodygrouplist.cpp b/mdlobjects/dmebodygrouplist.cpp new file mode 100644 index 0000000..ff1aa50 --- /dev/null +++ b/mdlobjects/dmebodygrouplist.cpp @@ -0,0 +1,77 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Dme version of a body group list +// +//===========================================================================// + +#include "mdlobjects/dmebodygrouplist.h" +#include "datamodel/dmelementfactoryhelper.h" +#include "mdlobjects/dmebodygroup.h" +#include "mdlobjects/dmelodlist.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + + +//----------------------------------------------------------------------------- +// Expose this class to the scene database +//----------------------------------------------------------------------------- +IMPLEMENT_ELEMENT_FACTORY( DmeBodyGroupList, CDmeBodyGroupList ); + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CDmeBodyGroupList::OnConstruction() +{ + m_BodyGroups.Init( this, "bodyGroups" ); +} + +void CDmeBodyGroupList::OnDestruction() +{ +} + + +//----------------------------------------------------------------------------- +// Finds a body group by name +//----------------------------------------------------------------------------- +CDmeBodyGroup *CDmeBodyGroupList::FindBodyGroup( const char *pName ) +{ + int nCount = m_BodyGroups.Count(); + for ( int i = 0; i < nCount; ++i ) + { + if ( !Q_stricmp( pName, m_BodyGroups[i]->GetName() ) ) + return m_BodyGroups[i]; + } + return NULL; +} + + +//----------------------------------------------------------------------------- +// Gets the 'main' body part (used for compilation) +//----------------------------------------------------------------------------- +CDmeLODList *CDmeBodyGroupList::GetMainBodyPart() +{ + if ( m_BodyGroups.Count() == 0 ) + return NULL; + + CDmeBodyGroup *pMainBodyGroup = FindBodyGroup( "default" ); + if ( !pMainBodyGroup ) + { + pMainBodyGroup = m_BodyGroups[0]; + } + + CDmeLODList *pLODList = CastElement< CDmeLODList >( pMainBodyGroup->FindBodyPart( "default" ) ); + if ( pLODList ) + return pLODList; + + const int nBodypartCount = pMainBodyGroup->m_BodyParts.Count(); + for ( int i = 0; i < nBodypartCount; ++i ) + { + pLODList = CastElement< CDmeLODList >( pMainBodyGroup->m_BodyParts[ i ] ); + if ( pLODList && pLODList->m_LODs.Count() > 0 ) + return pLODList; + } + + return NULL; +} diff --git a/mdlobjects/dmebodypart.cpp b/mdlobjects/dmebodypart.cpp new file mode 100644 index 0000000..b932554 --- /dev/null +++ b/mdlobjects/dmebodypart.cpp @@ -0,0 +1,35 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Dme body part base class +// +//===========================================================================// + + +#include "datamodel/dmelementfactoryhelper.h" +#include "mdlobjects/dmebodypart.h" + + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + + +//----------------------------------------------------------------------------- +// Expose this class to the scene database +//----------------------------------------------------------------------------- +IMPLEMENT_ELEMENT_FACTORY( DmeBodyPart, CDmeBodyPart ); + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeBodyPart::OnConstruction() +{ +} + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeBodyPart::OnDestruction() +{ +}
\ No newline at end of file diff --git a/mdlobjects/dmeboneflexdriver.cpp b/mdlobjects/dmeboneflexdriver.cpp new file mode 100644 index 0000000..c494306 --- /dev/null +++ b/mdlobjects/dmeboneflexdriver.cpp @@ -0,0 +1,163 @@ +//===== Copyright (c) 1996-2009, Valve Corporation, All rights reserved. ==== +// +// Dme version of QC $BoneFlexDriver +// +//===========================================================================// + + +// Valve includes +#include "datamodel/dmelementfactoryhelper.h" +#include "mdlobjects/dmeBoneFlexDriver.h" + + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + + +//===========================================================================// +// CDmeBoneFlexDriverControl +//===========================================================================// +//----------------------------------------------------------------------------- +// Expose this class to the scene database +//----------------------------------------------------------------------------- +IMPLEMENT_ELEMENT_FACTORY( DmeBoneFlexDriverControl, CDmeBoneFlexDriverControl ); + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeBoneFlexDriverControl::OnConstruction() +{ + m_sFlexControllerName.Init( this, "flexControllerName" ); + m_nBoneComponent.Init( this, "boneComponent" ); + m_flMin.InitAndSet( this, "min", 0.0f ); + m_flMax.InitAndSet( this, "max", 1.0f ); +} + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeBoneFlexDriverControl::OnDestruction() +{ +} + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +int CDmeBoneFlexDriverControl::SetBoneComponent( int nBoneComponent ) +{ + // Range [STUDIO_BONE_FLEX_TX, STUDIO_BONE_FLEX_RZ] + m_nBoneComponent = clamp( nBoneComponent, 0, 5 ); + return m_nBoneComponent.Get(); +} + + +//===========================================================================// +// CDmeBoneFlexDriver +//===========================================================================// +//----------------------------------------------------------------------------- +// Expose this class to the scene database +//----------------------------------------------------------------------------- +IMPLEMENT_ELEMENT_FACTORY( DmeBoneFlexDriver, CDmeBoneFlexDriver ); + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeBoneFlexDriver::OnConstruction() +{ + m_sBoneName.Init( this, "boneName" ); + m_eControlList.Init( this, "controlList" ); +} + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeBoneFlexDriver::OnDestruction() +{ +} + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +CDmeBoneFlexDriverControl *CDmeBoneFlexDriver::FindOrCreateControl( const char *pszControlName ) +{ + CDmeBoneFlexDriverControl *pDmeBoneFlexDriverControl = NULL; + + for ( int i = 0; i < m_eControlList.Count(); ++i ) + { + pDmeBoneFlexDriverControl = m_eControlList[i]; + if ( !pDmeBoneFlexDriverControl ) + continue; + + if ( !Q_stricmp( pszControlName, pDmeBoneFlexDriverControl->m_sFlexControllerName.Get() ) ) + return pDmeBoneFlexDriverControl; + } + + pDmeBoneFlexDriverControl = CreateElement< CDmeBoneFlexDriverControl >( "", GetFileId() ); // Nameless + if ( !pDmeBoneFlexDriverControl ) + return NULL; + + pDmeBoneFlexDriverControl->m_sFlexControllerName = pszControlName; + m_eControlList.AddToTail( pDmeBoneFlexDriverControl ); + + return pDmeBoneFlexDriverControl; +} + + +//===========================================================================// +// CDmeBoneFlexDriverList +//===========================================================================// +//----------------------------------------------------------------------------- +// Expose this class to the scene database +//----------------------------------------------------------------------------- +IMPLEMENT_ELEMENT_FACTORY( DmeBoneFlexDriverList, CDmeBoneFlexDriverList ); + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeBoneFlexDriverList::OnConstruction() +{ + m_eBoneFlexDriverList.Init( this, "boneFlexDriverList" ); +} + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeBoneFlexDriverList::OnDestruction() +{ +} + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +CDmeBoneFlexDriver *CDmeBoneFlexDriverList::FindOrCreateBoneFlexDriver( const char *pszBoneName ) +{ + CDmeBoneFlexDriver *pDmeBoneFlexDriver = NULL; + + for ( int i = 0; i < m_eBoneFlexDriverList.Count(); ++i ) + { + pDmeBoneFlexDriver = m_eBoneFlexDriverList[i]; + if ( !pDmeBoneFlexDriver ) + continue; + + if ( !Q_stricmp( pszBoneName, pDmeBoneFlexDriver->m_sBoneName.Get() ) ) + return pDmeBoneFlexDriver; + } + + pDmeBoneFlexDriver = CreateElement< CDmeBoneFlexDriver >( "", GetFileId() ); // Nameless + if ( !pDmeBoneFlexDriver ) + return NULL; + + pDmeBoneFlexDriver->m_sBoneName = pszBoneName; + m_eBoneFlexDriverList.AddToTail( pDmeBoneFlexDriver ); + + return pDmeBoneFlexDriver; +} diff --git a/mdlobjects/dmebonemask.cpp b/mdlobjects/dmebonemask.cpp new file mode 100644 index 0000000..5a8bd59 --- /dev/null +++ b/mdlobjects/dmebonemask.cpp @@ -0,0 +1,38 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// A list of DmeBoneWeight elements, replacing QC's $WeightList +// +//===========================================================================// + + +#include "datamodel/dmelementfactoryhelper.h" +#include "mdlobjects/dmeboneweight.h" +#include "mdlobjects/dmebonemask.h" + + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + + +//----------------------------------------------------------------------------- +// Expose this class to the scene database +//----------------------------------------------------------------------------- +IMPLEMENT_ELEMENT_FACTORY( DmeBoneMask, CDmeBoneMask ); + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeBoneMask::OnConstruction() +{ + m_BoneWeights.Init( this, "boneWeights" ); + m_bDefault.InitAndSet( this, "default", false ); +} + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeBoneMask::OnDestruction() +{ +}
\ No newline at end of file diff --git a/mdlobjects/dmebonemasklist.cpp b/mdlobjects/dmebonemasklist.cpp new file mode 100644 index 0000000..f03c198 --- /dev/null +++ b/mdlobjects/dmebonemasklist.cpp @@ -0,0 +1,37 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// A list of DmeBoneWeight elements, replacing QC's $WeightList +// +//===========================================================================// + + +#include "datamodel/dmelementfactoryhelper.h" +#include "mdlobjects/dmebonemask.h" +#include "mdlobjects/dmebonemasklist.h" + + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + + +//----------------------------------------------------------------------------- +// Expose this class to the scene database +//----------------------------------------------------------------------------- +IMPLEMENT_ELEMENT_FACTORY( DmeBoneMaskList, CDmeBoneMaskList ); + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeBoneMaskList::OnConstruction() +{ + m_BoneMasks.Init( this, "boneMasks" ); +} + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeBoneMaskList::OnDestruction() +{ +}
\ No newline at end of file diff --git a/mdlobjects/dmeboneweight.cpp b/mdlobjects/dmeboneweight.cpp new file mode 100644 index 0000000..45ce7c8 --- /dev/null +++ b/mdlobjects/dmeboneweight.cpp @@ -0,0 +1,36 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Dme version of a bone weight as in QC $WeightList +// +//===========================================================================// + + +#include "datamodel/dmelementfactoryhelper.h" +#include "mdlobjects/dmeboneweight.h" + + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + + +//----------------------------------------------------------------------------- +// Expose this class to the scene database +//----------------------------------------------------------------------------- +IMPLEMENT_ELEMENT_FACTORY( DmeBoneWeight, CDmeBoneWeight ); + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeBoneWeight::OnConstruction() +{ + m_flWeight.Init( this, "weight" ); +} + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeBoneWeight::OnDestruction() +{ +}
\ No newline at end of file diff --git a/mdlobjects/dmecollisionmodel.cpp b/mdlobjects/dmecollisionmodel.cpp new file mode 100644 index 0000000..5ef3213 --- /dev/null +++ b/mdlobjects/dmecollisionmodel.cpp @@ -0,0 +1,47 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Dme version of a collisionmodel +// +//===========================================================================// + +#include "mdlobjects/dmecollisionmodel.h" +#include "datamodel/dmelementfactoryhelper.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + + +//----------------------------------------------------------------------------- +// Expose this class to the scene database +//----------------------------------------------------------------------------- +IMPLEMENT_ELEMENT_FACTORY( DmeCollisionModel, CDmeCollisionModel ); + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CDmeCollisionModel::OnConstruction() +{ + m_flMass.Init( this, "mass" ); + m_bAutomaticMassComputation.Init( this, "automaticMassComputation" ); + m_flInertia.Init( this, "inertia" ); + m_flDamping.Init( this, "damping" ); + m_flRotationalDamping.Init( this, "rotationalDamping" ); + m_flDrag.Init( this, "drag" ); + m_flRollingDrag.Init( this, "rollingDrag" ); + m_nMaxConvexPieces.Init( this, "maxConvexPieces" ); + m_bRemove2D.Init( this, "remove2d" ); + m_bConcavePerJoint.Init( this, "concavePerJoint" ); + m_flWeldPositionTolerance.Init( this, "weldPositionTolerance" ); + m_flWeldNormalTolerance.Init( this, "weldNormalTolerance" ); + m_bConcave.Init( this, "concave" ); + m_bForceMassCenter.Init( this, "forceMassCenter" ); + m_vecMassCenter.Init( this, "massCenter" ); + m_bNoSelfCollisions.Init( this, "noSelfCollisions" ); + m_bAssumeWorldSpace.Init( this, "assumeWorldSpace" ); + m_SurfaceProperty.InitAndSet( this, "surfaceProperty", "default" ); +} + +void CDmeCollisionModel::OnDestruction() +{ +}
\ No newline at end of file diff --git a/mdlobjects/dmehitbox.cpp b/mdlobjects/dmehitbox.cpp new file mode 100644 index 0000000..cabc504 --- /dev/null +++ b/mdlobjects/dmehitbox.cpp @@ -0,0 +1,49 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Dme version of a hitbox +// +//===========================================================================// + +#include "mdlobjects/dmehitbox.h" +#include "datamodel/dmelementfactoryhelper.h" +#include "tier2/renderutils.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + + +//----------------------------------------------------------------------------- +// Expose this class to the scene database +//----------------------------------------------------------------------------- +IMPLEMENT_ELEMENT_FACTORY( DmeHitbox, CDmeHitbox ); + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CDmeHitbox::OnConstruction() +{ + m_SurfaceProperty.Init( this, "surfaceProperty" ); + m_Group.Init( this, "groupName" ); + m_Bone.Init( this, "boneName" ); + m_vecMins.Init( this, "minBounds" ); + m_vecMaxs.Init( this, "maxBounds" ); + m_RenderColor.InitAndSet( this, "renderColor", Color( 255, 255, 255, 64 ) ); +} + +void CDmeHitbox::OnDestruction() +{ +} + + +//----------------------------------------------------------------------------- +// Rendering method for the dag +//----------------------------------------------------------------------------- +void CDmeHitbox::Draw( const matrix3x4_t &shapeToWorld, CDmeDrawSettings *pDrawSettings /* = NULL */ ) +{ + Vector vecOrigin; + QAngle angles; + MatrixAngles( shapeToWorld, angles, vecOrigin ); + RenderBox( vecOrigin, angles, m_vecMins, m_vecMaxs, m_RenderColor, true ); +} + diff --git a/mdlobjects/dmehitboxset.cpp b/mdlobjects/dmehitboxset.cpp new file mode 100644 index 0000000..73e77d5 --- /dev/null +++ b/mdlobjects/dmehitboxset.cpp @@ -0,0 +1,32 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Dme version of a hitbox set +// +//===========================================================================// + +#include "mdlobjects/dmehitboxset.h" +#include "datamodel/dmelementfactoryhelper.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + + +//----------------------------------------------------------------------------- +// Expose this class to the scene database +//----------------------------------------------------------------------------- +IMPLEMENT_ELEMENT_FACTORY( DmeHitboxSet, CDmeHitboxSet ); + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CDmeHitboxSet::OnConstruction() +{ + m_Hitboxes.Init( this, "hitboxes" ); +} + +void CDmeHitboxSet::OnDestruction() +{ +} + + diff --git a/mdlobjects/dmelod.cpp b/mdlobjects/dmelod.cpp new file mode 100644 index 0000000..e7c1c4e --- /dev/null +++ b/mdlobjects/dmelod.cpp @@ -0,0 +1,38 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Dme version of a hitbox +// +//===========================================================================// + +#include "mdlobjects/dmelod.h" +#include "datamodel/dmelementfactoryhelper.h" +#include "movieobjects/dmemodel.h" +#include "movieobjects/dmedag.h" +#include "movieobjects/dmecombinationoperator.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + + +//----------------------------------------------------------------------------- +// Expose this class to the scene database +//----------------------------------------------------------------------------- +IMPLEMENT_ELEMENT_FACTORY( DmeLOD, CDmeLOD ); + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CDmeLOD::OnConstruction() +{ + m_Model.Init( this, "model" ); + m_Skeleton.Init( this, "skeleton" ); + m_CombinationOperator.Init( this, "combinationOperator" ); + m_flSwitchMetric.Init( this, "switchMetric" ); + m_bNoFlex.Init( this, "noFlex" ); + m_bIsShadowLOD.Init( this, "isShadowLOD" ); +} + +void CDmeLOD::OnDestruction() +{ +}
\ No newline at end of file diff --git a/mdlobjects/dmelodlist.cpp b/mdlobjects/dmelodlist.cpp new file mode 100644 index 0000000..6de00f6 --- /dev/null +++ b/mdlobjects/dmelodlist.cpp @@ -0,0 +1,81 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Dme version of a hitbox +// +//===========================================================================// + +#include "mdlobjects/dmelodlist.h" +#include "datamodel/dmelementfactoryhelper.h" +#include "mdlobjects/dmelod.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + + +//----------------------------------------------------------------------------- +// Expose this class to the scene database +//----------------------------------------------------------------------------- +IMPLEMENT_ELEMENT_FACTORY( DmeLODList, CDmeLODList ); + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CDmeLODList::OnConstruction() +{ + m_LODs.Init( this, "lods" ); +} + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeLODList::OnDestruction() +{ +} + + +//----------------------------------------------------------------------------- +// Returns the number of LODs in this body part, can be 0 +//----------------------------------------------------------------------------- +int CDmeLODList::LODCount() const +{ + return m_LODs.Count(); +} + + +//----------------------------------------------------------------------------- +// Returns the root LOD. This is the one with the switch metric 0 +//----------------------------------------------------------------------------- +CDmeLOD* CDmeLODList::GetRootLOD() +{ + int nCount = m_LODs.Count(); + int nMinIndex = -1; + float flMinMetric = FLT_MAX; + for ( int i = 0; i < nCount; ++i ) + { + if ( m_LODs[i]->m_flSwitchMetric < flMinMetric ) + { + nMinIndex = i; + flMinMetric = m_LODs[i]->m_flSwitchMetric; + if ( flMinMetric == 0.0f ) + break; + } + } + return ( nMinIndex >= 0 ) ? m_LODs[nMinIndex] : NULL; +} + + +//----------------------------------------------------------------------------- +// Returns the shadow LOD +//----------------------------------------------------------------------------- +CDmeLOD* CDmeLODList::GetShadowLOD() +{ + int nCount = m_LODs.Count(); + for ( int i = 0; i < nCount; ++i ) + { + if ( m_LODs[i]->m_bIsShadowLOD ) + return m_LODs[i]; + } + return NULL; +} diff --git a/mdlobjects/dmemdllist.cpp b/mdlobjects/dmemdllist.cpp new file mode 100644 index 0000000..d0c4fbc --- /dev/null +++ b/mdlobjects/dmemdllist.cpp @@ -0,0 +1,36 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// A general list element for the MDL pipeline +// +//===========================================================================// + + +#include "datamodel/dmelementfactoryhelper.h" +#include "mdlobjects/dmemdllist.h" + + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + + +//----------------------------------------------------------------------------- +// Expose this class to the scene database +//----------------------------------------------------------------------------- +IMPLEMENT_ELEMENT_FACTORY( DmeMdlList, CDmeMdlList ); + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeMdlList::OnConstruction() +{ +} + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeMdlList::OnDestruction() +{ +} + diff --git a/mdlobjects/dmesequence.cpp b/mdlobjects/dmesequence.cpp new file mode 100644 index 0000000..3d2c01c --- /dev/null +++ b/mdlobjects/dmesequence.cpp @@ -0,0 +1,40 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Dme representation of QC: $sequence +// +//===========================================================================// + + +#include "datamodel/dmelementfactoryhelper.h" +#include "movieobjects/dmeanimationlist.h" +#include "movieobjects/dmechannel.h" +#include "movieobjects/dmedag.h" +#include "mdlobjects/dmesequence.h" + + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + + +//----------------------------------------------------------------------------- +// Expose this class to the scene database +//----------------------------------------------------------------------------- +IMPLEMENT_ELEMENT_FACTORY( DmeSequence, CDmeSequence ); + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeSequence::OnConstruction() +{ + m_Skeleton.Init( this, "skeleton" ); + m_AnimationList.Init( this, "animationList" ); +} + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeSequence::OnDestruction() +{ +}
\ No newline at end of file diff --git a/mdlobjects/dmesequencelist.cpp b/mdlobjects/dmesequencelist.cpp new file mode 100644 index 0000000..25e448d --- /dev/null +++ b/mdlobjects/dmesequencelist.cpp @@ -0,0 +1,37 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// A list of DmeSequences's +// +//===========================================================================// + + +#include "datamodel/dmelementfactoryhelper.h" +#include "mdlobjects/dmesequence.h" +#include "mdlobjects/dmesequencelist.h" + + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + + +//----------------------------------------------------------------------------- +// Expose this class to the scene database +//----------------------------------------------------------------------------- +IMPLEMENT_ELEMENT_FACTORY( DmeSequenceList, CDmeSequenceList ); + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeSequenceList::OnConstruction() +{ + m_Sequences.Init( this, "sequences" ); +} + + +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +void CDmeSequenceList::OnDestruction() +{ +}
\ No newline at end of file diff --git a/mdlobjects/mdlobjects.vpc b/mdlobjects/mdlobjects.vpc new file mode 100644 index 0000000..af90f8f --- /dev/null +++ b/mdlobjects/mdlobjects.vpc @@ -0,0 +1,68 @@ +//----------------------------------------------------------------------------- +// MDLOBJECTS.VPC +// +// Project Script +//----------------------------------------------------------------------------- + +$Macro SRCDIR ".." +$Include "$SRCDIR\vpc_scripts\source_lib_base.vpc" + +$Configuration +{ + $Compiler + { + $PreprocessorDefinitions "$BASE;MDLOBJECTS_LIB" + } +} + +$Project "mdlobjects" +{ + $Folder "Header Files" + { + } + + $Folder "Source Files" + { + $File "dmebodygroup.cpp" + $File "dmebodygrouplist.cpp" + $File "dmecollisionmodel.cpp" + $File "dmehitbox.cpp" + $File "dmehitboxset.cpp" + $File "dmebodypart.cpp" + $File "dmeblankbodypart.cpp" + $File "dmelod.cpp" + $File "dmelodlist.cpp" + $File "dmemdllist.cpp" + $File "dmeboneweight.cpp" + $File "dmebonemask.cpp" + $File "dmebonemasklist.cpp" + $File "dmesequence.cpp" + $File "dmesequencelist.cpp" + $File "dmeboneflexdriver.cpp" + } + + $Folder "Interface" + { + $File "$SRCDIR\public\mdlobjects\dmebodygroup.h" + $File "$SRCDIR\public\mdlobjects\dmebodygrouplist.h" + $File "$SRCDIR\public\mdlobjects\dmecollisionmodel.h" + $File "$SRCDIR\public\mdlobjects\dmehitbox.h" + $File "$SRCDIR\public\mdlobjects\dmehitboxset.h" + $File "$SRCDIR\public\mdlobjects\dmebodypart.h" + $File "$SRCDIR\public\mdlobjects\dmeblankbodypart.h" + $File "$SRCDIR\public\mdlobjects\dmelod.h" + $File "$SRCDIR\public\mdlobjects\dmelodlist.h" + $File "$SRCDIR\public\mdlobjects\dmemdllist.h" + $File "$SRCDIR\public\mdlobjects\dmeboneweight.h" + $File "$SRCDIR\public\mdlobjects\dmebonemask.h" + $File "$SRCDIR\public\mdlobjects\dmebonemasklist.h" + $File "$SRCDIR\public\mdlobjects\dmesequence.h" + $File "$SRCDIR\public\mdlobjects\dmesequencelist.h" + $File "$SRCDIR\public\mdlobjects\mdlobjects.h" + } + + $Folder "external" + { + $File "$SRCDIR\public\mdlobjects\dmeboneflexdriver.h" + } +} |