Models (C++)

From Valve Developer Community
Revision as of 14:01, 29 April 2011 by TomEdwards (talk | contribs) (hopefully we'll make sense of this one day)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

There are several representations of a model in Source:

Model index
An integer unique to each model. Same on all clients as the server. Acquired from the return value of PrecacheModel() on the server and after that CBaseEntity::GetModelIndex() on both client and server.
A handle to an internal engine representation of a model. Can be passed to engine functions, but does nothing on its own. Shared between all instances of a model.
A MDL file mapped to memory...but each entity has a different one? Can be queried for all sorts of data, but not modified. Despite being an engine class all source code is in the mod SDK.
Client-side handle to a model instance. Used by the model rendering system.