本文整理汇总了C#中MegaModifiers.ChangeSourceVerts方法的典型用法代码示例。如果您正苦于以下问题:C# MegaModifiers.ChangeSourceVerts方法的具体用法?C# MegaModifiers.ChangeSourceVerts怎么用?C# MegaModifiers.ChangeSourceVerts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MegaModifiers
的用法示例。
在下文中一共展示了MegaModifiers.ChangeSourceVerts方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Modify
// oPoints whould be verts
public override void Modify(MegaModifiers mc)
{
if ( nonMorphedVerts != null && nonMorphedVerts.Length > 1 )
{
ModifyCompressed(mc);
return;
}
framenum++;
//Vector3[] verts = mc.GetSourceVerts();
mc.ChangeSourceVerts();
//Vector3[] sverts = mc.GetDestVerts();
float fChannelPercent;
Vector3 delt;
// cycle through channels, searching for ones to use
bool firstchan = true;
bool morphed = false;
float min = 0.0f;
float max = 100.0f;
if ( UseLimit )
{
min = Min;
max = Max;
}
for ( int i = 0; i < chanBank.Count; i++ )
{
MegaMorphChan chan = chanBank[i];
chan.UpdatePercent();
//fChannelPercent = Mathf.Clamp(chan.Percent, 0.0f, 100.0f);
if ( UseLimit )
{
fChannelPercent = Mathf.Clamp(chan.Percent, min, max); //chan.mSpinmin, chan.mSpinmax);
}
else
{
if ( chan.mUseLimit )
fChannelPercent = Mathf.Clamp(chan.Percent, chan.mSpinmin, chan.mSpinmax);
else
fChannelPercent = Mathf.Clamp(chan.Percent, 0.0f, 100.0f);
}
//if ( fChannelPercent > 0.0f )
if ( fChannelPercent != 0.0f || (fChannelPercent == 0.0f && chan.fChannelPercent != 0.0f) )
{
chan.fChannelPercent = fChannelPercent;
if ( chan.mTargetCache != null && chan.mTargetCache.Count > 0 && chan.mActiveOverride ) //&& fChannelPercent != 0.0f )
{
morphed = true;
//if ( chanBank[i].mapping == null || chanBank[i].mapping.Length == 0 )
//{
//chanBank[i].ChannelMapping(this);
//}
if ( chan.mUseLimit ) //|| glUseLimit )
{
//if ( glUseLimit )
//fChannelPercent = Mathf.Lerp(glMIN, glMAX, fChannelPercent * 0.01f);
//else
///fChannelPercent = Mathf.Lerp(chan.mSpinmin, chan.mSpinmax, fChannelPercent * 0.01f);
}
if ( firstchan )
{
firstchan = false;
//Debug.Log("diflen " + dif.Length + " opoints " + oPoints.Length);
for ( int pointnum = 0; pointnum < oPoints.Length; pointnum++ )
{
dif[pointnum] = oPoints[pointnum];
}
}
if ( chan.mTargetCache.Count == 1 )
{
//MegaMorphChan chan = chanBank[i];
// Compressed version
#if false
if ( firstchan )
{
firstchan = false;
for ( int pointnum = 0; pointnum < oPoints.Length; pointnum++ )
{
dif[pointnum] = oPoints[pointnum];
delt = chan.mDeltas[pointnum];
dif[pointnum].x += delt.x * fChannelPercent;
dif[pointnum].y += delt.y * fChannelPercent;
dif[pointnum].z += delt.z * fChannelPercent;
}
}
else
#endif
{
//.........这里部分代码省略.........
示例2: ModifyCompressed
public void ModifyCompressed(MegaModifiers mc)
{
framenum++;
mc.ChangeSourceVerts();
float fChannelPercent;
Vector3 delt;
// cycle through channels, searching for ones to use
bool firstchan = true;
bool morphed = false;
for ( int i = 0; i < chanBank.Count; i++ )
{
MegaMorphChan chan = chanBank[i];
chan.UpdatePercent();
fChannelPercent = Mathf.Clamp(chan.Percent, 0.0f, 100.0f);
if ( fChannelPercent > 0.0f || (fChannelPercent == 0.0f && chan.fChannelPercent != 0.0f) )
{
chan.fChannelPercent = fChannelPercent;
if ( chan.mTargetCache != null && chan.mTargetCache.Count > 0 && chan.mActiveOverride ) //&& fChannelPercent != 0.0f )
{
morphed = true;
//if ( chanBank[i].mapping == null || chanBank[i].mapping.Length == 0 )
//{
//chanBank[i].ChannelMapping(this);
//}
if ( chan.mUseLimit ) //|| glUseLimit )
{
//if ( glUseLimit )
//fChannelPercent = Mathf.Lerp(glMIN, glMAX, fChannelPercent * 0.01f);
//else
fChannelPercent = Mathf.Lerp(chan.mSpinmin, chan.mSpinmax, fChannelPercent * 0.01f);
}
// New bit
if ( firstchan )
{
firstchan = false;
// Save a int array of morphedpoints and use that, then only dealing with changed info
for ( int pointnum = 0; pointnum < morphedVerts.Length; pointnum++ )
{
// this will change when we remove points
int p = morphedVerts[pointnum];
dif[p] = oPoints[p]; //morphedVerts[pointnum]];
}
}
// end new
if ( chan.mTargetCache.Count == 1 )
{
//MegaMorphChan chan = chanBank[i];
// Compressed version
#if false
if ( firstchan )
{
firstchan = false;
// Save a int array of morphedpoints and use that, then only dealing with changed info
for ( int pointnum = 0; pointnum < morphedVerts.Length; pointnum++ )
{
// this will change when we remove points
int p = morphedVerts[pointnum];
dif[p] = oPoints[p]; //morphedVerts[pointnum]];
delt = chan.mDeltas[p]; //morphedVerts[pointnum]];
//delt = chan.mDeltas[pointnum]; //morphedVerts[pointnum]];
dif[p].x += delt.x * fChannelPercent;
dif[p].y += delt.y * fChannelPercent;
dif[p].z += delt.z * fChannelPercent;
}
}
else
#endif
{
// Save a int array of morphedpoints and use that, then only dealing with changed info
for ( int pointnum = 0; pointnum < morphedVerts.Length; pointnum++ )
{
int p = morphedVerts[pointnum];
delt = chan.mDeltas[p]; //morphedVerts[pointnum]];
//delt = chan.mDeltas[pointnum]; //morphedVerts[pointnum]];
dif[p].x += delt.x * fChannelPercent;
dif[p].y += delt.y * fChannelPercent;
dif[p].z += delt.z * fChannelPercent;
}
}
}
else
{
int totaltargs = chan.mTargetCache.Count; // + 1; // + 1;
float fProgression = fChannelPercent; //Mathf.Clamp(fChannelPercent, 0.0f, 100.0f);
int segment = 1;
while ( segment <= totaltargs && fProgression >= chan.GetTargetPercent(segment - 2) )
segment++;
//.........这里部分代码省略.........
示例3: Modify
// oPoints whould be verts
public override void Modify(MegaModifiers mc)
{
if ( source == null )
return;
if ( source.nonMorphedVerts != null && source.nonMorphedVerts.Length > 1 )
{
ModifyCompressed(mc);
return;
}
framenum++;
mc.ChangeSourceVerts();
float fChannelPercent;
Vector3 delt;
// cycle through channels, searching for ones to use
bool firstchan = true;
bool morphed = false;
float min = 0.0f;
float max = 100.0f;
if ( UseLimit )
{
min = Min;
max = Max;
}
for ( int i = 0; i < source.chanBank.Count; i++ )
{
MegaMorphChan chan = source.chanBank[i];
// This needs to be local chan list
chan.UpdatePercent();
if ( UseLimit )
{
fChannelPercent = Mathf.Clamp(chan.Percent, min, max); //chan.mSpinmin, chan.mSpinmax);
}
else
{
if ( chan.mUseLimit )
fChannelPercent = Mathf.Clamp(chan.Percent, chan.mSpinmin, chan.mSpinmax);
else
fChannelPercent = Mathf.Clamp(chan.Percent, 0.0f, 100.0f);
}
if ( fChannelPercent != 0.0f || (fChannelPercent == 0.0f && chan.fChannelPercent != 0.0f) )
{
chan.fChannelPercent = fChannelPercent;
if ( chan.mTargetCache != null && chan.mTargetCache.Count > 0 && chan.mActiveOverride ) //&& fChannelPercent != 0.0f )
{
morphed = true;
if ( chan.mUseLimit ) //|| glUseLimit )
{
}
if ( firstchan )
{
firstchan = false;
for ( int pointnum = 0; pointnum < source.oPoints.Length; pointnum++ )
{
dif[pointnum] = source.oPoints[pointnum];
}
}
if ( chan.mTargetCache.Count == 1 )
{
for ( int pointnum = 0; pointnum < source.oPoints.Length; pointnum++ )
{
delt = chan.mDeltas[pointnum];
dif[pointnum].x += delt.x * fChannelPercent;
dif[pointnum].y += delt.y * fChannelPercent;
dif[pointnum].z += delt.z * fChannelPercent;
}
}
else
{
int totaltargs = chan.mTargetCache.Count; // + 1; // + 1;
float fProgression = fChannelPercent; //Mathf.Clamp(fChannelPercent, 0.0f, 100.0f);
int segment = 1;
while ( segment <= totaltargs && fProgression >= chan.GetTargetPercent(segment - 2) )
segment++;
if ( segment > totaltargs )
segment = totaltargs;
p4 = source.oPoints;
if ( segment == 1 )
{
p1 = source.oPoints;
p2 = chan.mTargetCache[0].points; // mpoints
//.........这里部分代码省略.........