DMX model: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(initial attempt at the DMX model format)
 
mNo edit summary
Line 33: Line 33:
};
};


// Collection of states
// Collection of states...suspected that there will only be more than one in a vertex animation DMX.
class DMXModel_Shape
class DMXModel_Shape
{
{

Revision as of 07:41, 13 December 2010

Help.png
This article contains speculation that needs to be confirmed.

For sanity's sake, the data structure is expressed in pseudo-C++.

  • Todo: Are names case sensitive?
  • Todo: Are all apparent pointers actually arrays?
class DMXModel
{
	DMXModelData* model;
	// NB: it appears that skeletons actually reside in separate files now.
	// model and skeleton appear to be identical, and probably point to the same data.
	DMXModelData* skeleton;
};

class DMXModel_Data
{
	CUtlString			name;
	DMXModelData		children[];
	DMXModel_Transform*	transform; // or array?
	DMXModel_Shape*		shape; // or array?
	bool				visible;
	DMXModel_Transform	jointTransforms[];
	DMXModel_State		BaseStates[];
};

class DMXModel_Transform
{
	CUtlString	name; // of a defined model if there are children, otherwise blank
	Vector		position;
	Quaternion	orientation;
};

// Collection of states...suspected that there will only be more than one in a vertex animation DMX.
class DMXModel_Shape
{
	CUtlString			name;
	bool				visible;

	DMXModel_State		baseStates[];
	DMXModel_State		bindState; // needs confirmation - only seen empty
	DMXModel_State*		currentState; // pointer to default baseState?
	DMXModel_State		deltaStates[];

	DMXModel_FaceSet	faceSets[];

	Vector2D			deltaStateWeights[];
	Vector2D			deltaStateWeightsLagged[];
};

// Actual model/skeleton data
class DMXModel_State
{
	CUtlString	name;
	CUtlString	vertexFormat[];
	int			jointCount;
	bool		flipVCoordinates;

	Vector		positions[];
	int			positionsIndicies[];

	Vector		normals[];
	int			normalsIndicies[];

	Vector2D	textureCoordinates[];
	int			textureCoordinatesIndicies[];
};

// Defines a group of faces, and associates them with a material
class DMXModel_FaceSet
{
	CUtlString			name; // of what?
	DMXModel_Material	material;
	int					faces[];
};

// A material reference
class DMXModel_Material
{
	CUtlString			name;
	CUtlString			mtlName; // relative to /materials, no extension
};