1
This commit is contained in:
35
mdlobjects/dmeblankbodypart.cpp
Normal file
35
mdlobjects/dmeblankbodypart.cpp
Normal file
@ -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()
|
||||
{
|
||||
}
|
51
mdlobjects/dmebodygroup.cpp
Normal file
51
mdlobjects/dmebodygroup.cpp
Normal file
@ -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;
|
||||
}
|
77
mdlobjects/dmebodygrouplist.cpp
Normal file
77
mdlobjects/dmebodygrouplist.cpp
Normal file
@ -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;
|
||||
}
|
35
mdlobjects/dmebodypart.cpp
Normal file
35
mdlobjects/dmebodypart.cpp
Normal file
@ -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()
|
||||
{
|
||||
}
|
163
mdlobjects/dmeboneflexdriver.cpp
Normal file
163
mdlobjects/dmeboneflexdriver.cpp
Normal file
@ -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;
|
||||
}
|
38
mdlobjects/dmebonemask.cpp
Normal file
38
mdlobjects/dmebonemask.cpp
Normal file
@ -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()
|
||||
{
|
||||
}
|
37
mdlobjects/dmebonemasklist.cpp
Normal file
37
mdlobjects/dmebonemasklist.cpp
Normal file
@ -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()
|
||||
{
|
||||
}
|
36
mdlobjects/dmeboneweight.cpp
Normal file
36
mdlobjects/dmeboneweight.cpp
Normal file
@ -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()
|
||||
{
|
||||
}
|
47
mdlobjects/dmecollisionmodel.cpp
Normal file
47
mdlobjects/dmecollisionmodel.cpp
Normal file
@ -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()
|
||||
{
|
||||
}
|
49
mdlobjects/dmehitbox.cpp
Normal file
49
mdlobjects/dmehitbox.cpp
Normal file
@ -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 );
|
||||
}
|
||||
|
32
mdlobjects/dmehitboxset.cpp
Normal file
32
mdlobjects/dmehitboxset.cpp
Normal file
@ -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()
|
||||
{
|
||||
}
|
||||
|
||||
|
38
mdlobjects/dmelod.cpp
Normal file
38
mdlobjects/dmelod.cpp
Normal file
@ -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()
|
||||
{
|
||||
}
|
81
mdlobjects/dmelodlist.cpp
Normal file
81
mdlobjects/dmelodlist.cpp
Normal file
@ -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;
|
||||
}
|
36
mdlobjects/dmemdllist.cpp
Normal file
36
mdlobjects/dmemdllist.cpp
Normal file
@ -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()
|
||||
{
|
||||
}
|
||||
|
40
mdlobjects/dmesequence.cpp
Normal file
40
mdlobjects/dmesequence.cpp
Normal file
@ -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()
|
||||
{
|
||||
}
|
37
mdlobjects/dmesequencelist.cpp
Normal file
37
mdlobjects/dmesequencelist.cpp
Normal file
@ -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()
|
||||
{
|
||||
}
|
68
mdlobjects/mdlobjects.vpc
Normal file
68
mdlobjects/mdlobjects.vpc
Normal file
@ -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"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user