Models (C++)

From Valve Developer Community
Revision as of 22:48, 21 January 2024 by Thunder4ik (talk | contribs) (→‎top: clean up, added orphan tag)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Help.png
This article contains speculation that needs to be confirmed.

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.
model_t
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.
CStudioHdr
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.
ModelInstanceHandle_t
Client-side handle to a model instance. Used by the model rendering system.