Simulator::cSpatialObject class

A 3D model in the Simulator.

This class is inherit by all classes that have a visual representation, and therefore need a position, orientation, and scale in 3D space. Models are identified by a ResourceKey (using the SetModelKey() and GetModelKey() methods). The graphical model itself is loaded in the SetModelWorld() method.

Derived classes

class cBuilding
Base class for all buildings in Simulator game modes.
class cCity
class cCityTerritory
class cCityWalls
class cCommodityNode
Represents a spice geyser in civilization stage, maybe it is also used elsewhere.
class cDefaultAoEArea
class cDefaultBeamProjectile
class cEgg
Default model is 0x00000000!0xA76CD528, default mMaterialType is 5.
class cGameplayMarker
class cGameTerrainCursor
class cInteractableObject
class cInterCityRoad
class cLocomotiveObject
class cNest
class cOrnament
Used, among other things, for adventure objects (except pickable ones)
class cPlanet
Visual representation of a planet (or asteroids).
class cTotemPole
The totem pole of a tribe. Default model is TribalTools!0x93256BA, default mMaterialType is 2.
class cTribe
A tribe from the tribe stage.
class cTribeFoodMat
The food mat of a tribe. Default model is TribalTools!trg_sacrifice_altar1, default mMaterialType is 2.
class cTribeHut
class cTribeTool
class cVisiblePlanet

Public static variables

static const uint32_t TYPE

Constructors, destructors, conversion operators

~cSpatialObject() virtual

Public functions

void cSpatialObject_func00h(int) virtual
auto cSpatialObject_func04h() -> int virtual
auto cSpatialObject_func08h() -> int virtual
void Reset() virtual
Sets this model as invisible in its IModelWorld and sets the model and model world to nullptr.
auto Write(void* arg_0) -> int virtual
auto Read(void* arg_0) -> int virtual
auto WriteToXML(XmlSerializer*) -> bool virtual
auto cSpatialObject_func20h() -> bool virtual
auto IsRolledOver() -> bool virtual
void SetIsRolledOver(bool bValue) virtual
auto GetPosition() -> const Vector3& virtual
auto GetOrientation() -> const Quaternion& virtual
auto GetScale() -> float virtual
void SetPosition(const Vector3& value) virtual
void SetOrientation(const Quaternion& value) virtual
void SetScale(float fValue) virtual
void Teleport(const Vector3& position, const Quaternion& orientation) virtual
Changes the position and orientation of the object recalculating its physics.
auto IsOnView() -> bool virtual
void SetIsOnView(bool bValue) virtual
auto IsSelected() -> bool virtual
void SetIsSelected(bool bValue) virtual
auto cSpatialObject_func58h() -> bool virtual
auto GetDirection() -> Vector3 virtual
Returns the local Y axis of this spatial object.
auto cSpatialObject_func60h() -> Vector3 virtual
void SetLocalExtents(const BoundingBox& localExtents, float fScale) virtual
auto GetLocalExtents() -> const BoundingBox& virtual
auto cSpatialObject_func6Ch(int) -> int virtual
auto GetBoundingRadius() -> float virtual
auto GetFootprintRadius() -> float virtual
auto GetMaxZ() -> float virtual
auto cSpatialObject_func7Ch(bool, Point& dst) -> Point& virtual
void cSpatialObject_func80h() virtual
void cSpatialObject_func84h() virtual
auto HasModelChanged() -> bool virtual
void SetHasModelChanged(bool bValue) virtual
auto HasModel() -> bool virtual
void SetModelKey(const ResourceKey& modelKey) virtual
auto GetModelKey() -> const ResourceKey& virtual
auto cSpatialObject_func9Ch() -> bool virtual
void SetModelWorld(Graphics::IModelWorld* pModelWorld) virtual
void cSpatialObject_funcA4h() virtual
void SetModel(Graphics::Model* pModel, Graphics::IModelWorld* pModelWorld) virtual
auto GetModel() -> Graphics::Model* virtual
auto GetModelWorld() -> Graphics::IModelWorld* virtual
void cSpatialObject_funcB4h(string& dst) virtual
auto Cast(uint32_t type) -> void* virtual
auto AddRef() -> int pure virtual
auto Release() -> int pure virtual

Public variables

Vector3 mPosition
Quaternion mOrientation
BoundingBox mOriginalLocalExtents
BoundingBox mLocalExtents
uint32_t mFlags
uint32_t mMaterialType
float field_58
float mBoundingRadius
float mFootprintRadius
float mScale
float mDistanceFromCamera
bool mbIsSelected
bool mbIsRolledOver
bool mbIsInvalid
bool mbPickable
bool mbIsTangible
bool mbFixed
If a model is fixed, it isn't affected by any kind of physics.
bool mbIsBeingEdited
bool mbModelChanged
bool mbTransformDirty
bool mbEnabled
bool mbInView
bool mbSupported
True if the object is not floating on air.
bool mbIsGhost
float field_7C
float field_80
float field_84
float field_88
float field_8C
ResourceKey mModelKey
intrusive_ptr<Graphics::Model> mpModel
intrusive_ptr<Graphics::IModelWorld> mpModelWorld
bool field_A4
bool field_A5
bool mbKeepPinnedToPlanet
bool field_A7
uint32_t field_A8
int field_AC
int field_B0
float field_B4
int field_B8
int field_BC
vector<int> field_C0

Function documentation

void Simulator::cSpatialObject::Reset() virtual

Sets this model as invisible in its IModelWorld and sets the model and model world to nullptr.

It also resets all necessary parameters.

void Simulator::cSpatialObject::Teleport(const Vector3& position, const Quaternion& orientation) virtual

Changes the position and orientation of the object recalculating its physics.

Parameters
position
orientation

For example, it can be used to teleport creatures (using SetOffset() manually just moves them back to their original position)