本文整理汇总了C++中Cube::getMass方法的典型用法代码示例。如果您正苦于以下问题:C++ Cube::getMass方法的具体用法?C++ Cube::getMass怎么用?C++ Cube::getMass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cube
的用法示例。
在下文中一共展示了Cube::getMass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: throwEntity
void Character::throwEntity(){
Cube* cube = dynamic_cast<Cube*>(takenEntity[1]);
cube->setCollide(false);
cube->setV0(((shotForce)*vector3(dir[0],dir1,dir[2]))*(1/cube->getMass())*0.5);
takenEntity[1]->setPos(pos+vector3(0.0,1.4+dir1,0.0)+dir*2);
entityList->insert(++(entityList->begin()),takenEntity[1]); //insert after the first element
takenEntity[1] = NULL;
}
示例2: releaseEntity
void Character::releaseEntity(){
Cube* cube = dynamic_cast<Cube*>(takenEntity[1]);
///TODO
/*GLfloat angle = dir[2]/(dir.length());
angle = (acos(angle)/3.14)*180.0;
cout << angle << endl;
cube->setAngle(angle + cube->getAngle());*/
cube->setCollide(false);
cube->setV0(releaseForce*(1/cube->getMass())*0.5);
takenEntity[1]->setPos(pos+vector3(0.0,1.0+dir1,0.0)+dir*2);
//cout << takenEntity->getPos() << endl;
entityList->insert(++(entityList->begin()),takenEntity[1]); //insert after the first element
takenEntity[1] = NULL;
}