the Actor class class was the rendezvous point; the classes from above and the classes from below met here. it's a really big class, with all kinds of crap in it, but hardly unsalvagable.

class Actor : public Movement Object?

object creation et al

  • Actor(const SObject Startup Data?* startupData );
  • virtual Actor();
  • virtual Msg Port?& Get Msg Port?();
  • Msg Port? _msgPort;
  • virtual void die();

physics / collision detection / position / movement

  • movement
  • * inline const Vector3 Get Predicted Position?() const;
  • * inline const Vector3& currentPos() const;
  • * inline void setCurrentPos( const Vector3& pos );
  • * inline void setSpeed( const Vector3& speed ); // kts 11-11-95 10:02pm
  • * virtual bool Can Collide?() const; // used to decide which to put it the rooms render & update lists
  • * bool Get Special Collision Message?(void* msgData, int32 maxsize);
  • * Movement Manager? _movementManager;
  • * Path* _path;
  • collision
  • * inline const Col Space?& Get Col Space?() const; // optimization for room vs. actor collisions
  • Physical Object? interface/overrides
  • * virtual const Physical Attributes?& Get Physical Attributes?() const;
  • * virtual Physical Attributes?& Get Writable Physical Attributes?();
  • * void Collision(Physical Object?& other, const Vector3& normal);
  • * virtual Movement Manager?& Get Movement Manager?();
  • * virtual void Movement State Changed?( const Movement Object?::EMovementState newState ); // so we can notify the animation system
  • * Physical Attributes? _physicalAttributes;

input

  • inline QInput Digital?* Get Input Pointer?() const;
  • inline void Set Input Device?(QInput Digital?*);
  • virtual const QInput Digital?* Get Input Device?() const;
  • Input Script?* _inputScript; // contained in _input in case of _input mapping to a mailbox
  • QInput Digital?* _input; // used everywhere in game to get input, must be written to by script
  • void _InitInput( const SObject Startup Data?* startupData );

scene graph "management"

// actor index
  • inline int Get Actor Index?() const;
  • inline void Set Actor Index?( int32 idxActor ); // Only call once (and only on templated objects) and only if you're level
  • unsigned _idxActor : 11; // 2048 objects max.

display / rendering

  • virtual bool Can Render?() const;
  • virtual bool isVisible() const;
// mesh
  • Render Actor?* _renderActor;
  • Animation Manager?* _animManager;
  • unsigned _lastVisibility : 1;
  • unsigned _visibility : 1;

// handles

  • bool Local Handle Location?( Handle ID? id, Vector3& dest ) const;
  • bool Global Handle Location?( Handle ID? id, Vector3& dest ) const;

actor

  • virtual bool Can Update?() const; // used to decide which to put it the rooms render & update lists
  • virtual void reset();
  • // actor "program" / "loop"
  • virtual void predictPosition(const Clock& currentTime); // Predict "desired" new position for this frame
  • virtual void update();
  • void Update Animation?();
  • void Start Frame?(); // this is a catch all, it is guaranteed to run after all actors have run update, but before prepareToRender
  • inline const bool hasRunUpdate() const;
  • inline const bool hasRunPredictPosition() const;

printing / debugging

  • std::ostream& printDetailed( std::ostream& s ) const;
  • virtual std::ostream& Print( std::ostream& ) const;
  • virtual void Validate() const;

Activation Boxes?

  • virtual bool Is Activation Box?() const;
  • Base Object?* Activated(Base Object Iterator Wrapper? objectIter, struct _Activation* actbox, int32* objList ) const;

music / sound effects

  • short Play Sound Effect?( int program );

memory

  • virtual Memory& Get Memory?() const;
  • // room transitions
  • virtual void Bind Assets?(Memory& memory); // bind into current room
  • virtual void Un Bind Assets?(); // unbind, get rid of all transient assets

utility

  • Scalar Get Distance To?( const Actor *pActor ) const;


"variables"

  • // oad
  • inline const _Common* Get Common Block Ptr?() const;
  • inline const _Toolset* Get Toolset Block Ptr?() const;
  • inline const _Mesh* Get Mesh Block Ptr?() const;
  • inline const _ShadowPage* Get Shadow Page Block Ptr?() const;
  • inline int32 Get Mesh Name?() const;
  • // each derived class includes: private: inline const Class* getOad() const
  • // mailbox / messages / inter-object communication
  • Scalar Read System Mailbox?( int boxnum ) const;
  • void Write System Mailbox?( int boxnum, const Scalar value );
  • Actor Mailboxes? _mailboxes;
  • virtual Mailboxes& Get Mailboxes?();
  • virtual const Mailboxes& Get Mailboxes?() const;

class ActorMailboxes : public MailboxesWithStorage
{
public:
   ActorMailboxes(Actor& actor, long mailboxesBase, long numberOfLocalMailboxes, Mailboxes* parent);
   virtual ~ActorMailboxes();
   virtual Scalar ReadMailbox(long mailbox) const;
   virtual void WriteMailbox(long mailbox, Scalar value);
};

scripting

  • void _InitScript( const SObject Startup Data?* startupData );
  • const void* _pScript;

get rid of this crap

  • // tool stuff
  • inline bool Is Needle Gun Target?() const;
  • void spawnPoof() const; // friend to level class only
  • // hitpoints / health / shield-type stuff
  • static const Scalar INDESTRUCTIBLE_HP;
  • Scalar getHealth() const;
  • void deltaHealth( Scalar nHealth );
  • int32 getPower() const;
  • void _InitShadow();
  • void _InitTools();
  • Shield* _shield; // pointer to shield if this actor has one // will go away
  • Tool* _tool_MAX_TOOLS ;
  • int _nTools; // not strictly necessary, but code can determine if it should bother
  • Scalar _hitPoints;
  • virtual bool Is Light?() const;


<hal/hal.h> <math/scalar.hp> <mailbox/mailbox.hp> <physics/colspace.hp> <oas/levelcon.h> <baseobject/msgport.hp> <physics/physicalobject.hp> <movement/movementobject.hp> <movement/movementmanager.hp> <movement/movement.hp> <cpplib/minlist.hp> <input/inputdig.hp> <anim/path.hp> <physics/physical.hp> <physics/colbox.hp> <oas/objectstartupdata.hp> <oas/movebloc.ht> <oas/toolset.ht> <oas/common.ht> <oas/mesh.ht> <oas/shadowp.ht> "rendacto.hp" "animmang.hp"

friend class Animation Manager Actual?; friend class Movement Manager?; friend class Path Handler?; friend class Movement Handler?; friend class Ground Handler?; friend class Air Handler?; friend class Climb Handler?; friend class Camera Handler?;

class also contains a RenderActor, PhysicalAttributes, NonStatPlatData (a space optimization only)

see also RoomClass, LevelClass, and GameClass

Topic revision: r1 - 02 Jul 2003 - 07:41:29 - Will Norris;