To osg::AutoTransform added support for MinimumScale, MaximumScale and AutoScaleTransitionWidth parameters
and a new scheme for computing the scaling when using autoscale that introduces smooth transitions to the scaling of the subgraph so that it looks more natural.
This commit is contained in:
@@ -37,8 +37,16 @@ void AutoTransform::write(DataOutputStream* out){
|
||||
|
||||
out->writeBool(getAutoScaleToScreen());
|
||||
|
||||
if ( out->getVersion() >= VERSION_0025 )
|
||||
{
|
||||
out->writeFloat(getMinimumScale());
|
||||
out->writeFloat(getMaximumScale());
|
||||
out->writeFloat(getAutoScaleTransistionWidthRatio());
|
||||
}
|
||||
|
||||
out->writeQuat(getRotation());
|
||||
out->writeVec3(getScale());
|
||||
|
||||
}
|
||||
|
||||
void AutoTransform::read(DataInputStream* in){
|
||||
@@ -64,8 +72,17 @@ void AutoTransform::read(DataInputStream* in){
|
||||
|
||||
setAutoScaleToScreen(in->readBool());
|
||||
|
||||
if ( in->getVersion() >= VERSION_0025 )
|
||||
{
|
||||
setMinimumScale(in->readFloat());
|
||||
setMaximumScale(in->readFloat());
|
||||
setAutoScaleTransistionWidthRatio(in->readFloat());
|
||||
}
|
||||
|
||||
setRotation(in->readQuat());
|
||||
setScale(in->readVec3());
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
throw Exception("AutoTransform::read(): Expected AutoTransform identification.");
|
||||
|
||||
@@ -33,8 +33,9 @@
|
||||
#define VERSION_0022 22
|
||||
#define VERSION_0023 23
|
||||
#define VERSION_0024 24
|
||||
#define VERSION_0025 25
|
||||
|
||||
#define VERSION VERSION_0024
|
||||
#define VERSION VERSION_0025
|
||||
|
||||
/* The BYTE_SEX tag is used to check the endian
|
||||
of the IVE file being read in. The IVE format
|
||||
|
||||
Reference in New Issue
Block a user