PeerMessage         PeerOS - Message class
Print

Description

PeerMessage should answer:

  1. Decide exactly what you're trying to say, e.g., "Place camera here.".
  2. Decide exactly how you're going to store this information. What data structures do you need to store (or reference) to say it?
  3. Create a class to say this
  4. Inherit your class from PeerMessage and, probably, some lower-level utility class. For instance, the PeerOS test CM_Camera class holds a simple vector (3 floats):

 

class CM_Camera:
    public PeerMessage,
    public ImaginaryOgre3DCameraClass
  {
  private:
    float           m_position[3];
  public:
    CM_Camera(void)
        : PeerMessage()
        , ImaginaryOgre3DCameraClass()
    {
        m_position[0] = 0.111f;
        m_position[1] = 0.511f;
        m_position[2] = 0.666f;
    }
    float getPos(int _i) { return m_position[_i]; }
    void dispatch(PM_ReaderBase* handler)
    {
        dynamicDispatch(handler,this);
    }
  };

Contributors to this page: jacmoe111451 points  .
Page last modified on Sunday 03 of January, 2010 00:41:22 GMT by jacmoe111451 points .


The content on this page is licensed under the terms of the Creative Commons Attribution-ShareAlike License.
As an exception, any source code contributed within the content is released into the Public Domain.