当前位置: 首页>>代码示例>>C++>>正文


C++ dAASSERT函数代码示例

本文整理汇总了C++中dAASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ dAASSERT函数的具体用法?C++ dAASSERT怎么用?C++ dAASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dAASSERT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: dMassAdd

void dMassAdd (dMass *a, const dMass *b)
{
  int i;
  dAASSERT (a && b);
  dReal denom = dRecip (a->mass + b->mass);
  for (i=0; i<3; i++) a->c[i] = (a->c[i]*a->mass + b->c[i]*b->mass)*denom;
  a->mass += b->mass;
  for (i=0; i<12; i++) a->I[i] += b->I[i];
}
开发者ID:Belxjander,项目名称:Asuna,代码行数:9,代码来源:mass.cpp

示例2: dxGeom

dxBox::dxBox (dSpaceID space, dReal lx, dReal ly, dReal lz) : dxGeom (space,1)
{
  dAASSERT (lx >= 0 && ly >= 0 && lz >= 0);
  type = dBoxClass;
  side[0] = lx;
  side[1] = ly;
  side[2] = lz;
  updateZeroSizedFlag(!lx || !ly || !lz);
}
开发者ID:4nakin,项目名称:awesomeball,代码行数:9,代码来源:box.cpp

示例3: dGeomCapsuleSetParams

void dGeomCapsuleSetParams (dGeomID g, dReal radius, dReal length)
{
  dUASSERT (g && g->type == dCapsuleClass,"argument not a ccylinder");
  dAASSERT (radius > 0 && length > 0);
  dxCapsule *c = (dxCapsule*) g;
  c->radius = radius;
  c->lz = length;
  dGeomMoved (g);
}
开发者ID:sub77,项目名称:hobbycode,代码行数:9,代码来源:capsule.cpp

示例4: dJointSetLMotorNumAxes

void dJointSetLMotorNumAxes( dJointID j, int num )
{
    dxJointLMotor* joint = ( dxJointLMotor* )j;
    dAASSERT( joint && num >= 0 && num <= 3 );
    checktype( joint, LMotor );
    if ( num < 0 ) num = 0;
    if ( num > 3 ) num = 3;
    joint->num = num;
}
开发者ID:Sosi,项目名称:open-dynamics-engine-svnmirror,代码行数:9,代码来源:lmotor.cpp

示例5: dGeomGetOffsetPosition

const dReal * dGeomGetOffsetPosition (dxGeom *g)
{
    dAASSERT (g);
    if (g->offset_posr)
    {
        return g->offset_posr->pos;
    }
    return OFFSET_POSITION_ZERO;
}
开发者ID:JohnCrash,项目名称:ode,代码行数:9,代码来源:collision_kernel.cpp

示例6: dIsPositiveDefinite

int dIsPositiveDefinite (const dReal *A, int n)
{
  dReal *Acopy;
  dAASSERT (n > 0 && A);
  int nskip = dPAD (n);
  Acopy = (dReal*) ALLOCA (nskip*n * sizeof(dReal));
  memcpy (Acopy,A,nskip*n * sizeof(dReal));
  return dFactorCholesky (Acopy,n);
}
开发者ID:2asoft,项目名称:xray-16,代码行数:9,代码来源:matrix.cpp

示例7: dGeomSphereSetRadius

void dGeomSphereSetRadius (dGeomID g, dReal radius)
{
    dUASSERT (g && g->type == dSphereClass,"argument not a sphere");
    dAASSERT (radius >= 0);
    dxSphere *s = (dxSphere*) g;
    s->radius = radius;
    s->updateZeroSizedFlag(!radius);
    dGeomMoved (g);
}
开发者ID:JohnCrash,项目名称:ode,代码行数:9,代码来源:sphere.cpp

示例8: dJointGetAMotorAngle

dReal dJointGetAMotorAngle( dJointID j, int anum )
{
    dxJointAMotor* joint = ( dxJointAMotor* )j;
    dAASSERT( joint && anum >= 0 && anum < 3 );
    checktype( joint, AMotor );
    if ( anum < 0 ) anum = 0;
    if ( anum > 3 ) anum = 3;
    return joint->angle[anum];
}
开发者ID:JdeRobot,项目名称:ThirdParty,代码行数:9,代码来源:amotor.cpp

示例9: dxGeom

dxBox::dxBox (dSpaceID space, dReal lx, dReal ly, dReal lz) : dxGeom (space,1)
{
  dAASSERT (lx >= 0 && ly >= 0 && lz >= 0);
  type = dBoxClass;
  side[0] = lx;
  side[1] = ly;
  side[2] = lz;
  updateZeroSizedFlag(_dequal(lx, 0.0) || _dequal(ly, 0.0) || _dequal(lz, 0.0));
}
开发者ID:JdeRobot,项目名称:ThirdParty,代码行数:9,代码来源:box.cpp

示例10: dxGeom

dxCylinder::dxCylinder (dSpaceID space, dReal _radius, dReal _length) :
dxGeom (space,1)
{
    dAASSERT (_radius >= 0 && _length >= 0);
    type = dCylinderClass;
    radius = _radius;
    lz = _length;
    updateZeroSizedFlag(!_radius || !_length);
}
开发者ID:EdgarSun,项目名称:opende,代码行数:9,代码来源:cylinder.cpp

示例11: dJointGetAMotorAxisRel

int dJointGetAMotorAxisRel( dJointID j, int anum )
{
    dxJointAMotor* joint = ( dxJointAMotor* )j;
    dAASSERT( joint && anum >= 0 && anum < 3 );
    checktype( joint, AMotor );
    if ( anum < 0 ) anum = 0;
    if ( anum > 2 ) anum = 2;
    return joint->rel[anum];
}
开发者ID:JdeRobot,项目名称:ThirdParty,代码行数:9,代码来源:amotor.cpp

示例12: dxGeom

dxCapsule::dxCapsule (dSpaceID space, dReal _radius, dReal _length) :
  dxGeom (space,1)
{
  dAASSERT (_radius >= 0 && _length >= 0);
  type = dCapsuleClass;
  radius = _radius;
  lz = _length;
  updateZeroSizedFlag(!_radius/* || !_length -- zero length capsule is not a zero sized capsule*/);
}
开发者ID:CentreForBioRobotics,项目名称:lpzrobots,代码行数:9,代码来源:capsule.cpp

示例13: dJointGetAMotorAxis

void dJointGetAMotorAxis( dJointID j, int anum, dVector3 result )
{
    dxJointAMotor* joint = ( dxJointAMotor* )j;
    dAASSERT( joint && anum >= 0 && anum < 3 );
    checktype( joint, AMotor );
    if ( anum < 0 ) anum = 0;
    if ( anum > 2 ) anum = 2;
    
    // If we're in Euler mode, joint->axis[1] doesn't
    // have anything sensible in it.  So don't just return
    // that, find the actual effective axis.
    // Likewise, the actual axis of rotation for the
    // the other axes is different from what's stored.
    if ( joint->mode == dAMotorEuler  ) {
      dVector3 axes[3];
      joint->computeGlobalAxes(axes);
      if (anum == 1) {
        result[0]=axes[1][0];
        result[1]=axes[1][1];
        result[2]=axes[1][2];
      } else if (anum == 0) {
        // This won't be unit length in general,
        // but it's what's used in getInfo2
        // This may be why things freak out as
        // the body-relative axes get close to each other.
        dCalcVectorCross3( result, axes[1], axes[2] );
      } else if (anum == 2) {
        // Same problem as above.
        dCalcVectorCross3( result, axes[0], axes[1] );
      }
    } else if ( joint->rel[anum] > 0 ) {
        if ( joint->rel[anum] == 1 )
        {
            dMultiply0_331( result, joint->node[0].body->posr.R, joint->axis[anum] );
        }
        else
        {
            if ( joint->node[1].body )   // jds
            {
                dMultiply0_331( result, joint->node[1].body->posr.R, joint->axis[anum] );
            }
            else
            {
                result[0] = joint->axis[anum][0];
                result[1] = joint->axis[anum][1];
                result[2] = joint->axis[anum][2];
                result[3] = joint->axis[anum][3];
            }
        }
    }
    else
    {
        result[0] = joint->axis[anum][0];
        result[1] = joint->axis[anum][1];
        result[2] = joint->axis[anum][2];
    }
}
开发者ID:JohnCrash,项目名称:ode,代码行数:57,代码来源:amotor.cpp

示例14: dGeomGetOffsetRotation

const dReal * dGeomGetOffsetRotation (dxGeom *g)
{
    dAASSERT (g);
    if (g->offset_posr)
    {
        return g->offset_posr->R;
    }
    return OFFSET_ROTATION_ZERO;
}
开发者ID:JohnCrash,项目名称:ode,代码行数:9,代码来源:collision_kernel.cpp

示例15: dGeomCapsuleSetParams

void dGeomCapsuleSetParams (dGeomID g, dReal radius, dReal length)
{
  dUASSERT (g && g->type == dCapsuleClass,"argument not a ccylinder");
  dAASSERT (radius >= 0 && length >= 0);
  dxCapsule *c = (dxCapsule*) g;
  c->radius = radius;
  c->lz = length;
  c->updateZeroSizedFlag(!radius/* || !length -- zero length capsule is not a zero sized capsule*/);
  dGeomMoved (g);
}
开发者ID:CentreForBioRobotics,项目名称:lpzrobots,代码行数:10,代码来源:capsule.cpp


注:本文中的dAASSERT函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。