本文整理汇总了C++中MatrixF::getForwardVector方法的典型用法代码示例。如果您正苦于以下问题:C++ MatrixF::getForwardVector方法的具体用法?C++ MatrixF::getForwardVector怎么用?C++ MatrixF::getForwardVector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MatrixF
的用法示例。
在下文中一共展示了MatrixF::getForwardVector方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mainLoop
void EditorCamera::mainLoop()
{
if (mRenderCamera == NULL)
return;
mVerticalAngle = mClampF(mVerticalAngle, -4.7f, -1.7f);
VectorF rotation = mTransform.getRotationEuler();
rotation.y = mVerticalAngle;
rotation.z = mHorizontalAngle;
mTransform.setRotation(rotation);
VectorF up(0.0f, 0.0f, 1.0f);
Point3F look;
Point3F cameraForward(1.0f, 0.0f, 0.0f);
bx::vec3MulMtx(look, cameraForward, mTransform.matrix);
if (mForwardVelocity.len() > 0.01f)
{
MatrixF lookMatrix;
bx::mtxLookAt(lookMatrix, mWorldPosition, look, up);
mWorldPosition += (lookMatrix.getForwardVector() * mForwardVelocity.x);
mWorldPosition -= (lookMatrix.getRightVector() * mForwardVelocity.y);
mTransform.setPosition(mWorldPosition);
}
bx::vec3MulMtx(look, cameraForward, mTransform.matrix);
bx::mtxLookAt(mRenderCamera->viewMatrix, mWorldPosition, look, up);
mRenderCamera->position = mWorldPosition;
}
示例2:
void OrientedBox3F::set( const MatrixF& transform, const Point3F& extents )
{
mCenter = transform.getPosition();
mAxes[ RightVector ] = transform.getRightVector();
mAxes[ ForwardVector ] = transform.getForwardVector();
mAxes[ UpVector ] = transform.getUpVector();
mHalfExtents = extents * 0.5f;
_initPoints();
}