Пример #1
0
/**
 * Constructor
 */
AIPlayer::AIPlayer()
{
   mMoveDestination.set( 0.0f, 0.0f, 0.0f );
   mMoveSpeed = 1.0f;
   mMoveTolerance = 0.25f;
   mMoveStuckTolerance = 0.01f;
   mMoveStuckTestDelay = 30;
   mMoveStuckTestCountdown = 0;
   mMoveSlowdown = true;
   mMoveState = ModeStop;

   mAimObject = 0;
   mAimLocationSet = false;
   mTargetInLOS = false;
   mAimOffset = Point3F(0.0f, 0.0f, 0.0f);

#ifdef TORQUE_NAVIGATION_ENABLED
   mJump = None;
   mNavSize = Regular;
   mLinkTypes = LinkData(AllFlags);
#endif

   mIsAiControlled = true;

   for( S32 i = 0; i < MaxTriggerKeys; i ++ )
      mMoveTriggers[ i ] = false;
}
/**
	@param rect Location of the link
	@param nPage The page in which this link is printed
	@param nDestPage The page to which the internal link links
	@param lX X Offset in the linked page
	@param lY Y Offset in the linked page
	@param lpTitle The link's tooltip (future)
*/
void CCPrintData::AddLink(const RECTL& rect, int nPage, int nDestPage, long lX, long lY, LPCTSTR lpTitle /* = NULL */)
{
	// Ensure we have enough pages
	EnsurePage(nPage);
	// Add the new link data
	m_pages[nPage - 1].push_back(LinkData(rect, nDestPage, lX, lY, lpTitle));
}
/**
	@param sURL The link's URL
	@param rect The link location
	@param nPage The page in which this link is printed
	@param lpTitle The link's tooltip (future)
*/
void CCPrintData::AddLink(const std::tstring& sURL, const RECTL& rect, int nPage, LPCTSTR lpTitle /* = NULL */)
{
	// Ensure we have enough pages
	EnsurePage(nPage);
	// Add the new link data
	m_pages[nPage - 1].push_back(LinkData(sURL, rect, lpTitle));
}
/**
	@param sURL The link's URL
	@param sText The text to look for
	@param nPage The page in which this link is printed
	@param nRepeat The amount of times to look for the text before making it the link
*/
void CCPrintData::AddLink(const std::tstring& sURL, const std::tstring& sText, int nPage, int nRepeat /* = 1 */)
{
	// Ensure we have enough pages
	EnsurePage(nPage);
	// Add the new link data
	m_pages[nPage - 1].push_back(LinkData(sURL, sText, nRepeat));
}
Пример #5
0
// ------------------------------------------------------------------------------------------------
static Packet *PopPacket()
{
    ASSERT_TRUE(!ListIsEmpty(&s_outPackets));

    Packet *packet = LinkData(s_outPackets.next, Packet, link);
    LinkRemove(&packet->link);

    ValidateChecksum(packet);
    return packet;
}
Пример #6
0
void Geometry::Load(string fSrc,string name) /// Load .obj model
{
    gPtr = Find(name);
    if(gPtr == nullptr)
    {
        gPtr = new GData();
        gPtr->idString = name;
        Tools::Token geoToken( Tools::File::LoadFile(fSrc) );/// ch == ' ' || ch == '\n' || ch == '\t' || ch == '/'
        vector<char> rules = {' ' , '\n' ,'\t' , '/'};
        vector<char> splitter = { '/'};
        geoToken.RemakeWithRules(rules,splitter);

        while( geoToken.Next() !=  Tools::Token::EndToken )
        {
            if( geoToken == "v" )
                gPtr->pVerticle( geoToken.GetNVec3() );

            if( geoToken == "vt" )
                gPtr->pTextureCoord( geoToken.GetNVec2() );

            if( geoToken == "f" )
            {
                while( geoToken.CanGNum() )
                {
                    gPtr->pElement( (GLuint)geoToken.GetNi() - 1 );
                    if(geoToken.Peek(1) == "/") /// is next splitter for texture index?
                    {
                        geoToken.Next(); /// Skip the '/' splitter
                        gPtr->pTextureIndex( (geoToken.GetNi() - 1) * 2 );
                    }
                }
            }
        }

        if(geoToken.tokens.size() > 2)
        {
            gData.push_back(gPtr);
            LinkData();
        }
        else
            cout << "Empty or corrupted model file : " << name <<  endl;
    }
}