Parameter | Description |
---|---|
owner | The object that owns this body. This can be NULL if not required. |
int An owner key that must be passed to PhysicsBody.Destroy when destroying the body.
Set the (optional) owner object associated with this body and return an owner key that must be specified when destroying the body with PhysicsBody.Destroy. The physics system provides access to all objects, including the ability to destroy them so this feature can be used to stop accidental destruction of objects that are owned by other objects. You can only set the owner once, multiple attempts will produce a warning. The lifetime of the specified owner object is not linked to this body i.e. this body will still be owned by the owner object, even if it is destroyed. It is also valid to not specify an owner object (NULL) to simply gain an owner key however it can be useful, if simply for debugging purposes and discovery, to know which object is the owner.