本文整理汇总了C++中Quat::Equals方法的典型用法代码示例。如果您正苦于以下问题:C++ Quat::Equals方法的具体用法?C++ Quat::Equals怎么用?C++ Quat::Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Quat
的用法示例。
在下文中一共展示了Quat::Equals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteModifiers
//.........这里部分代码省略.........
// Prepare the position chunk
Chunk cPositionChunk;
cPositionChunk.SetSemantic(Chunk::Position);
cPositionChunk.Allocate(Chunk::Float, 3, nFrameCount);
float *pfPositionData = reinterpret_cast<float*>(cPositionChunk.GetData());
// Prepare the rotation chunk
Chunk cRotationChunk;
cRotationChunk.SetSemantic(Chunk::Rotation);
cRotationChunk.Allocate(Chunk::Float, 4, nFrameCount);
float *pfRotationData = reinterpret_cast<float*>(cRotationChunk.GetData());
// Prepare the scale chunk
Chunk cScaleChunk;
cScaleChunk.SetSemantic(Chunk::Scale);
cScaleChunk.Allocate(Chunk::Float, 3, nFrameCount);
float *pfScaleData = reinterpret_cast<float*>(cScaleChunk.GetData());
// Loop through all frames
int nTime = cInterval.Start();
for (int nFrame=0; nFrame<nFrameCount; nFrame++, nTime+=nTicksPerFrame) {
// Get the position, rotation and scale
Point3 vPos, vScale;
Quat qRot;
GetPosRotScale(vPos, qRot, vScale, nTime);
// First frame?
if (!nFrame) {
vFirstPos = vPos;
vFirstScale = vScale;
qFirstRot = qRot;
} else {
if (!vFirstPos.Equals(vPos))
bUsePosition = true;
if (!vFirstScale.Equals(vScale))
bUseScale = true;
if (!qFirstRot.Equals(qRot))
bUseRotation = true;
}
// Position
if (bPositionKeyframes && pfPositionData) {
// Currently ONLY the center of the container the node is in use used to make it relative
const Point3 vParentWorldSpaceCenter = GetContainer() ? GetContainer()->GetWorldSpaceCenter() : Point3(0.0f, 0.0f, 0.0f);
// Get the position
const Point3 vFinalPos = (GetType() != TypeScene && GetType() != TypeCell) ? vPos-vParentWorldSpaceCenter : static_cast<const PLSceneContainer*>(this)->GetWorldSpaceCenter();
// x
*pfPositionData = vFinalPos.x;
pfPositionData++;
// y
*pfPositionData = vFinalPos.y;
pfPositionData++;
// z
*pfPositionData = vFinalPos.z;
pfPositionData++;
}
// Rotation
if (bRotationKeyframes && pfRotationData) {
// [TODO] Check this (why do we need it?)