forked from mirrors/0ad
Actually remove trailing whitespace for non-header files as well.
This was SVN commit r18989.
This commit is contained in:
+16
-16
@@ -140,7 +140,7 @@ void CModel::CalcStaticObjectBounds()
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// CalcAnimatedObjectBound: calculate bounds encompassing all vertex positions for given animation
|
||||
// CalcAnimatedObjectBound: calculate bounds encompassing all vertex positions for given animation
|
||||
void CModel::CalcAnimatedObjectBounds(CSkeletonAnimDef* anim, CBoundingBoxAligned& result)
|
||||
{
|
||||
result.SetEmpty();
|
||||
@@ -215,26 +215,26 @@ const CBoundingBoxAligned CModel::GetObjectSelectionBoundsRec()
|
||||
if (propSelectionBounds.IsEmpty())
|
||||
continue; // submodel does not wish to participate in selection box, exclude it
|
||||
|
||||
// We have the prop's bounds in its own object-space; now we need to transform them so they can be properly added
|
||||
// We have the prop's bounds in its own object-space; now we need to transform them so they can be properly added
|
||||
// to the bounds in our object-space. For that, we need the transform of the prop attachment point.
|
||||
//
|
||||
//
|
||||
// We have the prop point information; however, it's not trivial to compute its exact location in our object-space
|
||||
// since it may or may not be attached to a bone (see SPropPoint), which in turn may or may not be in the middle of
|
||||
// an animation. The bone matrices might be of interest, but they're really only meant to be used for the animation
|
||||
// an animation. The bone matrices might be of interest, but they're really only meant to be used for the animation
|
||||
// system and are quite opaque to use from the outside (see @ref ValidatePosition).
|
||||
//
|
||||
// However, a nice side effect of ValidatePosition is that it also computes the absolute world-space transform of
|
||||
//
|
||||
// However, a nice side effect of ValidatePosition is that it also computes the absolute world-space transform of
|
||||
// our props and sets it on their respective models. In particular, @ref ValidatePosition will compute the prop's
|
||||
// world-space transform as either
|
||||
//
|
||||
//
|
||||
// T' = T x B x O
|
||||
// or
|
||||
// or
|
||||
// T' = T x O
|
||||
//
|
||||
//
|
||||
// where T' is the prop's world-space transform, T is our world-space transform, O is the prop's local
|
||||
// offset/rotation matrix, and B is an optional transformation matrix of the bone the prop is attached to
|
||||
// offset/rotation matrix, and B is an optional transformation matrix of the bone the prop is attached to
|
||||
// (taking into account animation and everything).
|
||||
//
|
||||
//
|
||||
// From this, it is clear that either O or B x O is the object-space transformation matrix of the prop. So,
|
||||
// all we need to do is apply our own inverse world-transform T^(-1) to T' to get our desired result. Luckily,
|
||||
// this is precomputed upon setting the transform matrix (see @ref SetTransform), so it is free to fetch.
|
||||
@@ -253,7 +253,7 @@ const CBoundingBoxAligned CModel::GetObjectSelectionBoundsRec()
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// BuildAnimation: load raw animation frame animation from given file, and build a
|
||||
// BuildAnimation: load raw animation frame animation from given file, and build a
|
||||
// animation specific to this model
|
||||
CSkeletonAnim* CModel::BuildAnimation(const VfsPath& pathname, const CStr& name, int frequency, float speed, float actionpos, float actionpos2, float soundpos)
|
||||
{
|
||||
@@ -376,7 +376,7 @@ void CModel::ValidatePosition()
|
||||
m_BoneMatrices[i].Concatenate(transform);
|
||||
}
|
||||
|
||||
// our own position is now valid; now we can safely update our props' positions without fearing
|
||||
// our own position is now valid; now we can safely update our props' positions without fearing
|
||||
// that doing so will cause a revalidation of this model (see recursion above).
|
||||
m_PositionValid = true;
|
||||
|
||||
@@ -401,7 +401,7 @@ void CModel::ValidatePosition()
|
||||
}
|
||||
|
||||
// Adjust prop height to terrain level when needed
|
||||
if (prop.m_MaxHeight != 0.f || prop.m_MinHeight != 0.f)
|
||||
if (prop.m_MaxHeight != 0.f || prop.m_MinHeight != 0.f)
|
||||
{
|
||||
CVector3D propTranslation = proptransform.GetTranslation();
|
||||
CVector3D objTranslation = m_Transform.GetTranslation();
|
||||
@@ -483,9 +483,9 @@ bool CModel::SetAnimation(CSkeletonAnim* anim, bool once)
|
||||
m_ObjectBounds.SetEmpty();
|
||||
InvalidateBounds();
|
||||
|
||||
// start anim from beginning
|
||||
// start anim from beginning
|
||||
m_AnimTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
m_Anim = anim;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user