本文整理汇总了C++中BodyNode::Initialize方法的典型用法代码示例。如果您正苦于以下问题:C++ BodyNode::Initialize方法的具体用法?C++ BodyNode::Initialize怎么用?C++ BodyNode::Initialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BodyNode
的用法示例。
在下文中一共展示了BodyNode::Initialize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initialize
void Player::Initialize(Graphics *graphics)
{
_moveSpeed = 3.0f;
BodyNode *head = new BodyNode();
head->Initialize(graphics);
head->SetDirection(BodyNode::LEFT);
head->moveSpeed = _moveSpeed;
head->active = true;
numCubes = 1;
// Create first node for the player.
_body.push_back(head);
_difference = 0.0f;
}
示例2: AddBodyPiece
void Player::AddBodyPiece(Graphics *graphics)
{
BodyNode *bodyPiece = new BodyNode();
bodyPiece->Initialize(graphics);
bodyPiece->moveSpeed = _moveSpeed;
_body.size();
// Copy over the information from the previous node.
bodyPiece->GetTransform().position = _body[_body.size() - 1]->GetTransform().position;
bodyPiece->directionChange = _body[_body.size() - 1]->directionChange;
// Add the node to our list.
_body.push_back(bodyPiece);
numCubes++;
_piecesToAdd++;
}