|
@@ -1046,7 +1046,7 @@ function ActionAddMeshFromFile::undo( %this )
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
//------------------------------------------------------------------------------
|
|
// Add/edit collision geometry
|
|
// Add/edit collision geometry
|
|
-function ShapeEditor::doEditCollision( %this, %type, %target, %depth, %merge, %concavity,
|
|
|
|
|
|
+function ShapeEditor::doEditCollision( %this, %type, %target, %fillMode, %depth, %merge, %concavity,
|
|
%maxVerts, %boxMax, %sphereMax, %capsuleMax )
|
|
%maxVerts, %boxMax, %sphereMax, %capsuleMax )
|
|
{
|
|
{
|
|
%colData = ShapeEdColWindow.lastColSettings;
|
|
%colData = ShapeEdColWindow.lastColSettings;
|
|
@@ -1055,16 +1055,18 @@ function ShapeEditor::doEditCollision( %this, %type, %target, %depth, %merge, %c
|
|
|
|
|
|
%action.oldType = getField( %colData, 0 );
|
|
%action.oldType = getField( %colData, 0 );
|
|
%action.oldTarget = getField( %colData, 1 );
|
|
%action.oldTarget = getField( %colData, 1 );
|
|
- %action.oldDepth = getField( %colData, 2 );
|
|
|
|
- %action.oldMerge = getField( %colData, 3 );
|
|
|
|
- %action.oldConcavity = getField( %colData, 4 );
|
|
|
|
- %action.oldMaxVerts = getField( %colData, 5 );
|
|
|
|
- %action.oldBoxMax = getField( %colData, 6 );
|
|
|
|
- %action.oldSphereMax = getField( %colData, 7 );
|
|
|
|
- %action.oldCapsuleMax = getField( %colData, 8 );
|
|
|
|
|
|
+ %action.oldFillMode = getField(%colData, 2);
|
|
|
|
+ %action.oldDepth = getField( %colData, 3 );
|
|
|
|
+ %action.oldMerge = getField( %colData, 4 );
|
|
|
|
+ %action.oldConcavity = getField( %colData, 5 );
|
|
|
|
+ %action.oldMaxVerts = getField( %colData, 6 );
|
|
|
|
+ %action.oldBoxMax = getField( %colData, 7 );
|
|
|
|
+ %action.oldSphereMax = getField( %colData, 8 );
|
|
|
|
+ %action.oldCapsuleMax = getField( %colData, 9 );
|
|
|
|
|
|
%action.newType = %type;
|
|
%action.newType = %type;
|
|
%action.newTarget = %target;
|
|
%action.newTarget = %target;
|
|
|
|
+ %action.newFillMode = %fillMode;
|
|
%action.newDepth = %depth;
|
|
%action.newDepth = %depth;
|
|
%action.newMerge = %merge;
|
|
%action.newMerge = %merge;
|
|
%action.newConcavity = %concavity;
|
|
%action.newConcavity = %concavity;
|
|
@@ -1076,7 +1078,7 @@ function ShapeEditor::doEditCollision( %this, %type, %target, %depth, %merge, %c
|
|
%this.doAction( %action );
|
|
%this.doAction( %action );
|
|
}
|
|
}
|
|
|
|
|
|
-function ActionEditCollision::updateCollision( %this, %type, %target, %depth, %merge, %concavity,
|
|
|
|
|
|
+function ActionEditCollision::updateCollision( %this, %type, %target, %fillMode, %depth, %merge, %concavity,
|
|
%maxVerts, %boxMax, %sphereMax, %capsuleMax )
|
|
%maxVerts, %boxMax, %sphereMax, %capsuleMax )
|
|
{
|
|
{
|
|
%colDetailSize = -1;
|
|
%colDetailSize = -1;
|
|
@@ -1089,7 +1091,7 @@ function ActionEditCollision::updateCollision( %this, %type, %target, %depth, %m
|
|
if ( %index != -1 )
|
|
if ( %index != -1 )
|
|
%colNode = ShapeEditor.shape.getNodeName( %index );
|
|
%colNode = ShapeEditor.shape.getNodeName( %index );
|
|
|
|
|
|
- if(%target $= "Bounds" || %oldTarget $= "Bounds" || %target $= %oldTarget)
|
|
|
|
|
|
+ if(%target $= %oldTarget)
|
|
{
|
|
{
|
|
// First remove the old detail and collision nodes
|
|
// First remove the old detail and collision nodes
|
|
%meshList = ShapeEditor.getDetailMeshList( %colDetailSize );
|
|
%meshList = ShapeEditor.getDetailMeshList( %colDetailSize );
|
|
@@ -1114,7 +1116,7 @@ function ActionEditCollision::updateCollision( %this, %type, %target, %depth, %m
|
|
if ( %type $= "" )
|
|
if ( %type $= "" )
|
|
return;
|
|
return;
|
|
|
|
|
|
- if ( !ShapeEditor.shape.addCollisionDetail( %colDetailSize, %type, %target,
|
|
|
|
|
|
+ if ( !ShapeEditor.shape.addCollisionDetail( %colDetailSize, %type, %target, %fillMode,
|
|
%depth, %merge, %concavity, %maxVerts,
|
|
%depth, %merge, %concavity, %maxVerts,
|
|
%boxMax, %sphereMax, %capsuleMax ) )
|
|
%boxMax, %sphereMax, %capsuleMax ) )
|
|
return false;
|
|
return false;
|
|
@@ -1126,7 +1128,7 @@ function ActionEditCollision::updateCollision( %this, %type, %target, %depth, %m
|
|
for ( %i = 0; %i < %count; %i++ )
|
|
for ( %i = 0; %i < %count; %i++ )
|
|
ShapeEdPropWindow.update_onMeshAdded( getField( %meshList, %i ) );
|
|
ShapeEdPropWindow.update_onMeshAdded( getField( %meshList, %i ) );
|
|
|
|
|
|
- ShapeEdColWindow.lastColSettings = %type TAB %target TAB %depth TAB %merge TAB
|
|
|
|
|
|
+ ShapeEdColWindow.lastColSettings = %type TAB %target TAB %fillMode TAB %depth TAB %merge TAB
|
|
%concavity TAB %maxVerts TAB %boxMax TAB %sphereMax TAB %capsuleMax;
|
|
%concavity TAB %maxVerts TAB %boxMax TAB %sphereMax TAB %capsuleMax;
|
|
ShapeEdColWindow.update_onCollisionChanged();
|
|
ShapeEdColWindow.update_onCollisionChanged();
|
|
|
|
|
|
@@ -1136,7 +1138,7 @@ function ActionEditCollision::updateCollision( %this, %type, %target, %depth, %m
|
|
function ActionEditCollision::doit( %this )
|
|
function ActionEditCollision::doit( %this )
|
|
{
|
|
{
|
|
ShapeEdWaitGui.show( "Generating collision geometry..." );
|
|
ShapeEdWaitGui.show( "Generating collision geometry..." );
|
|
- %success = %this.updateCollision( %this.newType, %this.newTarget, %this.newDepth, %this.newMerge,
|
|
|
|
|
|
+ %success = %this.updateCollision( %this.newType, %this.newTarget, %this.newFillMode, %this.newDepth, %this.newMerge,
|
|
%this.newConcavity, %this.newMaxVerts, %this.newBoxMax,
|
|
%this.newConcavity, %this.newMaxVerts, %this.newBoxMax,
|
|
%this.newSphereMax, %this.newCapsuleMax );
|
|
%this.newSphereMax, %this.newCapsuleMax );
|
|
ShapeEdWaitGui.hide();
|
|
ShapeEdWaitGui.hide();
|
|
@@ -1149,7 +1151,7 @@ function ActionEditCollision::undo( %this )
|
|
Parent::undo( %this );
|
|
Parent::undo( %this );
|
|
|
|
|
|
ShapeEdWaitGui.show( "Generating collision geometry..." );
|
|
ShapeEdWaitGui.show( "Generating collision geometry..." );
|
|
- %this.updateCollision( %this.oldType, %this.oldTarget, %this.oldDepth, %this.oldMerge,
|
|
|
|
|
|
+ %this.updateCollision( %this.oldType, %this.oldTarget, %this.oldFillMode, %this.oldDepth, %this.oldMerge,
|
|
%this.oldConcavity, %this.oldMaxVerts, %this.oldBoxMax,
|
|
%this.oldConcavity, %this.oldMaxVerts, %this.oldBoxMax,
|
|
%this.oldSphereMax, %this.oldCapsuleMax );
|
|
%this.oldSphereMax, %this.oldCapsuleMax );
|
|
ShapeEdWaitGui.hide();
|
|
ShapeEdWaitGui.hide();
|