Planeshift
|
A gemObject is any solid, graphical object visible in PS with normal physics and normal collision detection. More...
#include <gem.h>
Public Member Functions | |
virtual void | Disconnect () |
Called when a client disconnects. | |
virtual void | Dump () |
Dump debug information. | |
gemActor * | GetActorPtr () |
gemActionLocation * | GetALPtr () |
virtual float | GetBaseAdvertiseRange () |
This value indicates the range that this entity would become visible to other entities if no other modifiers were taken into consideration. | |
virtual psCharacter * | GetCharacterData () |
virtual Client * | GetClient () const |
uint32_t | GetClientID () |
virtual csString | GetDefaultBehavior (const csString &dfltBehaviors) |
EID | GetEID () |
InstanceID | GetInstance () |
psItem * | GetItem () |
gemItem * | GetItemPtr () |
const char * | GetName () |
gemNPC * | GetNPCPtr () |
virtual const char * | GetObjectType () |
gemPet * | GetPetPtr () |
bool | IsAlive () const |
Returns whether the object is alive. | |
virtual bool | IsUpdateReq (csVector3 const &pos, csVector3 const &oldPos) |
virtual bool | IsValid (void) |
float | RangeTo (gemObject *obj, bool ignoreY=false, bool ignoreInstance=false) |
void | RegisterCallback (iDeleteObjectCallback *receiver) |
virtual void | SendBehaviorMessage (const csString &str, gemObject *obj) |
void | SetAlive (bool flag, bool queue=true) |
Set needed stats for alive or dead for object. | |
void | SetInstance (InstanceID newInstance) |
void | SetName (const char *n) |
void | UnregisterCallback (iDeleteObjectCallback *receiver) |
virtual | ~gemObject () |
iScriptableVar implementation | |
Functions that implement the iScriptableVar interface. | |
virtual double | GetProperty (MathEnvironment *env, const char *ptr) |
virtual double | CalcFunction (MathEnvironment *env, const char *functionName, const double *params) |
virtual const char * | ToString () |
Mesh related functions | |
iMeshWrapper * | GetMeshWrapper () |
csString | GetMesh () |
void | Move (const csVector3 &pos, float rotangle, iSector *room) |
bool | IsNear (gemObject *obj, float radius, bool ignoreY=false) |
const csVector3 & | GetPosition () |
void | GetPosition (csVector3 &pos, float &yrot, iSector *§or) |
void | GetPosition (csVector3 &pos, iSector *§or) |
float | GetAngle () |
Get rotation of entity as returned by psWorld::Matrix2YRot. | |
iSector * | GetSector () |
virtual float | GetVelocity () |
Get the z velocity of the actor. | |
const char * | GetSectorName () |
csArray< gemObject * > * | GetObjectsInRange (float range) |
Proxlist related functions. | |
ProximityList * | GetProxList () |
csArray< PublishDestination > & | GetMulticastClients () |
void | UpdateProxList (bool force=false) |
Generates proxlist if needed (or forced). | |
void | RemoveFromAllProx () |
void | SetAlwaysWatching (bool w) |
bool | AlwaysWatching () |
Networking functions | |
virtual void | Broadcast (int clientnum, bool control) |
virtual bool | Send (int clientnum, bool control, bool to_superclients, psPersistAllEntities *allEntities=NULL) |
Send this object to the given client. | |
virtual void | SendGroupMessage (MsgEntry *me) |
Distribute this object to all members of a group. | |
Overridden functions in child classes | |
virtual PID | GetPID () |
virtual int | GetGuildID () |
virtual psGuildInfo * | GetGuild () |
virtual bool | UpdateDR () |
virtual void | BroadcastTargetStatDR (ClientConnectionSet *clients) |
virtual void | SendTargetStatDR (Client *client) |
virtual psNPCDialog * | GetNPCDialogPtr () |
virtual void | GetLastSuperclientPos (csVector3 &pos, InstanceID &instance, csTicks &last) const |
virtual void | SetLastSuperclientPos (const csVector3 &pos, InstanceID instance, const csTicks &now) |
virtual void | AddLootablePlayer (PID playerID) |
virtual void | RemoveLootablePlayer (PID playerID) |
virtual bool | IsLootablePlayer (PID playerID) |
virtual Client * | GetRandomLootClient (int range) |
virtual AccountID | GetSuperclientID () |
virtual void | SetSuperclientID (AccountID id) |
virtual bool | GetVisibility () |
virtual bool | SeesObject (gemObject *object, float range) |
virtual gemObject * | GetOwner () |
virtual bool | HasKillStealProtection () |
Returns if the object has killsteal protection. | |
Protected Member Functions | |
gemObject (GEMSupervisor *gemsupervisor, EntityManager *entitymanager, CacheManager *cachemanager, const char *name, const char *factname, InstanceID myinstance, iSector *room, const csVector3 &pos, float rotangle, int clientnum) | |
void | InitMesh (const char *name, const csVector3 &pos, const float rotangle, iSector *room) |
bool | InitProximityList (float radius, int clientnum) |
Protected Attributes | |
bool | alwaysWatching |
True if this object always watches (proxlists) regardless of owner. | |
CacheManager * | cacheManager |
EID | eid |
Entity ID (unique identifier for object) | |
EntityManager * | entityManager |
csString | factname |
Name of CS Mesh Factory used to create this object. | |
bool | is_alive |
Flag indicating whether object is alive or not. | |
csString | matname |
Name of base material used by this object. | |
csString | name |
Name of this object, used mostly for debugging. | |
csRef< iMeshFactoryWrapper > | nullfact |
Null factory for our mesh instances. | |
gemMesh * | pcmesh |
link to mesh class | |
float | prox_distance_current |
What is the current actual range for proxlists (they adjust when the # of objects gets too high) | |
float | prox_distance_desired |
What is the maximum range of proxlist we want. | |
ProximityList * | proxlist |
Proximity List for this object. | |
csArray< iDeleteObjectCallback * > | receivers |
List of objects which are to be notified when this object is deleted. | |
bool | valid |
Is object fully loaded. | |
InstanceID | worldInstance |
Only objects which match instances can see each other. | |
Static Protected Attributes | |
static GEMSupervisor * | cel |
Static ptr back to main collection of all objects. |
A gemObject is any solid, graphical object visible in PS with normal physics and normal collision detection.
virtual gemObject::~gemObject | ( | ) | [virtual] |
gemObject::gemObject | ( | GEMSupervisor * | gemsupervisor, |
EntityManager * | entitymanager, | ||
CacheManager * | cachemanager, | ||
const char * | name, | ||
const char * | factname, | ||
InstanceID | myinstance, | ||
iSector * | room, | ||
const csVector3 & | pos, | ||
float | rotangle, | ||
int | clientnum | ||
) | [protected] |
virtual void gemObject::AddLootablePlayer | ( | PID | playerID | ) | [inline, virtual] |
virtual void gemObject::Broadcast | ( | int | clientnum, |
bool | control | ||
) | [virtual] |
clientnum | The client that initiated this update. |
control | Set to true when sent to the controlling client. |
Reimplemented in gemActiveObject, gemItem, gemActionLocation, gemActor, and gemNPC.
virtual void gemObject::BroadcastTargetStatDR | ( | ClientConnectionSet * | clients | ) | [inline, virtual] |
virtual double gemObject::CalcFunction | ( | MathEnvironment * | env, |
const char * | functionName, | ||
const double * | params | ||
) | [virtual] |
Implements iScriptableVar.
virtual void gemObject::Disconnect | ( | ) | [virtual] |
Called when a client disconnects.
virtual void gemObject::Dump | ( | ) | [virtual] |
Dump debug information.
Used in the com_print function.
gemActor* gemObject::GetActorPtr | ( | ) |
gemActionLocation* gemObject::GetALPtr | ( | ) |
float gemObject::GetAngle | ( | ) |
Get rotation of entity as returned by psWorld::Matrix2YRot.
virtual float gemObject::GetBaseAdvertiseRange | ( | ) | [inline, virtual] |
This value indicates the range that this entity would become visible to other entities if no other modifiers were taken into consideration.
Reimplemented in gemItem, and gemActionLocation.
virtual psCharacter* gemObject::GetCharacterData | ( | ) | [inline, virtual] |
virtual Client* gemObject::GetClient | ( | ) | const [inline, virtual] |
uint32_t gemObject::GetClientID | ( | ) |
virtual csString gemObject::GetDefaultBehavior | ( | const csString & | dfltBehaviors | ) | [virtual] |
Reimplemented in gemActiveObject, gemActor, and gemNPC.
virtual psGuildInfo* gemObject::GetGuild | ( | ) | [inline, virtual] |
InstanceID gemObject::GetInstance | ( | ) | [inline] |
psItem* gemObject::GetItem | ( | ) |
gemItem* gemObject::GetItemPtr | ( | ) |
virtual void gemObject::GetLastSuperclientPos | ( | csVector3 & | pos, |
InstanceID & | instance, | ||
csTicks & | last | ||
) | const [inline, virtual] |
iMeshWrapper* gemObject::GetMeshWrapper | ( | ) |
csArray<PublishDestination>& gemObject::GetMulticastClients | ( | ) |
const char* gemObject::GetName | ( | ) |
virtual psNPCDialog* gemObject::GetNPCDialogPtr | ( | ) | [inline, virtual] |
gemNPC* gemObject::GetNPCPtr | ( | ) |
virtual const char* gemObject::GetObjectType | ( | ) | [inline, virtual] |
Reimplemented in gemActiveObject, gemItem, gemActionLocation, gemActor, gemNPC, and gemPet.
virtual gemObject* gemObject::GetOwner | ( | ) | [inline, virtual] |
gemPet* gemObject::GetPetPtr | ( | ) |
virtual PID gemObject::GetPID | ( | ) | [inline, virtual] |
const csVector3& gemObject::GetPosition | ( | ) |
void gemObject::GetPosition | ( | csVector3 & | pos, |
float & | yrot, | ||
iSector *& | sector | ||
) |
void gemObject::GetPosition | ( | csVector3 & | pos, |
iSector *& | sector | ||
) |
virtual double gemObject::GetProperty | ( | MathEnvironment * | env, |
const char * | ptr | ||
) | [virtual] |
Implements iScriptableVar.
ProximityList* gemObject::GetProxList | ( | ) | [inline] |
iSector* gemObject::GetSector | ( | ) |
virtual AccountID gemObject::GetSuperclientID | ( | ) | [inline, virtual] |
virtual float gemObject::GetVelocity | ( | ) | [virtual] |
Get the z velocity of the actor.
Reimplemented in gemActor.
virtual bool gemObject::GetVisibility | ( | ) | [inline, virtual] |
Reimplemented in gemItem, gemActionLocation, and gemActor.
virtual bool gemObject::HasKillStealProtection | ( | ) | [inline, virtual] |
void gemObject::InitMesh | ( | const char * | name, |
const csVector3 & | pos, | ||
const float | rotangle, | ||
iSector * | room | ||
) | [protected] |
bool gemObject::IsAlive | ( | ) | const [inline] |
virtual bool gemObject::IsLootablePlayer | ( | PID | playerID | ) | [inline, virtual] |
virtual bool gemObject::IsUpdateReq | ( | csVector3 const & | pos, |
csVector3 const & | oldPos | ||
) | [virtual] |
void gemObject::Move | ( | const csVector3 & | pos, |
float | rotangle, | ||
iSector * | room | ||
) |
void gemObject::RegisterCallback | ( | iDeleteObjectCallback * | receiver | ) | [inline, virtual] |
Implements iDeleteNotificationObject.
void gemObject::RemoveFromAllProx | ( | ) |
virtual void gemObject::RemoveLootablePlayer | ( | PID | playerID | ) | [inline, virtual] |
Reimplemented in gemActionLocation, and gemActor.
virtual bool gemObject::Send | ( | int | clientnum, |
bool | control, | ||
bool | to_superclients, | ||
psPersistAllEntities * | allEntities = NULL |
||
) | [inline, virtual] |
Send this object to the given client.
clientnum | The client that initiated this update. |
control | Set to true when sent to the controlling client. |
to_superclients | Send to super clients |
allEntities | Buffer the message instead of sending it. |
Reimplemented in gemActiveObject, gemItem, gemActionLocation, gemActor, and gemNPC.
virtual void gemObject::SendBehaviorMessage | ( | const csString & | str, |
gemObject * | obj | ||
) | [virtual] |
Reimplemented in gemActiveObject, gemItem, gemActionLocation, gemActor, and gemNPC.
virtual void gemObject::SendGroupMessage | ( | MsgEntry * | me | ) | [inline, virtual] |
virtual void gemObject::SendTargetStatDR | ( | Client * | client | ) | [inline, virtual] |
void gemObject::SetAlive | ( | bool | flag, |
bool | queue = true |
||
) |
Set needed stats for alive or dead for object.
When dead the mana and HP rate are set to 0.
flag | True if alive |
queue | Set to false to prevent queuing to superclients |
void gemObject::SetInstance | ( | InstanceID | newInstance | ) | [inline] |
virtual void gemObject::SetLastSuperclientPos | ( | const csVector3 & | pos, |
InstanceID | instance, | ||
const csTicks & | now | ||
) | [inline, virtual] |
void gemObject::SetName | ( | const char * | n | ) |
virtual void gemObject::SetSuperclientID | ( | AccountID | id | ) | [inline, virtual] |
virtual const char* gemObject::ToString | ( | ) | [inline, virtual] |
Implements iScriptableVar.
void gemObject::UnregisterCallback | ( | iDeleteObjectCallback * | receiver | ) | [inline, virtual] |
Implements iDeleteNotificationObject.
virtual bool gemObject::UpdateDR | ( | ) | [inline, virtual] |
void gemObject::UpdateProxList | ( | bool | force = false | ) |
Generates proxlist if needed (or forced).
Then removes entities of nearby objects at clients, if needed.
force | Force an update if set to true. |
bool gemObject::alwaysWatching [protected] |
CacheManager* gemObject::cacheManager [protected] |
GEMSupervisor* gemObject::cel [static, protected] |
EID gemObject::eid [protected] |
EntityManager* gemObject::entityManager [protected] |
csString gemObject::factname [protected] |
bool gemObject::is_alive [protected] |
csString gemObject::matname [protected] |
csString gemObject::name [protected] |
csRef<iMeshFactoryWrapper> gemObject::nullfact [protected] |
gemMesh* gemObject::pcmesh [protected] |
float gemObject::prox_distance_current [protected] |
float gemObject::prox_distance_desired [protected] |
ProximityList* gemObject::proxlist [protected] |
csArray<iDeleteObjectCallback*> gemObject::receivers [protected] |
bool gemObject::valid [protected] |
InstanceID gemObject::worldInstance [protected] |