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 cCulturalTarget
class cDefaultAoEArea
class cDefaultBeamProjectile
class cEgg
Default model is 0x00000000!0xA76CD528, default mMaterialType is 5.
class cGameBundle
class cGameTerrainCursor
class cGameplayMarker
class cInterCityRoad
class cInteractableObject
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

auto cSpatialObject_func00h(int) -> void virtual
auto cSpatialObject_func04h() -> int virtual
auto cSpatialObject_func08h() -> int virtual
auto Reset() -> void 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
auto SetIsRolledOver(bool bValue) -> void virtual
auto GetPosition() -> const Math::Vector3& virtual
auto GetOrientation() -> const Math::Quaternion& virtual
auto GetScale() -> float virtual
auto SetPosition(const Math::Vector3& value) -> void virtual
auto SetOrientation(const Math::Quaternion& value) -> void virtual
auto SetScale(float fValue) -> void virtual
auto Teleport(const Math::Vector3& position, const Math::Quaternion& orientation) -> void virtual
Changes the position and orientation of the object recalculating its physics.
auto IsOnView() -> bool virtual
auto SetIsOnView(bool bValue) -> void virtual
auto IsSelected() -> bool virtual
auto SetIsSelected(bool bValue) -> void virtual
auto IsPlayerOwned() -> bool virtual
auto GetDirection() -> Math::Vector3 virtual
Returns the local Y axis of this spatial object.
auto cSpatialObject_func60h() -> Math::Vector3 virtual
auto SetLocalExtents(const Math::BoundingBox& localExtents, float fScale) -> void virtual
auto GetLocalExtents() -> const Math::BoundingBox& virtual
auto cSpatialObject_func6Ch(int) -> int virtual
auto GetBoundingRadius() -> float virtual
auto GetFootprintRadius() -> float virtual
auto GetMaxZ() -> float virtual
auto cSpatialObject_func7Ch(bool, Math::Point& dst) -> Math::Point& virtual
auto cSpatialObject_func80h() -> void virtual
auto cSpatialObject_func84h() -> void virtual
auto HasModelChanged() -> bool virtual
auto SetHasModelChanged(bool bValue) -> void virtual
auto HasModel() -> bool virtual
auto SetModelKey(const ResourceKey& modelKey) -> void virtual
auto GetModelKey() -> const ResourceKey& virtual
auto cSpatialObject_func9Ch() -> bool virtual
auto SetModelWorld(Graphics::IModelWorld* pModelWorld) -> void virtual
auto cSpatialObject_funcA4h() -> void virtual
auto SetModel(Graphics::Model* pModel, Graphics::IModelWorld* pModelWorld) -> void virtual
auto GetModel() -> Graphics::Model* virtual
auto GetModelWorld() -> Graphics::IModelWorld* virtual
auto cSpatialObject_funcB4h(eastl::string& dst) -> void virtual
auto Cast(uint32_t type) -> void* virtual
auto AddRef() -> int pure virtual
auto Release() -> int pure virtual

Public variables

Math::Vector3 mPosition
Math::Quaternion mOrientation
Math::BoundingBox mOriginalLocalExtents
Math::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
ModelPtr mpModel
IModelWorldPtr 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
eastl::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 Math::Vector3& position, const Math::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)