Planeshift
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes

gemObject Class Reference

A gemObject is any solid, graphical object visible in PS with normal physics and normal collision detection. More...

#include <gem.h>

List of all members.

Public Member Functions

virtual void Disconnect ()
 Called when a client disconnects.
virtual void Dump ()
 Dump debug information.
gemActorGetActorPtr ()
gemActionLocationGetALPtr ()
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 psCharacterGetCharacterData ()
virtual ClientGetClient () const
uint32_t GetClientID ()
virtual csString GetDefaultBehavior (const csString &dfltBehaviors)
EID GetEID ()
InstanceID GetInstance ()
psItemGetItem ()
gemItemGetItemPtr ()
const char * GetName ()
gemNPCGetNPCPtr ()
virtual const char * GetObjectType ()
gemPetGetPetPtr ()
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 *&sector)
void GetPosition (csVector3 &pos, iSector *&sector)
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.
ProximityListGetProxList ()
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 psGuildInfoGetGuild ()
virtual bool UpdateDR ()
virtual void BroadcastTargetStatDR (ClientConnectionSet *clients)
virtual void SendTargetStatDR (Client *client)
virtual psNPCDialogGetNPCDialogPtr ()
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 ClientGetRandomLootClient (int range)
virtual AccountID GetSuperclientID ()
virtual void SetSuperclientID (AccountID id)
virtual bool GetVisibility ()
virtual bool SeesObject (gemObject *object, float range)
virtual gemObjectGetOwner ()
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.
CacheManagercacheManager
EID eid
 Entity ID (unique identifier for object)
EntityManagerentityManager
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.
gemMeshpcmesh
 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.
ProximityListproxlist
 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 GEMSupervisorcel
 Static ptr back to main collection of all objects.

Detailed Description

A gemObject is any solid, graphical object visible in PS with normal physics and normal collision detection.

Definition at line 310 of file gem.h.


Constructor & Destructor Documentation

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]

Member Function Documentation

virtual void gemObject::AddLootablePlayer ( PID  playerID) [inline, virtual]

Reimplemented in gemNPC.

Definition at line 611 of file gem.h.

bool gemObject::AlwaysWatching ( ) [inline]

Definition at line 523 of file gem.h.

virtual void gemObject::Broadcast ( int  clientnum,
bool  control 
) [virtual]
Parameters:
clientnumThe client that initiated this update.
controlSet to true when sent to the controlling client.

Reimplemented in gemActiveObject, gemItem, gemActionLocation, gemActor, and gemNPC.

virtual void gemObject::BroadcastTargetStatDR ( ClientConnectionSet clients) [inline, virtual]

Reimplemented in gemActor.

Definition at line 603 of file gem.h.

virtual double gemObject::CalcFunction ( MathEnvironment env,
const char *  functionName,
const double *  params 
) [virtual]

Implements iScriptableVar.

Reimplemented in gemItem, and gemActor.

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.

Returns:
rotation about y axis
See also:
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.

Definition at line 537 of file gem.h.

virtual psCharacter* gemObject::GetCharacterData ( ) [inline, virtual]

Reimplemented in gemActor.

Definition at line 375 of file gem.h.

virtual Client* gemObject::GetClient ( ) const [inline, virtual]

Reimplemented in gemActor.

Definition at line 380 of file gem.h.

uint32_t gemObject::GetClientID ( )
virtual csString gemObject::GetDefaultBehavior ( const csString &  dfltBehaviors) [virtual]

Reimplemented in gemActiveObject, gemActor, and gemNPC.

EID gemObject::GetEID ( ) [inline]

Definition at line 316 of file gem.h.

virtual psGuildInfo* gemObject::GetGuild ( ) [inline, virtual]

Reimplemented in gemActor.

Definition at line 595 of file gem.h.

virtual int gemObject::GetGuildID ( ) [inline, virtual]

Definition at line 591 of file gem.h.

InstanceID gemObject::GetInstance ( ) [inline]

Definition at line 392 of file gem.h.

psItem* gemObject::GetItem ( )
gemItem* gemObject::GetItemPtr ( )
virtual void gemObject::GetLastSuperclientPos ( csVector3 &  pos,
InstanceID instance,
csTicks &  last 
) const [inline, virtual]

Reimplemented in gemActor.

Definition at line 609 of file gem.h.

csString gemObject::GetMesh ( ) [inline]

Definition at line 419 of file gem.h.

iMeshWrapper* gemObject::GetMeshWrapper ( )
csArray<PublishDestination>& gemObject::GetMulticastClients ( )
const char* gemObject::GetName ( )
virtual psNPCDialog* gemObject::GetNPCDialogPtr ( ) [inline, virtual]

Reimplemented in gemNPC.

Definition at line 605 of file gem.h.

gemNPC* gemObject::GetNPCPtr ( )
csArray<gemObject*>* gemObject::GetObjectsInRange ( float  range)
virtual const char* gemObject::GetObjectType ( ) [inline, virtual]

Reimplemented in gemActiveObject, gemItem, gemActionLocation, gemActor, gemNPC, and gemPet.

Definition at line 363 of file gem.h.

virtual gemObject* gemObject::GetOwner ( ) [inline, virtual]

Reimplemented in gemNPC.

Definition at line 636 of file gem.h.

gemPet* gemObject::GetPetPtr ( )
virtual PID gemObject::GetPID ( ) [inline, virtual]

Reimplemented in gemActor.

Definition at line 587 of file gem.h.

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.

Reimplemented in gemItem, and gemActor.

ProximityList* gemObject::GetProxList ( ) [inline]

Definition at line 488 of file gem.h.

virtual Client* gemObject::GetRandomLootClient ( int  range) [inline, virtual]

Reimplemented in gemNPC.

Definition at line 617 of file gem.h.

iSector* gemObject::GetSector ( )
const char* gemObject::GetSectorName ( ) [inline]

Definition at line 470 of file gem.h.

virtual AccountID gemObject::GetSuperclientID ( ) [inline, virtual]

Reimplemented in gemNPC.

Definition at line 621 of file gem.h.

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.

Definition at line 627 of file gem.h.

virtual bool gemObject::HasKillStealProtection ( ) [inline, virtual]

Returns if the object has killsteal protection.

Rules about killsteal protection should be implmented here. Generic objects don't have killsteal protection

Returns:
A boolean indicating if this gemObject must have killsteal protection.

Reimplemented in gemNPC.

Definition at line 649 of file gem.h.

void gemObject::InitMesh ( const char *  name,
const csVector3 &  pos,
const float  rotangle,
iSector *  room 
) [protected]
bool gemObject::InitProximityList ( float  radius,
int  clientnum 
) [protected]
bool gemObject::IsAlive ( ) const [inline]

Returns whether the object is alive.

Definition at line 346 of file gem.h.

virtual bool gemObject::IsLootablePlayer ( PID  playerID) [inline, virtual]

Reimplemented in gemNPC.

Definition at line 613 of file gem.h.

bool gemObject::IsNear ( gemObject obj,
float  radius,
bool  ignoreY = false 
)
virtual bool gemObject::IsUpdateReq ( csVector3 const &  pos,
csVector3 const &  oldPos 
) [virtual]
virtual bool gemObject::IsValid ( void  ) [inline, virtual]

Definition at line 338 of file gem.h.

void gemObject::Move ( const csVector3 &  pos,
float  rotangle,
iSector *  room 
)
float gemObject::RangeTo ( gemObject obj,
bool  ignoreY = false,
bool  ignoreInstance = false 
)
void gemObject::RegisterCallback ( iDeleteObjectCallback receiver) [inline, virtual]

Implements iDeleteNotificationObject.

Definition at line 397 of file gem.h.

void gemObject::RemoveFromAllProx ( )
virtual void gemObject::RemoveLootablePlayer ( PID  playerID) [inline, virtual]

Reimplemented in gemNPC.

Definition at line 612 of file gem.h.

virtual bool gemObject::SeesObject ( gemObject object,
float  range 
) [inline, virtual]

Reimplemented in gemActionLocation, and gemActor.

Definition at line 631 of file gem.h.

virtual bool gemObject::Send ( int  clientnum,
bool  control,
bool  to_superclients,
psPersistAllEntities allEntities = NULL 
) [inline, virtual]

Send this object to the given client.

Parameters:
clientnumThe client that initiated this update.
controlSet to true when sent to the controlling client.
to_superclientsSend to super clients
allEntitiesBuffer the message instead of sending it.

Reimplemented in gemActiveObject, gemItem, gemActionLocation, gemActor, and gemNPC.

Definition at line 571 of file gem.h.

virtual void gemObject::SendBehaviorMessage ( const csString &  str,
gemObject obj 
) [virtual]
virtual void gemObject::SendGroupMessage ( MsgEntry me) [inline, virtual]

Distribute this object to all members of a group.

Parameters:
meThe MsgEntry to send to all group members.

Reimplemented in gemActor.

Definition at line 581 of file gem.h.

virtual void gemObject::SendTargetStatDR ( Client client) [inline, virtual]

Reimplemented in gemActor.

Definition at line 604 of file gem.h.

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.

Parameters:
flagTrue if alive
queueSet to false to prevent queuing to superclients
void gemObject::SetAlwaysWatching ( bool  w) [inline]

Definition at line 515 of file gem.h.

void gemObject::SetInstance ( InstanceID  newInstance) [inline]

Reimplemented in gemActor.

Definition at line 388 of file gem.h.

virtual void gemObject::SetLastSuperclientPos ( const csVector3 &  pos,
InstanceID  instance,
const csTicks &  now 
) [inline, virtual]

Reimplemented in gemActor.

Definition at line 610 of file gem.h.

void gemObject::SetName ( const char *  n)
virtual void gemObject::SetSuperclientID ( AccountID  id) [inline, virtual]

Reimplemented in gemNPC.

Definition at line 625 of file gem.h.

virtual const char* gemObject::ToString ( ) [inline, virtual]

Implements iScriptableVar.

Definition at line 327 of file gem.h.

void gemObject::UnregisterCallback ( iDeleteObjectCallback receiver) [inline, virtual]

Implements iDeleteNotificationObject.

Definition at line 401 of file gem.h.

virtual bool gemObject::UpdateDR ( ) [inline, virtual]

Reimplemented in gemActor.

Definition at line 599 of file gem.h.

void gemObject::UpdateProxList ( bool  force = false)

Generates proxlist if needed (or forced).

Then removes entities of nearby objects at clients, if needed.

Parameters:
forceForce an update if set to true.

Member Data Documentation

bool gemObject::alwaysWatching [protected]

True if this object always watches (proxlists) regardless of owner.

Definition at line 673 of file gem.h.

Definition at line 666 of file gem.h.

GEMSupervisor* gemObject::cel [static, protected]

Static ptr back to main collection of all objects.

Definition at line 664 of file gem.h.

EID gemObject::eid [protected]

Entity ID (unique identifier for object)

Definition at line 671 of file gem.h.

Definition at line 665 of file gem.h.

csString gemObject::factname [protected]

Name of CS Mesh Factory used to create this object.

Definition at line 669 of file gem.h.

bool gemObject::is_alive [protected]

Flag indicating whether object is alive or not.

Definition at line 668 of file gem.h.

csString gemObject::matname [protected]

Name of base material used by this object.

Definition at line 670 of file gem.h.

csString gemObject::name [protected]

Name of this object, used mostly for debugging.

Definition at line 663 of file gem.h.

csRef<iMeshFactoryWrapper> gemObject::nullfact [protected]

Null factory for our mesh instances.

Definition at line 672 of file gem.h.

gemMesh* gemObject::pcmesh [protected]

link to mesh class

Definition at line 661 of file gem.h.

What is the current actual range for proxlists (they adjust when the # of objects gets too high)

Definition at line 678 of file gem.h.

What is the maximum range of proxlist we want.

Definition at line 677 of file gem.h.

Proximity List for this object.

Definition at line 662 of file gem.h.

List of objects which are to be notified when this object is deleted.

Definition at line 675 of file gem.h.

bool gemObject::valid [protected]

Is object fully loaded.

Definition at line 659 of file gem.h.

Only objects which match instances can see each other.

Definition at line 667 of file gem.h.


The documentation for this class was generated from the following file: