Represents a single game object (e.g. Player, Ball, etc.) which may be optionally synchronized between server and all clients. More...
Public Member Functions | |
| NDObjectID | getID (void) |
| Returns the object's ID. | |
| bool | isLocal (void) |
| Is this object a local object? | |
| NDResult | publish (void) |
| Publishes a local object. | |
| void | setUserPtr (void *ptr) |
| Stores a user pointer for this object. | |
| void * | getUserPtr (void) |
| Retrieves the user pointer for this object. | |
| NDNodeID | getAuthNodeID (void) |
| Gets the nodeID of the object authority for this object. | |
| NDNodeID | getOwnerID (void) |
| Gets the nodeID of the owner of this object. | |
| uint32_t | getNumChildren (void) |
| Gets the number of child objects of this object. | |
| NDObjectID | getChild (uint32_t idx) |
| Gets the nth child of this object. | |
| NDResult | removeChild (NDObjectID objid) |
| Removes a child object from this object. | |
| NDResult | addChild (NDObjectID objid) |
| Adds a child object to this object. | |
| NDObjectType | getObjectType (void) |
| Gets the object type of this object. | |
| NDResult | setPositionAttribute (NDAttribID atid) |
| Reserved for future use. | |
| NDAttribID | getPositionAttribute (void) |
| Reserved for future use. | |
| NDAttribType | getAttribType (NDAttribID atid) |
| Gets the data type for the specified object attribute (data field). | |
| NDResult | getVect3Int32 (NDAttribID atid, NDVect3Int32 &p) |
| Retrieves this object's specified attribute as a 3-dimensional vector of 32-bit ints. | |
| NDResult | setVect3Int32 (NDAttribID atid, const NDVect3Int32 &p, bool create=false) |
| Sets this object's specified attribute as a 3-dimensional vector of 32-bit ints. | |
| NDResult | getVect3Int64 (NDAttribID atid, NDVect3Int64 &p) |
| Retrieves this object's specified attribute as a 3-dimensional vector of 64-bit ints. | |
| NDResult | setVect3Int64 (NDAttribID atid, const NDVect3Int64 &p, bool create=false) |
| Sets this object's specified attribute as a 3-dimensional vector of 64-bit ints. | |
| NDResult | getVect3Float (NDAttribID atid, NDVect3Float &p) |
| Retrieves this object's specified attribute as a 3-dimensional vector of floats. | |
| NDResult | setVect3Float (NDAttribID atid, const NDVect3Float &p, bool create=false) |
| Sets this object's specified attribute as a 3-dimensional vector of floats. | |
| NDResult | getVect3Double (NDAttribID atid, NDVect3Double &p) |
| Retrieves this object's specified attribute as a 3-dimensional vector of doubles. | |
| NDResult | setVect3Double (NDAttribID atid, const NDVect3Double &p, bool create=false) |
| Sets this object's specified attribute as a 3-dimensional vector of doubles. | |
| NDResult | getInt64 (NDAttribID atid, int64_t &val) |
| Retrieves this object's specified attribute as a 64-bit int. | |
| NDResult | setInt64 (NDAttribID atid, int64_t val, bool create=false) |
| Sets this object's specified attribute as a 64-bit int. | |
| NDResult | getInt32 (NDAttribID atid, int32_t &val) |
| Retrieves this object's specified attribute as a 64-bit int. | |
| NDResult | setInt32 (NDAttribID atid, int32_t val, bool create=false) |
| Sets this object's specified attribute as a 64-bit int. | |
| NDResult | getFloat (NDAttribID atid, float &val) |
| Retrieves this object's specified attribute as a float. | |
| NDResult | setFloat (NDAttribID atid, float val, bool create=false) |
| Sets this object's specified attribute as a float. | |
| NDResult | getDouble (NDAttribID atid, double &val) |
| Retrieves this object's specified attribute as a double. | |
| NDResult | setDouble (NDAttribID atid, double val, bool create=false) |
| Sets this object's specified attribute as a double. | |
| NDResult | getRaw (NDAttribID atid, char *ptr, uint32_t *len) |
| Retrieves this object's specified attribute as raw data. | |
| NDResult | setRaw (NDAttribID atid, char *ptr, uint32_t len, bool create=false) |
| Sets this object's specified attribute as raw data. | |
Static Public Member Functions | |
| static const char * | attribTypeToString (NDAttribType atype) |
| Gets the string representation of the specified attribute data type. | |
Static Public Attributes | |
| static const NDAttribType | TYPE_RAW = 0x00 |
| static const NDAttribType | TYPE_OBJECT = 0x01 |
| static const NDAttribType | TYPE_INTERP = 0x02 |
| static const NDAttribType | TYPE_INT32 = 0x03 |
| static const NDAttribType | TYPE_INT64 = 0x04 |
| static const NDAttribType | TYPE_FLOAT = 0x05 |
| static const NDAttribType | TYPE_DOUBLE = 0x06 |
| static const NDAttribType | TYPE_VECT3_INT32 = 0x07 |
| static const NDAttribType | TYPE_VECT3_INT64 = 0x08 |
| static const NDAttribType | TYPE_VECT3_FLOAT = 0x09 |
| static const NDAttribType | TYPE_VECT3_DOUBLE = 0x0A |
Represents a single game object (e.g. Player, Ball, etc.) which may be optionally synchronized between server and all clients
| NDResult NDObject::addChild | ( | NDObjectID | objid | ) |
Adds a child object to this object
| objid | the objectID of the child object to be removed |
| const char * NDObject::attribTypeToString | ( | NDAttribType | atype | ) | [static] |
Gets the string representation of the specified attribute data type
| atype | the attribute (field) data type |
| NDAttribType NDObject::getAttribType | ( | NDAttribID | atid | ) |
Gets the data type for the specified object attribute (data field)
| atid | the attribute (field) ID |
| NDNodeID NDObject::getAuthNodeID | ( | void | ) |
Gets the nodeID of the object authority for this object
| NDObjectID NDObject::getChild | ( | uint32_t | idx | ) |
Gets the nth child of this object
| idx | the index of the child object |
| NDResult NDObject::getDouble | ( | NDAttribID | atid, | |
| double & | val | |||
| ) |
Retrieves this object's specified attribute as a double.
| atid | the attribute (field) ID to retrieve | |
| val | the variable (passed by reference) into which this value will be read |
| NDResult NDObject::getFloat | ( | NDAttribID | atid, | |
| float & | val | |||
| ) |
Retrieves this object's specified attribute as a float.
| atid | the attribute (field) ID to retrieve | |
| val | the variable (passed by reference) into which this value will be read |
| NDObjectID NDObject::getID | ( | void | ) |
Returns the object's ID
The ID of an object is a 64-bit unsigned integer. And ID of zero indicates that the object is invalid.
| NDResult NDObject::getInt32 | ( | NDAttribID | atid, | |
| int32_t & | val | |||
| ) |
Retrieves this object's specified attribute as a 64-bit int.
| atid | the attribute (field) ID to retrieve | |
| val | the variable (passed by reference) into which this value will be read |
| NDResult NDObject::getInt64 | ( | NDAttribID | atid, | |
| int64_t & | val | |||
| ) |
Retrieves this object's specified attribute as a 64-bit int.
| atid | the attribute (field) ID to retrieve | |
| val | the variable (passed by reference) into which this value will be read |
| uint32_t NDObject::getNumChildren | ( | void | ) |
Gets the number of child objects of this object
| NDObjectType NDObject::getObjectType | ( | void | ) |
Gets the object type of this object
| NDNodeID NDObject::getOwnerID | ( | void | ) |
Gets the nodeID of the owner of this object
| NDAttribID NDObject::getPositionAttribute | ( | void | ) |
Reserved for future use
| NDResult NDObject::getRaw | ( | NDAttribID | atid, | |
| char * | ptr, | |||
| uint32_t * | len | |||
| ) |
Retrieves this object's specified attribute as raw data.
| atid | the attribute (field) ID to retrieve | |
| ptr | the pointer into which data will be read | |
| len | a pointer into which the length of the raw data will be stored (NULL may be passed if the length is not needed) |
| void * NDObject::getUserPtr | ( | void | ) |
Retrieves the user pointer for this object. NULL by default.
| NDResult NDObject::getVect3Double | ( | NDAttribID | atid, | |
| NDVect3Double & | p | |||
| ) |
Retrieves this object's specified attribute as a 3-dimensional vector of doubles.
| atid | the attribute (field) ID to retrieve | |
| p | the variable (passed by reference) into which this value will be read |
| NDResult NDObject::getVect3Float | ( | NDAttribID | atid, | |
| NDVect3Float & | p | |||
| ) |
Retrieves this object's specified attribute as a 3-dimensional vector of floats.
| atid | the attribute (field) ID to retrieve | |
| p | the variable (passed by reference) into which this value will be read |
| NDResult NDObject::getVect3Int32 | ( | NDAttribID | atid, | |
| NDVect3Int32 & | p | |||
| ) |
Retrieves this object's specified attribute as a 3-dimensional vector of 32-bit ints.
| atid | the attribute (field) ID to retrieve | |
| p | the variable (passed by reference) into which this value will be read |
| NDResult NDObject::getVect3Int64 | ( | NDAttribID | atid, | |
| NDVect3Int64 & | p | |||
| ) |
Retrieves this object's specified attribute as a 3-dimensional vector of 64-bit ints.
| atid | the attribute (field) ID to retrieve | |
| p | the variable (passed by reference) into which this value will be read |
| bool NDObject::isLocal | ( | void | ) |
Determines whether this object is a local object. Local objects are only visible to the current instance of NetDog, and are not shared across the network. All new objects are created as local objects. To create a global object, see NDObject::publish()
| NDResult NDObject::publish | ( | void | ) |
Publishes a local object. Local object is validated by an object server. If accepted, the object becomes a global object, visible to all.
| NDResult NDObject::removeChild | ( | NDObjectID | objid | ) |
Removes a child object from this object
| objid | the objectID of the child object to be removed |
| NDResult NDObject::setDouble | ( | NDAttribID | atid, | |
| double | val, | |||
| bool | create = false | |||
| ) |
Sets this object's specified attribute as a double.
| atid | the attribute (field) ID to set | |
| val | the value to set this attribute to | |
| create | if true, the attribute with this ID will created if it doesn't exist, if false, the value will only be set if the attribute with this ID already exists |
| NDResult NDObject::setFloat | ( | NDAttribID | atid, | |
| float | val, | |||
| bool | create = false | |||
| ) |
Sets this object's specified attribute as a float.
| atid | the attribute (field) ID to set | |
| val | the value to set this attribute to | |
| create | if true, the attribute with this ID will created if it doesn't exist, if false, the value will only be set if the attribute with this ID already exists |
| NDResult NDObject::setInt32 | ( | NDAttribID | atid, | |
| int32_t | val, | |||
| bool | create = false | |||
| ) |
Sets this object's specified attribute as a 64-bit int.
| atid | the attribute (field) ID to set | |
| val | the value to set this attribute to | |
| create | if true, the attribute with this ID will created if it doesn't exist, if false, the value will only be set if the attribute with this ID already exists |
| NDResult NDObject::setInt64 | ( | NDAttribID | atid, | |
| int64_t | val, | |||
| bool | create = false | |||
| ) |
Sets this object's specified attribute as a 64-bit int.
| atid | the attribute (field) ID to set | |
| val | the value to set this attribute to | |
| create | if true, the attribute with this ID will created if it doesn't exist, if false, the value will only be set if the attribute with this ID already exists |
| NDResult NDObject::setPositionAttribute | ( | NDAttribID | atid | ) |
Reserved for future use
| NDResult NDObject::setRaw | ( | NDAttribID | atid, | |
| char * | ptr, | |||
| uint32_t | len, | |||
| bool | create = false | |||
| ) |
Sets this object's specified attribute as raw data.
| atid | the attribute (field) ID to set | |
| ptr | the pointer to raw data to set this attribute to | |
| len | the length of the raw data (in bytes) | |
| create | if true, the attribute with this ID will created if it doesn't exist, if false, the value will only be set if the attribute with this ID already exists |
| void NDObject::setUserPtr | ( | void * | ptr | ) |
Stores a user pointer for this object. This is a convienience to the user, allowing storage of user-specific information within this object.
| ptr | the pointer to be stored in the object |
| NDResult NDObject::setVect3Double | ( | NDAttribID | atid, | |
| const NDVect3Double & | p, | |||
| bool | create = false | |||
| ) |
Sets this object's specified attribute as a 3-dimensional vector of doubles.
| atid | the attribute (field) ID to set | |
| p | the value to set this attribute to | |
| create | if true, the attribute with this ID will created if it doesn't exist, if false, the value will only be set if the attribute with this ID already exists |
| NDResult NDObject::setVect3Float | ( | NDAttribID | atid, | |
| const NDVect3Float & | p, | |||
| bool | create = false | |||
| ) |
Sets this object's specified attribute as a 3-dimensional vector of floats.
| atid | the attribute (field) ID to set | |
| p | the value to set this attribute to | |
| create | if true, the attribute with this ID will created if it doesn't exist, if false, the value will only be set if the attribute with this ID already exists |
| NDResult NDObject::setVect3Int32 | ( | NDAttribID | atid, | |
| const NDVect3Int32 & | p, | |||
| bool | create = false | |||
| ) |
Sets this object's specified attribute as a 3-dimensional vector of 32-bit ints.
| atid | the attribute (field) ID to set | |
| p | the value to set this attribute to | |
| create | if true, the attribute with this ID will created if it doesn't exist, if false, the value will only be set if the attribute with this ID already exists |
| NDResult NDObject::setVect3Int64 | ( | NDAttribID | atid, | |
| const NDVect3Int64 & | p, | |||
| bool | create = false | |||
| ) |
Sets this object's specified attribute as a 3-dimensional vector of 64-bit ints.
| atid | the attribute (field) ID to set | |
| p | the value to set this attribute to | |
| create | if true, the attribute with this ID will created if it doesn't exist, if false, the value will only be set if the attribute with this ID already exists |
1.6.1