|
| Node (Context *context) |
| Construct.
|
|
| ~Node () override |
| Destruct. Any child nodes are detached.
|
|
bool | Load (Deserializer &source) override |
| Load from binary data. Return true if successful. More...
|
|
bool | LoadXML (const XMLElement &source) override |
| Load from XML data. Return true if successful. More...
|
|
bool | LoadJSON (const JSONValue &source) override |
| Load from JSON data. Return true if successful. More...
|
|
bool | Save (Serializer &dest) const override |
| Save as binary data. Return true if successful. More...
|
|
bool | SaveXML (XMLElement &dest) const override |
| Save as XML data. Return true if successful. More...
|
|
bool | SaveJSON (JSONValue &dest) const override |
| Save as JSON data. Return true if successful. More...
|
|
void | ApplyAttributes () override |
| Apply attribute changes that can not be applied immediately recursively to child nodes and components. More...
|
|
bool | SaveDefaultAttributes () const override |
| Return whether should save default-valued attributes into XML. Always save node transforms for readability, even if identity. More...
|
|
void | MarkNetworkUpdate () override |
| Mark for attribute check on the next network update. More...
|
|
virtual void | AddReplicationState (NodeReplicationState *state) |
| Add a replication state that is tracking this node. More...
|
|
bool | SaveXML (Serializer &dest, const String &indentation="\t") const |
| Save to an XML file. Return true if successful.
|
|
bool | SaveJSON (Serializer &dest, const String &indentation="\t") const |
| Save to a JSON file. Return true if successful.
|
|
void | SetName (const String &name) |
|
void | SetTags (const StringVector &tags) |
| Set tags. Old tags are overwritten.
|
|
void | AddTag (const String &tag) |
| Add a tag.
|
|
void | AddTags (const String &tags, char separator=';') |
| Add tags with the specified separator (; by default).
|
|
void | AddTags (const StringVector &tags) |
| Add tags.
|
|
bool | RemoveTag (const String &tag) |
| Remove tag. Return true if existed.
|
|
void | RemoveAllTags () |
| Remove all tags.
|
|
void | SetPosition (const Vector3 &position) |
|
void | SetPosition2D (const Vector2 &position) |
|
void | SetPosition2D (float x, float y) |
| Set position in parent space (for Urho2D).
|
|
void | SetRotation (const Quaternion &rotation) |
|
void | SetRotation2D (float rotation) |
|
void | SetDirection (const Vector3 &direction) |
|
void | SetScale (float scale) |
| Set uniform scale in parent space.
|
|
void | SetScale (const Vector3 &scale) |
|
void | SetScale2D (const Vector2 &scale) |
|
void | SetScale2D (float x, float y) |
| Set scale in parent space (for Urho2D).
|
|
void | SetTransform (const Vector3 &position, const Quaternion &rotation) |
| Set both position and rotation in parent space as an atomic operation. This is faster than setting position and rotation separately.
|
|
void | SetTransform (const Vector3 &position, const Quaternion &rotation, float scale) |
| Set position, rotation, and uniform scale in parent space as an atomic operation.
|
|
void | SetTransform (const Vector3 &position, const Quaternion &rotation, const Vector3 &scale) |
| Set position, rotation, and scale in parent space as an atomic operation.
|
|
void | SetTransform (const Matrix3x4 &matrix) |
| Set node transformation in parent space as an atomic operation.
|
|
void | SetTransform2D (const Vector2 &position, float rotation) |
| Set both position and rotation in parent space as an atomic operation (for Urho2D).
|
|
void | SetTransform2D (const Vector2 &position, float rotation, float scale) |
| Set position, rotation, and uniform scale in parent space as an atomic operation (for Urho2D).
|
|
void | SetTransform2D (const Vector2 &position, float rotation, const Vector2 &scale) |
| Set position, rotation, and scale in parent space as an atomic operation (for Urho2D).
|
|
void | SetWorldPosition (const Vector3 &position) |
|
void | SetWorldPosition2D (const Vector2 &position) |
|
void | SetWorldPosition2D (float x, float y) |
| Set position in world space (for Urho2D).
|
|
void | SetWorldRotation (const Quaternion &rotation) |
|
void | SetWorldRotation2D (float rotation) |
|
void | SetWorldDirection (const Vector3 &direction) |
|
void | SetWorldScale (float scale) |
| Set uniform scale in world space.
|
|
void | SetWorldScale (const Vector3 &scale) |
|
void | SetWorldScale2D (const Vector2 &scale) |
|
void | SetWorldScale2D (float x, float y) |
| Set scale in world space (for Urho2D).
|
|
void | SetWorldTransform (const Vector3 &position, const Quaternion &rotation) |
| Set both position and rotation in world space as an atomic operation.
|
|
void | SetWorldTransform (const Vector3 &position, const Quaternion &rotation, float scale) |
| Set position, rotation, and uniform scale in world space as an atomic operation.
|
|
void | SetWorldTransform (const Vector3 &position, const Quaternion &rotation, const Vector3 &scale) |
| Set position, rotation, and scale in world space as an atomic opration.
|
|
void | SetWorldTransform (const Matrix3x4 &worldTransform) |
| Set position, rotation, and scale in world space as an atomic operation from a transformation matrix.
|
|
void | SetWorldTransform2D (const Vector2 &position, float rotation) |
| Set both position and rotation in world space as an atomic operation (for Urho2D).
|
|
void | SetWorldTransform2D (const Vector2 &position, float rotation, float scale) |
| Set position, rotation, and uniform scale in world space as an atomic operation (for Urho2D).
|
|
void | SetWorldTransform2D (const Vector2 &position, float rotation, const Vector2 &scale) |
| Set position, rotation, and scale in world space as an atomic opration (for Urho2D).
|
|
void | Translate (const Vector3 &delta, TransformSpace space=TS_LOCAL) |
| Move the scene node in the chosen transform space.
|
|
void | Translate2D (const Vector2 &delta, TransformSpace space=TS_LOCAL) |
| Move the scene node in the chosen transform space (for Urho2D).
|
|
void | Rotate (const Quaternion &delta, TransformSpace space=TS_LOCAL) |
| Rotate the scene node in the chosen transform space.
|
|
void | Rotate2D (float delta, TransformSpace space=TS_LOCAL) |
| Rotate the scene node in the chosen transform space (for Urho2D).
|
|
void | RotateAround (const Vector3 &point, const Quaternion &delta, TransformSpace space=TS_LOCAL) |
| Rotate around a point in the chosen transform space.
|
|
void | RotateAround2D (const Vector2 &point, float delta, TransformSpace space=TS_LOCAL) |
| Rotate around a point in the chosen transform space (for Urho2D).
|
|
void | Pitch (float angle, TransformSpace space=TS_LOCAL) |
| Rotate around the X axis.
|
|
void | Yaw (float angle, TransformSpace space=TS_LOCAL) |
| Rotate around the Y axis.
|
|
void | Roll (float angle, TransformSpace space=TS_LOCAL) |
| Rotate around the Z axis.
|
|
bool | LookAt (const Vector3 &target, const Vector3 &up=Vector3::UP, TransformSpace space=TS_WORLD) |
| Look at a target position in the chosen transform space. Note that the up vector is always specified in world space. Return true if successful, or false if resulted in an illegal rotation, in which case the current rotation remains.
|
|
void | Scale (float scale) |
| Modify scale in parent space uniformly.
|
|
void | Scale (const Vector3 &scale) |
| Modify scale in parent space.
|
|
void | Scale2D (const Vector2 &scale) |
| Modify scale in parent space (for Urho2D).
|
|
void | SetEnabled (bool enable) |
|
void | SetDeepEnabled (bool enable) |
| Set enabled state on self and child nodes. Nodes' own enabled state is remembered (IsEnabledSelf) and can be restored.
|
|
void | ResetDeepEnabled () |
| Reset enabled state to the node's remembered state prior to calling SetDeepEnabled.
|
|
void | SetEnabledRecursive (bool enable) |
| Set enabled state on self and child nodes. Unlike SetDeepEnabled this does not remember the nodes' own enabled state, but overwrites it.
|
|
void | SetOwner (Connection *owner) |
|
void | MarkDirty () |
| Mark node and child nodes to need world transform recalculation. Notify listener components.
|
|
Node * | CreateChild (const String &name=String::EMPTY, CreateMode mode=REPLICATED, unsigned id=0, bool temporary=false) |
| Create a child scene node (with specified ID if provided).
|
|
Node * | CreateTemporaryChild (const String &name=String::EMPTY, CreateMode mode=REPLICATED, unsigned id=0) |
| Create a temporary child scene node (with specified ID if provided).
|
|
void | AddChild (Node *node, unsigned index=M_MAX_UNSIGNED) |
| Add a child scene node at a specific index. If index is not explicitly specified or is greater than current children size, append the new child at the end.
|
|
void | RemoveChild (Node *node) |
| Remove a child scene node.
|
|
void | RemoveAllChildren () |
| Remove all child scene nodes.
|
|
void | RemoveChildren (bool removeReplicated, bool removeLocal, bool recursive) |
| Remove child scene nodes that match criteria.
|
|
Component * | CreateComponent (StringHash type, CreateMode mode=REPLICATED, unsigned id=0) |
| Create a component to this node (with specified ID if provided).
|
|
Component * | GetOrCreateComponent (StringHash type, CreateMode mode=REPLICATED, unsigned id=0) |
| Create a component to this node if it does not exist already.
|
|
Component * | CloneComponent (Component *component, unsigned id=0) |
| Clone a component from another node using its create mode. Return the clone if successful or null on failure.
|
|
Component * | CloneComponent (Component *component, CreateMode mode, unsigned id=0) |
| Clone a component from another node and specify the create mode. Return the clone if successful or null on failure.
|
|
void | RemoveComponent (Component *component) |
| Remove a component from this node.
|
|
void | RemoveComponent (StringHash type) |
| Remove the first component of specific type from this node.
|
|
void | RemoveComponents (bool removeReplicated, bool removeLocal) |
| Remove components that match criteria.
|
|
void | RemoveComponents (StringHash type) |
| Remove all components of specific type.
|
|
void | RemoveAllComponents () |
| Remove all components from this node.
|
|
void | ReorderComponent (Component *component, unsigned index) |
| Adjust index order of an existing component in this node.
|
|
Node * | Clone (CreateMode mode=REPLICATED) |
| Clone scene node, components and child nodes. Return the clone.
|
|
void | Remove () |
| Remove from the parent node. If no other shared pointer references exist, causes immediate deletion.
|
|
void | SetParent (Node *parent) |
|
void | SetVar (StringHash key, const Variant &value) |
| Set a user variable.
|
|
void | AddListener (Component *component) |
| Add listener component that is notified of node being dirtied. Can either be in the same node or another.
|
|
void | RemoveListener (Component *component) |
| Remove listener component.
|
|
template<class T > |
T * | CreateComponent (CreateMode mode=REPLICATED, unsigned id=0) |
| Template version of creating a component.
|
|
template<class T > |
T * | GetOrCreateComponent (CreateMode mode=REPLICATED, unsigned id=0) |
| Template version of getting or creating a component.
|
|
template<class T > |
void | RemoveComponent () |
| Template version of removing a component.
|
|
template<class T > |
void | RemoveComponents () |
| Template version of removing all components of specific type.
|
|
unsigned | GetID () const |
|
bool | IsReplicated () const |
|
const String & | GetName () const |
|
StringHash | GetNameHash () const |
| Return name hash.
|
|
const StringVector & | GetTags () const |
|
bool | HasTag (const String &tag) const |
| Return whether has a specific tag.
|
|
Node * | GetParent () const |
|
Scene * | GetScene () const |
|
bool | IsChildOf (Node *node) const |
| Return whether is a direct or indirect child of specified node.
|
|
bool | IsEnabled () const |
|
bool | IsEnabledSelf () const |
|
Connection * | GetOwner () const |
|
const Vector3 & | GetPosition () const |
|
Vector2 | GetPosition2D () const |
|
const Quaternion & | GetRotation () const |
|
float | GetRotation2D () const |
|
Vector3 | GetDirection () const |
|
Vector3 | GetUp () const |
|
Vector3 | GetRight () const |
|
const Vector3 & | GetScale () const |
|
Vector2 | GetScale2D () const |
|
Matrix3x4 | GetTransform () const |
|
Vector3 | GetWorldPosition () const |
|
Vector2 | GetWorldPosition2D () const |
|
Quaternion | GetWorldRotation () const |
|
float | GetWorldRotation2D () const |
|
Vector3 | GetWorldDirection () const |
|
Vector3 | GetWorldUp () const |
|
Vector3 | GetWorldRight () const |
|
Vector3 | GetWorldScale () const |
|
Vector3 | GetSignedWorldScale () const |
|
Vector2 | GetWorldScale2D () const |
|
const Matrix3x4 & | GetWorldTransform () const |
|
Vector3 | LocalToWorld (const Vector3 &position) const |
| Convert a local space position to world space.
|
|
Vector3 | LocalToWorld (const Vector4 &vector) const |
| Convert a local space position or rotation to world space.
|
|
Vector2 | LocalToWorld2D (const Vector2 &vector) const |
| Convert a local space position or rotation to world space (for Urho2D).
|
|
Vector3 | WorldToLocal (const Vector3 &position) const |
| Convert a world space position to local space.
|
|
Vector3 | WorldToLocal (const Vector4 &vector) const |
| Convert a world space position or rotation to local space.
|
|
Vector2 | WorldToLocal2D (const Vector2 &vector) const |
| Convert a world space position or rotation to local space (for Urho2D).
|
|
bool | IsDirty () const |
| Return whether transform has changed and world transform needs recalculation.
|
|
unsigned | GetNumChildren (bool recursive=false) const |
| Return number of child scene nodes.
|
|
const Vector< SharedPtr< Node > > & | GetChildren () const |
| Return immediate child scene nodes.
|
|
void | GetChildren (PODVector< Node * > &dest, bool recursive=false) const |
| Return child scene nodes, optionally recursive.
|
|
PODVector< Node * > | GetChildren (bool recursive) const |
| Return child scene nodes, optionally recursive.
|
|
void | GetChildrenWithComponent (PODVector< Node * > &dest, StringHash type, bool recursive=false) const |
| Return child scene nodes with a specific component.
|
|
PODVector< Node * > | GetChildrenWithComponent (StringHash type, bool recursive=false) const |
| Return child scene nodes with a specific component.
|
|
void | GetChildrenWithTag (PODVector< Node * > &dest, const String &tag, bool recursive=false) const |
| Return child scene nodes with a specific tag.
|
|
PODVector< Node * > | GetChildrenWithTag (const String &tag, bool recursive=false) const |
| Return child scene nodes with a specific tag.
|
|
Node * | GetChild (unsigned index) const |
| Return child scene node by index.
|
|
Node * | GetChild (const String &name, bool recursive=false) const |
| Return child scene node by name.
|
|
Node * | GetChild (const char *name, bool recursive=false) const |
| Return child scene node by name.
|
|
Node * | GetChild (StringHash nameHash, bool recursive=false) const |
| Return child scene node by name hash.
|
|
unsigned | GetNumComponents () const |
|
unsigned | GetNumNetworkComponents () const |
| Return number of non-local components.
|
|
const Vector< SharedPtr< Component > > & | GetComponents () const |
| Return all components.
|
|
void | GetComponents (PODVector< Component * > &dest, StringHash type, bool recursive=false) const |
| Return all components of type. Optionally recursive.
|
|
Component * | GetComponent (StringHash type, bool recursive=false) const |
| Return component by type. If there are several, returns the first.
|
|
Component * | GetParentComponent (StringHash type, bool fullTraversal=false) const |
| Return component in parent node. If there are several, returns the first. May optional traverse up to the root node.
|
|
bool | HasComponent (StringHash type) const |
| Return whether has a specific component.
|
|
const Vector< WeakPtr< Component > > | GetListeners () const |
| Return listener components.
|
|
const Variant & | GetVar (StringHash key) const |
| Return a user variable.
|
|
const VariantMap & | GetVars () const |
| Return all user variables.
|
|
template<class T > |
T * | GetDerivedComponent (bool recursive=false) const |
| Return first component derived from class.
|
|
template<class T > |
T * | GetParentDerivedComponent (bool fullTraversal=false) const |
| Return first component derived from class in the parent node, or if fully traversing then the first node up the tree with one.
|
|
template<class T > |
void | GetDerivedComponents (PODVector< T * > &dest, bool recursive=false, bool clearVector=true) const |
| Return components derived from class.
|
|
template<class T > |
void | GetChildrenWithComponent (PODVector< Node * > &dest, bool recursive=false) const |
| Template version of returning child nodes with a specific component.
|
|
template<class T > |
T * | GetComponent (bool recursive=false) const |
| Template version of returning a component by type.
|
|
template<class T > |
T * | GetParentComponent (bool fullTraversal=false) const |
| Template version of returning a parent's component by type.
|
|
template<class T > |
void | GetComponents (PODVector< T * > &dest, bool recursive=false) const |
| Template version of returning all components of type.
|
|
template<class T > |
bool | HasComponent () const |
| Template version of checking whether has a specific component.
|
|
void | SetID (unsigned id) |
|
void | SetScene (Scene *scene) |
| Set scene. Called by Scene.
|
|
void | ResetScene () |
| Reset scene, ID and owner. Called by Scene.
|
|
void | SetNetPositionAttr (const Vector3 &value) |
| Set network position attribute.
|
|
void | SetNetRotationAttr (const PODVector< unsigned char > &value) |
| Set network rotation attribute.
|
|
void | SetNetParentAttr (const PODVector< unsigned char > &value) |
| Set network parent attribute.
|
|
const Vector3 & | GetNetPositionAttr () const |
| Return network position attribute.
|
|
const PODVector< unsigned char > & | GetNetRotationAttr () const |
| Return network rotation attribute.
|
|
const PODVector< unsigned char > & | GetNetParentAttr () const |
| Return network parent attribute.
|
|
bool | Load (Deserializer &source, SceneResolver &resolver, bool loadChildren=true, bool rewriteIDs=false, CreateMode mode=REPLICATED) |
| Load components and optionally load child nodes.
|
|
bool | LoadXML (const XMLElement &source, SceneResolver &resolver, bool loadChildren=true, bool rewriteIDs=false, CreateMode mode=REPLICATED) |
| Load components from XML data and optionally load child nodes.
|
|
bool | LoadJSON (const JSONValue &source, SceneResolver &resolver, bool loadChildren=true, bool rewriteIDs=false, CreateMode mode=REPLICATED) |
| Load components from XML data and optionally load child nodes.
|
|
const PODVector< Node * > & | GetDependencyNodes () const |
| Return the depended on nodes to order network updates.
|
|
void | PrepareNetworkUpdate () |
| Prepare network update by comparing attributes and marking replication states dirty as necessary.
|
|
void | CleanupConnection (Connection *connection) |
|
void | MarkReplicationDirty () |
| Mark node dirty in scene replication states.
|
|
Node * | CreateChild (unsigned id, CreateMode mode, bool temporary=false) |
| Create a child node with specific ID.
|
|
void | AddComponent (Component *component, unsigned id, CreateMode mode) |
| Add a pre-created component. Using this function from application code is discouraged, as component operation without an owner node may not be well-defined in all cases. Prefer CreateComponent() instead.
|
|
unsigned | GetNumPersistentChildren () const |
| Calculate number of non-temporary child nodes.
|
|
unsigned | GetNumPersistentComponents () const |
| Calculate number of non-temporary components.
|
|
void | SetPositionSilent (const Vector3 &position) |
| Set position in parent space silently without marking the node & child nodes dirty. Used by animation code.
|
|
void | SetRotationSilent (const Quaternion &rotation) |
| Set position in parent space silently without marking the node & child nodes dirty. Used by animation code.
|
|
void | SetScaleSilent (const Vector3 &scale) |
| Set scale in parent space silently without marking the node & child nodes dirty. Used by animation code.
|
|
void | SetTransformSilent (const Vector3 &position, const Quaternion &rotation, const Vector3 &scale) |
| Set local transform silently without marking the node & child nodes dirty. Used by animation code.
|
|
| Animatable (Context *context) |
| Construct.
|
|
| ~Animatable () override |
| Destruct.
|
|
bool | LoadXML (const XMLElement &source) override |
| Load from XML data. Return true if successful. More...
|
|
bool | SaveXML (XMLElement &dest) const override |
| Save as XML data. Return true if successful. More...
|
|
bool | LoadJSON (const JSONValue &source) override |
| Load from JSON data. Return true if successful. More...
|
|
bool | SaveJSON (JSONValue &dest) const override |
| Save as JSON data. Return true if successful. More...
|
|
void | SetAnimationEnabled (bool enable) |
|
void | SetAnimationTime (float time) |
| Set time position of all attribute animations or an object animation manually. Automatic update should be disabled in this case.
|
|
void | SetObjectAnimation (ObjectAnimation *objectAnimation) |
|
void | SetAttributeAnimation (const String &name, ValueAnimation *attributeAnimation, WrapMode wrapMode=WM_LOOP, float speed=1.0f) |
| Set attribute animation.
|
|
void | SetAttributeAnimationWrapMode (const String &name, WrapMode wrapMode) |
| Set attribute animation wrap mode.
|
|
void | SetAttributeAnimationSpeed (const String &name, float speed) |
| Set attribute animation speed.
|
|
void | SetAttributeAnimationTime (const String &name, float time) |
| Set attribute animation time position manually. Automatic update should be disabled in this case.
|
|
void | RemoveObjectAnimation () |
| Remove object animation. Same as calling SetObjectAnimation with a null pointer.
|
|
void | RemoveAttributeAnimation (const String &name) |
| Remove attribute animation. Same as calling SetAttributeAnimation with a null pointer.
|
|
bool | GetAnimationEnabled () const |
|
ObjectAnimation * | GetObjectAnimation () const |
|
ValueAnimation * | GetAttributeAnimation (const String &name) const |
| Return attribute animation.
|
|
WrapMode | GetAttributeAnimationWrapMode (const String &name) const |
| Return attribute animation wrap mode.
|
|
float | GetAttributeAnimationSpeed (const String &name) const |
| Return attribute animation speed.
|
|
float | GetAttributeAnimationTime (const String &name) const |
| Return attribute animation time position.
|
|
void | SetObjectAnimationAttr (const ResourceRef &value) |
| Set object animation attribute.
|
|
ResourceRef | GetObjectAnimationAttr () const |
| Return object animation attribute.
|
|
| Serializable (Context *context) |
| Construct.
|
|
| ~Serializable () override |
| Destruct.
|
|
virtual void | OnSetAttribute (const AttributeInfo &attr, const Variant &src) |
| Handle attribute write access. Default implementation writes to the variable at offset, or invokes the set accessor. More...
|
|
virtual void | OnGetAttribute (const AttributeInfo &attr, Variant &dest) const |
| Handle attribute read access. Default implementation reads the variable at offset, or invokes the get accessor. More...
|
|
virtual const Vector< AttributeInfo > * | GetAttributes () const |
| Return attribute descriptions, or null if none defined. More...
|
|
virtual const Vector< AttributeInfo > * | GetNetworkAttributes () const |
| Return network replication attribute descriptions, or null if none defined.
|
|
virtual bool | Load (Deserializer &source) |
| Load from binary data. Return true if successful. More...
|
|
virtual bool | Save (Serializer &dest) const |
| Save as binary data. Return true if successful. More...
|
|
virtual bool | LoadXML (const XMLElement &source) |
| Load from XML data. Return true if successful. More...
|
|
virtual bool | SaveXML (XMLElement &dest) const |
| Save as XML data. Return true if successful. More...
|
|
virtual bool | LoadJSON (const JSONValue &source) |
| Load from JSON data. Return true if successful. More...
|
|
virtual bool | SaveJSON (JSONValue &dest) const |
| Save as JSON data. Return true if successful. More...
|
|
virtual void | ApplyAttributes () |
| Apply attribute changes that can not be applied immediately. Called after scene load or a network update. More...
|
|
virtual bool | SaveDefaultAttributes () const |
| Return whether should save default-valued attributes into XML. Default false. More...
|
|
virtual void | MarkNetworkUpdate () |
| Mark for attribute check on the next network update. More...
|
|
bool | SetAttribute (unsigned index, const Variant &value) |
|
bool | SetAttribute (const String &name, const Variant &value) |
| Set attribute by name. Return true if successfully set.
|
|
void | SetInstanceDefault (bool enable) |
| Set instance-level default flag.
|
|
void | ResetToDefault () |
| Reset all editable attributes to their default values.
|
|
void | RemoveInstanceDefault () |
| Remove instance's default values if they are set previously.
|
|
void | SetTemporary (bool enable) |
|
void | SetInterceptNetworkUpdate (const String &attributeName, bool enable) |
| Enable interception of an attribute from network updates. Intercepted attributes are sent as events instead of applying directly. This can be used to implement client side prediction.
|
|
void | AllocateNetworkState () |
| Allocate network attribute state.
|
|
void | WriteInitialDeltaUpdate (Serializer &dest, unsigned char timeStamp) |
| Write initial delta network update.
|
|
void | WriteDeltaUpdate (Serializer &dest, const DirtyBits &attributeBits, unsigned char timeStamp) |
| Write a delta network update according to dirty attribute bits.
|
|
void | WriteLatestDataUpdate (Serializer &dest, unsigned char timeStamp) |
| Write a latest data network update.
|
|
bool | ReadDeltaUpdate (Deserializer &source) |
| Read and apply a network delta update. Return true if attributes were changed.
|
|
bool | ReadLatestDataUpdate (Deserializer &source) |
| Read and apply a network latest data update. Return true if attributes were changed.
|
|
Variant | GetAttribute (unsigned index) const |
|
Variant | GetAttribute (const String &name) const |
| Return attribute value by name. Return empty if not found.
|
|
Variant | GetAttributeDefault (unsigned index) const |
|
Variant | GetAttributeDefault (const String &name) const |
| Return attribute default value by name. Return empty if not found.
|
|
unsigned | GetNumAttributes () const |
|
unsigned | GetNumNetworkAttributes () const |
| Return number of network replication attributes.
|
|
bool | IsTemporary () const |
|
bool | GetInterceptNetworkUpdate (const String &attributeName) const |
| Return whether an attribute's network updates are being intercepted.
|
|
NetworkState * | GetNetworkState () const |
| Return the network attribute state, if allocated.
|
|
| Object (Context *context) |
| Construct.
|
|
| ~Object () override |
| Destruct. Clean up self from event sender & receiver structures.
|
|
virtual StringHash | GetType () const =0 |
|
virtual const String & | GetTypeName () const =0 |
|
virtual const TypeInfo * | GetTypeInfo () const =0 |
| Return type info.
|
|
virtual void | OnEvent (Object *sender, StringHash eventType, VariantMap &eventData) |
| Handle event.
|
|
bool | IsInstanceOf (StringHash type) const |
| Check current instance is type of specified type.
|
|
bool | IsInstanceOf (const TypeInfo *typeInfo) const |
| Check current instance is type of specified type.
|
|
template<typename T > |
bool | IsInstanceOf () const |
| Check current instance is type of specified class.
|
|
template<typename T > |
T * | Cast () |
| Cast the object to specified most derived class.
|
|
template<typename T > |
const T * | Cast () const |
| Cast the object to specified most derived class.
|
|
void | SubscribeToEvent (StringHash eventType, EventHandler *handler) |
| Subscribe to an event that can be sent by any sender.
|
|
void | SubscribeToEvent (Object *sender, StringHash eventType, EventHandler *handler) |
| Subscribe to a specific sender's event.
|
|
void | SubscribeToEvent (StringHash eventType, const std::function< void(StringHash, VariantMap &)> &function, void *userData=nullptr) |
| Subscribe to an event that can be sent by any sender.
|
|
void | SubscribeToEvent (Object *sender, StringHash eventType, const std::function< void(StringHash, VariantMap &)> &function, void *userData=nullptr) |
| Subscribe to a specific sender's event.
|
|
void | UnsubscribeFromEvent (StringHash eventType) |
| Unsubscribe from an event.
|
|
void | UnsubscribeFromEvent (Object *sender, StringHash eventType) |
| Unsubscribe from a specific sender's event.
|
|
void | UnsubscribeFromEvents (Object *sender) |
| Unsubscribe from a specific sender's events.
|
|
void | UnsubscribeFromAllEvents () |
| Unsubscribe from all events.
|
|
void | UnsubscribeFromAllEventsExcept (const PODVector< StringHash > &exceptions, bool onlyUserData) |
| Unsubscribe from all events except those listed, and optionally only those with userdata (script registered events).
|
|
void | SendEvent (StringHash eventType) |
| Send event to all subscribers.
|
|
void | SendEvent (StringHash eventType, VariantMap &eventData) |
| Send event with parameters to all subscribers.
|
|
VariantMap & | GetEventDataMap () const |
| Return a preallocated map for event data. Used for optimization to avoid constant re-allocation of event data maps.
|
|
template<typename... Args> |
void | SendEvent (StringHash eventType, Args... args) |
| Send event with variadic parameter pairs to all subscribers. The parameter pairs is a list of paramID and paramValue separated by comma, one pair after another.
|
|
Context * | GetContext () const |
| Return execution context.
|
|
const Variant & | GetGlobalVar (StringHash key) const |
|
const VariantMap & | GetGlobalVars () const |
|
void | SetGlobalVar (StringHash key, const Variant &value) |
|
Object * | GetSubsystem (StringHash type) const |
| Return subsystem by type.
|
|
Object * | GetEventSender () const |
| Return active event sender. Null outside event handling.
|
|
EventHandler * | GetEventHandler () const |
| Return active event handler. Null outside event handling.
|
|
bool | HasSubscribedToEvent (StringHash eventType) const |
| Return whether has subscribed to an event without specific sender.
|
|
bool | HasSubscribedToEvent (Object *sender, StringHash eventType) const |
| Return whether has subscribed to a specific sender's event.
|
|
bool | HasEventHandlers () const |
| Return whether has subscribed to any event.
|
|
template<class T > |
T * | GetSubsystem () const |
| Template version of returning a subsystem.
|
|
const String & | GetCategory () const |
|
void | SetBlockEvents (bool block) |
| Block object from sending and receiving events.
|
|
bool | GetBlockEvents () const |
| Return sending and receiving events blocking status.
|
|
| RefCounted () |
| Construct. Allocate the reference count structure and set an initial self weak reference.
|
|
virtual | ~RefCounted () |
| Destruct. Mark as expired and also delete the reference count structure if no outside weak references exist.
|
|
| RefCounted (const RefCounted &rhs)=delete |
| Prevent copy construction.
|
|
RefCounted & | operator= (const RefCounted &rhs)=delete |
| Prevent assignment.
|
|
void | AddRef () |
|
void | ReleaseRef () |
|
int | Refs () const |
|
int | WeakRefs () const |
|
RefCount * | RefCountPtr () |
| Return pointer to the reference count structure.
|
|