コード例 #1
0
ファイル: msg_info.cpp プロジェクト: MangoCats/winglib
oexBOOL CMsgInfo::Open( oexUINT x_uFlags, oexUINT x_uParams, oexUINT x_uTotalSize )
{   
    // Lose old message
    Destroy();

    // Add packet overhead
    x_uTotalSize += OverheadSize( x_uParams ) + sizeof( oexCHARW ) * x_uParams;

    /// Pointer to buffer
    if ( !m_sBin.SetLength( x_uTotalSize ) )
        return oexFALSE;

    // Set pointers
    SetPointers( (oexINT)x_uParams );

    // Destination address
    os::CSys::Zero( m_pDst, sizeof( CMsgAddress ) );

    // Source address
    os::CSys::Zero( m_pSrc, sizeof( CMsgAddress ) );

    // Initialize block header
    os::CSys::Zero( m_pBh, sizeof( SBlockHeader ) );
    m_pBh->uParams = x_uParams;
    m_pBh->uFlags = x_uFlags;

    // Initialize param info
    os::CSys::Zero( m_pPh, sizeof( SParamHeader ) * x_uParams );

    return oexTRUE;
}
コード例 #2
0
ファイル: msg_info.cpp プロジェクト: MangoCats/winglib
oexBOOL CMsgInfo::Create( oexUINT x_uFlags )
{   
    // Lose old message
    Destroy();

    /// Pointer to buffer
    if ( !m_sBin.SetLength( OverheadSize( 0 ) ) )
        return oexFALSE;

    // Set pointers
    SetPointers( (oexINT)0 );

    // Destination address
    os::CSys::Zero( m_pDst, sizeof( CMsgAddress ) );

    // Source address
    os::CSys::Zero( m_pSrc, sizeof( CMsgAddress ) );

    // Initialize block header
    os::CSys::Zero( m_pBh, sizeof( SBlockHeader ) );
    m_pBh->uParams = 0;
    m_pBh->uFlags = x_uFlags;

    return oexTRUE;
}
コード例 #3
0
 void CapsuleCollisionShape::Construct(const String& Name, const Real& Radius, const Real& Height, StandardAxis UpAxis)
 {
     this->Name = Name;
     btCapsuleShape* CapsuleShape = 0;
     if(Axis_Y == UpAxis) CapsuleShape = new btCapsuleShape(Radius,Height);
     else if(Axis_X == UpAxis) CapsuleShape = new btCapsuleShapeX(Radius,Height);
     else if(Axis_Z == UpAxis) CapsuleShape = new btCapsuleShapeZ(Radius,Height);
     else { MEZZ_EXCEPTION(Exception::PARAMETERS_EXCEPTION,"Non-supported up Axis passed into CapsuleCollisionShape constructor."); }
     SetPointers(CapsuleShape);
 }
コード例 #4
0
 void ConeCollisionShape::Construct(const String& Name, const Real& Radius, const Real& Height, StandardAxis UpAxis)
 {
     this->Name = Name;
     btConeShape* ConeShape;
     if(Axis_Y == UpAxis) ConeShape = new btConeShape(Radius,Height);
     else if(Axis_X == UpAxis) ConeShape = new btConeShapeX(Radius,Height);
     else if(Axis_Z == UpAxis) ConeShape = new btConeShapeZ(Radius,Height);
     else { MEZZ_EXCEPTION(Exception::PARAMETERS_EXCEPTION,"Non-supported up StandardAxis passed into ConeCollisionShape constructor."); }
     SetPointers(ConeShape);
     this->GetBulletConeShape()->setImplicitShapeDimensions(Vector3(0,0,0).GetBulletVector3());
 }
コード例 #5
0
ファイル: msg_info.cpp プロジェクト: MangoCats/winglib
oexBOOL CMsgInfo::Deserialize( oexCSTR8 x_pBin, oexUINT x_uSize )
{
    // Lose previous message
    Destroy();

    /// Set the buffer
    m_sBin.Set( x_pBin, x_uSize );

    if ( !SetPointers( -1 ) )
        return oexFALSE;

    m_uUsed = m_sBin.Length() - OverheadSize();

    if ( !VerifyPacket() )
    {   Destroy();
        return oexFALSE;
    } // end if

    return oexTRUE;
}
コード例 #6
0
CapsuleCollisionShape::CapsuleCollisionShape(const String& Name, btCapsuleShape* BulletShape)
{
    this->Name = Name;
    SetPointers(BulletShape);
}
コード例 #7
0
 SoftCollisionShape::SoftCollisionShape(const String& Name, btSoftBodyCollisionShape* BulletShape)
 {
     this->Name = Name;
     SoftShape = BulletShape;
     SetPointers(SoftShape);
 }
コード例 #8
0
 DynamicMeshCollisionShape::DynamicMeshCollisionShape(const String& Name, btGImpactMeshShape* BulletShape)
 {
     this->Name = Name;
     GImpactShape = BulletShape;
     SetPointers(GImpactShape);
 }
コード例 #9
0
 ConeCollisionShape::ConeCollisionShape(const String& Name, btConeShape* BulletShape)
 {
     this->Name = Name;
     SetPointers(BulletShape);
     this->GetBulletConeShape()->setImplicitShapeDimensions(Vector3(0,0,0).GetBulletVector3());
 }