113 for (
size_t i = 0; i <
m_Props.size(); ++i)
119 for (
size_t i = 0; i <
m_Props.size(); ++i)
177 void AddProp(
const SPropPoint* point, std::unique_ptr<CModelAbstract> model,
CObjectEntry* objectentry,
float minHeight = 0.f,
float maxHeight = 0.f,
bool selectable =
true);
205 std::unique_ptr<CModelAbstract>
Clone()
const override;
std::shared_ptr< CModelDef > CModelDefPtr
Definition: MeshManager.h:27
int32_t player_id_t
valid player IDs are non-negative (see ICmpOwnership)
Definition: Player.h:24
Definition: BoundingBoxAligned.h:34
Definition: Material.h:29
Definition: Matrix3D.h:34
Abstract base class for graphical objects that are used by units, or as props attached to other CMode...
Definition: ModelAbstract.h:50
bool m_PositionValid
True if both transform and and bone matrices are valid.
Definition: ModelAbstract.h:182
std::vector< Prop > m_Props
Definition: Model.h:248
const CSimulation2 & m_Simulation
Definition: Model.h:221
void CalcStaticObjectBounds()
Auxiliary method; calculates object space bounds of this model, based solely on vertex positions,...
Definition: Model.cpp:92
bool SetAnimation(CSkeletonAnim *anim, bool once=false)
Definition: Model.cpp:334
CModel * ToCModel() override
Dynamic cast.
Definition: Model.h:72
float m_AnimTime
Definition: Model.h:236
CSkeletonAnim * m_Anim
Definition: Model.h:234
void HideAmmoProp()
Hide the ammo prop (if any), and show any other props on that prop point.
Definition: Model.cpp:430
CModel(const CSimulation2 &simulation, const CMaterial &material, const CModelDefPtr &modeldef)
Definition: Model.cpp:40
void UpdateTo(float time)
Definition: Model.cpp:169
void CalcBounds() override
Overridden to calculate both the world-space and object-space bounds of this model,...
Definition: Model.cpp:67
void CopyAnimationFrom(CModel *source)
Definition: Model.cpp:374
std::unique_ptr< CModelAbstract > Clone() const override
Definition: Model.cpp:466
void RemoveShadowsRec()
Definition: Model.cpp:509
void CalcAnimatedObjectBounds(CSkeletonAnimDef *anim, CBoundingBoxAligned &result)
Auxiliary method; calculate object-space bounds encompassing all vertex positions for given animation...
Definition: Model.cpp:100
void SetPlayerID(player_id_t id) override
Definition: Model.cpp:524
void SetTransform(const CMatrix3D &transform) override
Set transform of this object.
Definition: Model.cpp:488
void ValidatePosition() override
Ensure that both the transformation and the bone matrices are correct for this model and all its prop...
Definition: Model.cpp:196
CBoundingBoxAligned m_ObjectBounds
Definition: Model.h:232
void AddAmmoProp(const SPropPoint *point, std::unique_ptr< CModelAbstract > model, CObjectEntry *objectentry)
Add a prop to the model on the given point, and treat it as the ammo prop.
Definition: Model.cpp:403
const CMatrix3D * GetAnimatedBoneMatrices()
Definition: Model.h:168
~CModel() override
Definition: Model.cpp:60
int GetFlags() const
Definition: Model.h:103
CMaterial m_Material
Definition: Model.h:226
const std::vector< Prop > & GetProps() const
Definition: Model.h:202
CSkeletonAnim * GetAnimation() const
Definition: Model.h:94
const SPropPoint * m_AmmoPropPoint
The prop point to which the ammo prop is attached, or NULL if none.
Definition: Model.h:253
bool IsSkinned()
Return whether this is a skinned/skeletal model.
Definition: Model.h:165
void AddFlagsRec(int flags)
Definition: Model.cpp:497
void SetFlags(int flags)
Definition: Model.h:101
const CBoundingBoxAligned GetObjectSelectionBoundsRec() override
Reimplemented here since proper models should participate in selection boxes.
Definition: Model.cpp:115
CMatrix3D * m_BoneMatrices
Current state of all bones on this model; null if associated modeldef isn't skeletal.
Definition: Model.h:246
void InvalidatePosition() override
Mark this model's position and bone matrices, and all props' positions as invalid.
Definition: Model.cpp:186
const CModelDefPtr & GetModelDef()
Definition: Model.h:81
const CModelDefPtr m_pModelDef
Definition: Model.h:228
CModelAbstract * FindFirstAmmoProp()
Find the first prop used for ammo, by this model or its own props.
Definition: Model.cpp:445
const CBoundingBoxAligned GetWorldBoundsRec() override
Returns world space bounds of this object and all child objects.
Definition: Model.cpp:107
std::vector< Prop > & GetProps()
Definition: Model.h:201
size_t m_AmmoLoadedProp
If m_AmmoPropPoint is not NULL, then the index in m_Props of the ammo prop.
Definition: Model.h:258
const CMaterial & GetMaterial()
Definition: Model.h:88
void SetShadingColor(const CColor &color) override
Definition: Model.cpp:532
int m_Flags
Definition: Model.h:224
const CBoundingBoxAligned & GetObjectBounds()
Returns the object-space bounds for this model, excluding its children.
Definition: Model.h:130
void ShowAmmoProp()
Show the ammo prop (if any), and hide any other props on that prop point.
Definition: Model.cpp:415
void AddProp(const SPropPoint *point, std::unique_ptr< CModelAbstract > model, CObjectEntry *objectentry, float minHeight=0.f, float maxHeight=0.f, bool selectable=true)
Add a prop to the model on the given point.
Definition: Model.cpp:385
void SetTerrainDirty(ssize_t i0, ssize_t j0, ssize_t i1, ssize_t j1) override
Called when terrain has changed in the given inclusive bounds.
Definition: Model.h:111
void SetEntityVariable(const std::string &name, float value) override
Called when the entity tries to set some variable to affect the display of this model and/or its chil...
Definition: Model.h:117
Definition: ObjectEntry.h:38
void RecalculateBoundsIfNecessary()
Factored out so subclasses don't need to repeat this if they want to add additional getters for bound...
Definition: RenderableObject.h:130
Public API for simulation system.
Definition: Simulation2.h:47
Definition: SkeletonAnimDef.h:48
Definition: SkeletonAnim.h:33
#define ENSURE(expr)
ensure the expression <expr> evaluates to non-zero.
Definition: debug.h:277
static size_t m_Model
Definition: x86_x64.cpp:211
bool m_Hidden
Should this prop be temporarily removed from rendering?
Definition: Model.h:63
float m_MaxHeight
Definition: Model.h:46
std::unique_ptr< CModelAbstract > m_Model
Pointer to the model associated with this prop.
Definition: Model.h:60
const SPropPoint * m_Point
Location of the prop point within its parent model, relative to either a bone in the parent model or ...
Definition: Model.h:53
CObjectEntry * m_ObjectEntry
Definition: Model.h:61
float m_MinHeight
Definition: Model.h:45
bool m_Selectable
Definition: Model.h:64
Describes the position of a prop point within its parent model.
Definition: ModelDef.h:55
intptr_t ssize_t
Definition: wposix_types.h:82