修改水

This commit is contained in:
2026-01-01 22:00:33 +08:00
parent 040a222bd6
commit 9ceffccd39
1800 changed files with 103929 additions and 139495 deletions

View File

@@ -18613,6 +18613,36 @@ MonoBehaviour:
- {fileID: 102900000, guid: aa3f5467c0c153642ac320466aee0ec1, type: 3}
FilterEnum: 0
Filter: '*'
- Path: Assets/ResRaw/Prefabs/Line/RopeSegment_1.asset
Address: Plyaer/RopeSegment_1
Type: ObiRopeBlueprint
Bundle: main/plyaer.bundle
Tags:
Group:
Name: Plyaer
Enable: 1
BundleMode: 0
AddressMode: 2
Tags:
Collectors:
- {fileID: 102900000, guid: aa3f5467c0c153642ac320466aee0ec1, type: 3}
FilterEnum: 0
Filter: '*'
- Path: Assets/ResRaw/Prefabs/Line/RopeSegment_2.asset
Address: Plyaer/RopeSegment_2
Type: ObiRopeBlueprint
Bundle: main/plyaer.bundle
Tags:
Group:
Name: Plyaer
Enable: 1
BundleMode: 0
AddressMode: 2
Tags:
Collectors:
- {fileID: 102900000, guid: aa3f5467c0c153642ac320466aee0ec1, type: 3}
FilterEnum: 0
Filter: '*'
- Path: Assets/ResRaw/Prefabs/Line/Spool.mat
Address: Plyaer/Spool
Type: Material

View File

@@ -48,6 +48,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 5
m_NumAlphaKeys: 2
cirrusCloudsWindIntensity: 0.5
@@ -81,6 +82,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 5
m_NumAlphaKeys: 2
flatCloudsAmbientColor:
@@ -110,6 +112,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 4
m_NumAlphaKeys: 2
flatCloudsLightIntensity: 1.014
@@ -128,9 +131,9 @@ MonoBehaviour:
preset: {fileID: 11400000, guid: 0fcdd472bd6a8ec429fc1e9bc978c4fa, type: 2}
showCirrusCloudsControls: 0
show2DCloudsControls: 0
cloudFlatBaseAnim: {x: -0.45774108, y: -0.35202405}
cloudFlatDetailAnim: {x: -0.5011771, y: 0.7554102}
cirrusAnim: {x: 0.61211836, y: 0.95929813}
cloudFlatBaseAnim: {x: -0.19295175, y: -0.61681175}
cloudFlatDetailAnim: {x: 0.8227671, y: -0.5685335}
cirrusAnim: {x: 0.74451214, y: 0.82690436}
--- !u!114 &-6613759932185320841
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -211,7 +214,7 @@ MonoBehaviour:
audioTransitionSpeed: 1
preset: {fileID: 11400000, guid: 8c4e279017d5e44458e3e4663b6ab460, type: 2}
targetWeatherType: {fileID: 11400000, guid: 6c589d06d1746d04a864437f71d0cc30, type: 2}
weatherBlendProgress: 0
weatherBlendProgress: 1
globalAutoWeatherChange: 1
triggerCollider: {fileID: 0}
triggerRB: {fileID: 0}
@@ -264,6 +267,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 3
m_NumAlphaKeys: 2
frontColorGradient1:
@@ -293,6 +297,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 6
m_NumAlphaKeys: 2
frontColorGradient2:
@@ -322,6 +327,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 6
m_NumAlphaKeys: 2
frontColorGradient3:
@@ -351,6 +357,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 6
m_NumAlphaKeys: 2
frontColorGradient4:
@@ -380,6 +387,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 6
m_NumAlphaKeys: 2
frontColorGradient5:
@@ -409,6 +417,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 6
m_NumAlphaKeys: 2
backColorGradient0:
@@ -438,6 +447,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 3
m_NumAlphaKeys: 2
backColorGradient1:
@@ -467,6 +477,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 6
m_NumAlphaKeys: 2
backColorGradient2:
@@ -496,6 +507,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 6
m_NumAlphaKeys: 2
backColorGradient3:
@@ -525,6 +537,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 6
m_NumAlphaKeys: 2
backColorGradient4:
@@ -554,6 +567,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 6
m_NumAlphaKeys: 2
backColorGradient5:
@@ -583,6 +597,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 6
m_NumAlphaKeys: 2
sunDiscColorGradient:
@@ -612,6 +627,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 5
m_NumAlphaKeys: 2
moonColorGradient:
@@ -641,6 +657,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 3
m_NumAlphaKeys: 2
moonGlowColorGradient:
@@ -670,6 +687,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 2
m_NumAlphaKeys: 2
starsTex: {fileID: 8900000, guid: b5a7175da0f133b4d951c19c9c2cebfc, type: 3}
@@ -920,7 +938,7 @@ MonoBehaviour:
lightingModule: {fileID: 1121697361819163703}
reflectionsModule: {fileID: 3003072118128753163}
Sky: {fileID: -1033463005042072443}
fogModule: {fileID: 6137975383063632260}
fogModule: {fileID: 0}
volumetricCloudModule: {fileID: 3171557369469055653}
flatCloudModule: {fileID: -6856645797116724545}
Weather: {fileID: -2780709178333184838}
@@ -1060,6 +1078,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 5
m_NumAlphaKeys: 2
moonColorGradient:
@@ -1089,6 +1108,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 4
m_NumAlphaKeys: 2
sunIntensityCurveHDRP:
@@ -1271,6 +1291,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 2
m_NumAlphaKeys: 2
lightIntensityHDRP: 350
@@ -1378,6 +1399,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 5
m_NumAlphaKeys: 2
ambientEquatorColorGradient:
@@ -1407,6 +1429,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 5
m_NumAlphaKeys: 2
ambientGroundColorGradient:
@@ -1436,6 +1459,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 5
m_NumAlphaKeys: 2
ambientIntensityCurve:
@@ -1667,7 +1691,7 @@ MonoBehaviour:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
temperature: 3.2010436
temperature: 3.1911154
temperatureWeatherMod: 0
temperatureCustomMod: 0
temperatureChangingSpeed: 0.1
@@ -1701,11 +1725,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 456bf221b186fde4096dcf2c1841b35a, type: 3}
m_Name: Quality Module
m_EditorClassIdentifier:
showModuleInspector: 1
showModuleInspector: 0
showSaveLoad: 0
active: 1
Settings:
defaultQuality: {fileID: 11400000, guid: 60e887b1524da0a4a8f1318ef102e22a, type: 2}
defaultQuality: {fileID: 11400000, guid: 2e0aaa075bca92245a9e8300b7eace9c, type: 2}
Qualities:
- {fileID: 11400000, guid: a002704085c17f1439758fcee25df529, type: 2}
- {fileID: 11400000, guid: 2e0aaa075bca92245a9e8300b7eace9c, type: 2}
@@ -2097,6 +2121,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 5
m_NumAlphaKeys: 2
moonLightColorGradient:
@@ -2126,6 +2151,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 3
m_NumAlphaKeys: 2
ambientColorGradient:
@@ -2155,6 +2181,7 @@ MonoBehaviour:
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 5
m_NumAlphaKeys: 2
sunLightColor: {r: 0, g: 0, b: 0, a: 0}
@@ -2179,12 +2206,12 @@ MonoBehaviour:
volumetricClouds: 1
lightningSupport: 1
variableBottomNoise: 0
downsampling: 2
downsampling: 3
stepsLayer1: 128
stepsLayer2: 64
blueNoiseIntensity: 2
reprojectionBlendTime: 2
lodDistance: 0.6
lodDistance: 0.7
preset: {fileID: 11400000, guid: 4b3879673bba3ff488a4b539b4de69b7, type: 2}
showGlobalControls: 1
showVolumeSettings: 0
@@ -2193,9 +2220,9 @@ MonoBehaviour:
showDensityControls: 0
showTextureControls: 0
showWindControls: 0
cloudAnimLayer1: {x: -0.15238605, y: -0.75173455, z: 0.5870752}
cloudAnimLayer1: {x: -0.82855153, y: -0.07499668, z: -0.7368688}
cloudAnimLayer2: {x: -0.4793451, y: 0.47841242, z: 0.015471124}
cloudAnimNonScaledLayer1: {x: -0.31603515, y: -2.1525373, z: -66.53769}
cloudAnimNonScaledLayer1: {x: -0.3054432, y: -2.1631308, z: -66.58966}
cloudAnimNonScaledLayer2: {x: -0.001515836, y: 0.0009908647, z: -0.28406617}
weatherMap: {fileID: 0}
--- !u!114 &4011421771873438716
@@ -2264,616 +2291,6 @@ MonoBehaviour:
aurora_colorshift: {fileID: 2800000, guid: f99b7b1866c1ab3489d848a4ef3dd81b, type: 3}
preset: {fileID: 11400000, guid: 278933d28004c6b40ace276968b45b9e, type: 2}
showAuroraControls: 0
--- !u!114 &6137975383063632260
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4eacb969ef7bfec4ba69d66b0a873f2f, type: 3}
m_Name: Fog Module
m_EditorClassIdentifier:
showModuleInspector: 0
showSaveLoad: 1
active: 1
Settings:
volumetrics: 1
steps: 32
quality: 1
scattering: 0.28
scatteringMultiplier:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 8
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.29862836
value: 7.1266994
inSlope: -7.9367094
outSlope: -7.9367094
tangentMode: 0
weightedMode: 0
inWeight: 0.1494251
outWeight: 0.33333334
- serializedVersion: 3
time: 0.41374835
value: 1.9498584
inSlope: -5.9926996
outSlope: -5.9926996
tangentMode: 0
weightedMode: 0
inWeight: 0.515421
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
extinction: 0.02
anistropy: 0.19
maxRange: 1000
maxRangePointSpot: 100
noiseIntensity: 0
noiseScale: 0
windDirection: {x: 3.9, y: 0, z: 0}
noise: {fileID: 0}
ditheringTex: {fileID: 2800000, guid: 711e788cbc742bb439b3c7cad60651e3, type: 3}
fog: 1
fogQualityMode: 0
floatingPointOriginMod: {x: 0, y: 0, z: 0}
globalFogHeight: 0
fogDensity: 0.015
fogHeightFalloff: 0.0121
fogHeight: 0
fogDensity2: 0.412
fogHeightFalloff2: 0.0388
fogHeight2: 0
fogMaxOpacity: 1
startDistance: 0.01
fogColorBlend: 0.5
fogColorMod: {r: 1, g: 1, b: 1, a: 1}
blockScattering: 1
ambientColorGradient:
serializedVersion: 2
key0: {r: 0.23549305, g: 0.2427107, b: 0.7924528, a: 1}
key1: {r: 0.16073336, g: 0.22812635, b: 0.7924528, a: 1}
key2: {r: 0.35590956, g: 0.44551674, b: 0.5849056, a: 0}
key3: {r: 2.5796902, g: 2.651018, b: 2.8293376, a: 0}
key4: {r: 2.5796902, g: 2.651018, b: 2.8293376, a: 0}
key5: {r: 0, g: 0, b: 0, a: 0}
key6: {r: 0, g: 0, b: 0, a: 0}
key7: {r: 0, g: 0, b: 0, a: 0}
ctime0: 0
ctime1: 29491
ctime2: 33539
ctime3: 65535
ctime4: 65535
ctime5: 0
ctime6: 0
ctime7: 0
atime0: 0
atime1: 65535
atime2: 0
atime3: 0
atime4: 0
atime5: 0
atime6: 0
atime7: 0
m_Mode: 0
m_NumColorKeys: 4
m_NumAlphaKeys: 2
unityFog: 0
unityFogMode: 2
unityFogDensity: 0.002
unityFogStartDistance: 0
unityFogEndDistance: 1000
unityFogColor:
serializedVersion: 2
key0: {r: 0, g: 0, b: 0, a: 1}
key1: {r: 0.0146404365, g: 0.019780159, b: 0.066037714, a: 1}
key2: {r: 0.12589, g: 0.15198022, b: 0.38679248, a: 0}
key3: {r: 0.6415094, g: 0.39747813, b: 0.26326096, a: 0}
key4: {r: 0.53266287, g: 0.63567483, b: 0.8490566, a: 0}
key5: {r: 0.82702917, g: 0.8807278, b: 0.990566, a: 0}
key6: {r: 0, g: 0, b: 0, a: 0}
key7: {r: 0, g: 0, b: 0, a: 0}
ctime0: 0
ctime1: 9830
ctime2: 23130
ctime3: 32768
ctime4: 36430
ctime5: 65535
ctime6: 0
ctime7: 0
atime0: 0
atime1: 65535
atime2: 0
atime3: 0
atime4: 0
atime5: 0
atime6: 0
atime7: 0
m_Mode: 0
m_NumColorKeys: 6
m_NumAlphaKeys: 2
preset: {fileID: 11400000, guid: 6625884995235d049bd7f2f1de182577, type: 2}
showFogControls: 1
showVolumetricsControls: 1
showUnityFogControls: 0
fogLights:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
customFogDensityModifer: 1
fogMat: {fileID: 0}
volumetricsMat: {fileID: 0}
blurMat: {fileID: 0}
blurMat2: {fileID: 0}
volumetricsRenderTexture: {fileID: 0}
--- !u!114 &8141577898218642580
MonoBehaviour:
m_ObjectHideFlags: 0

View File

@@ -22,7 +22,7 @@ MonoBehaviour:
UseScreenSpaceReflectionSky: 1
ScreenSpaceBordersStretching: 0.025
UsePlanarReflection: 0
PlanarCullingMask: -1
PlanarCullingMask: 4513583
PlanarReflectionResolutionQuality: 368
ReflectionClipPlaneOffset: 0.0005
RenderPlanarShadows: 0
@@ -39,7 +39,7 @@ MonoBehaviour:
VolumetricLightIteration: 8
VolumetricLightCausticMode: 0
UseCausticEffect: 1
OceanCausticTextureResolutionQuality: 768
OceanCausticTextureResolutionQuality: 256
UseOceanCausticHighQualityFiltering: 1
UseOceanCausticDispersion: 1
UseUnderwaterEffect: 1
@@ -52,29 +52,29 @@ MonoBehaviour:
levelName: Medium
UseDynamicWaves: 1
UseDynamicWavesWetEffect: 1
UseScreenSpaceReflection: 1
UseScreenSpaceReflection: 0
ScreenSpaceReflectionResolutionQuality: 35
UseScreenSpaceReflectionSky: 1
ScreenSpaceBordersStretching: 0.025
UsePlanarReflection: 0
PlanarCullingMask: -1
PlanarReflectionResolutionQuality: 368
UsePlanarReflection: 1
PlanarCullingMask: 4513583
PlanarReflectionResolutionQuality: 256
ReflectionClipPlaneOffset: 0.0005
RenderPlanarShadows: 0
RenderPlanarVolumetricsAndFog: 0
RenderPlanarClouds: 0
UseAnisotropicReflections: 1
AnisotropicReflectionsHighQuality: 0
RefractionResolution: 50
RefractionResolution: 25
UseRefractionDispersion: 1
UseOceanFoam: 1
UseWetEffect: 1
UseVolumetricLight: 1
VolumetricLightResolutionQuality: 30
VolumetricLightIteration: 8
UseVolumetricLight: 0
VolumetricLightResolutionQuality: 15
VolumetricLightIteration: 2
VolumetricLightCausticMode: 0
UseCausticEffect: 1
OceanCausticTextureResolutionQuality: 768
OceanCausticTextureResolutionQuality: 256
UseOceanCausticHighQualityFiltering: 1
UseOceanCausticDispersion: 1
UseUnderwaterEffect: 1
@@ -87,13 +87,13 @@ MonoBehaviour:
levelName: High
UseDynamicWaves: 1
UseDynamicWavesWetEffect: 1
UseScreenSpaceReflection: 1
UseScreenSpaceReflection: 0
ScreenSpaceReflectionResolutionQuality: 35
UseScreenSpaceReflectionSky: 0
UseScreenSpaceReflectionSky: 1
ScreenSpaceBordersStretching: 0.018
UsePlanarReflection: 0
UsePlanarReflection: 1
PlanarCullingMask: 4513583
PlanarReflectionResolutionQuality: 768
PlanarReflectionResolutionQuality: 256
ReflectionClipPlaneOffset: 0
RenderPlanarShadows: 1
RenderPlanarVolumetricsAndFog: 1
@@ -104,17 +104,17 @@ MonoBehaviour:
UseRefractionDispersion: 0
UseOceanFoam: 1
UseWetEffect: 1
UseVolumetricLight: 1
VolumetricLightResolutionQuality: 40
UseVolumetricLight: 0
VolumetricLightResolutionQuality: 15
VolumetricLightIteration: 8
VolumetricLightCausticMode: 0
VolumetricLightCausticMode: 1
UseCausticEffect: 1
OceanCausticTextureResolutionQuality: 768
OceanCausticTextureResolutionQuality: 128
UseOceanCausticHighQualityFiltering: 1
UseOceanCausticDispersion: 1
UseUnderwaterEffect: 1
MeshDetailingFarDistance: 2000
WaterMeshDetailing: 0
WaterMeshDetailing: 2
WaterTransparentSortingPriority: -1
DrawToPosteffectsDepth: 0
WideAngleCameraRenderingMode: 0
@@ -161,7 +161,7 @@ MonoBehaviour:
ShowVolumetricLightSettings: 1
ShowCausticEffectSettings: 1
ShowUnderwaterEffectSettings: 1
ShowMeshSettings: 1
ShowMeshSettings: 0
ShowRendering: 1
SelectedThirdPartyFogMethod: 0
IsThirdPartyFogAvailable: 1

View File

@@ -1,77 +1,22 @@
# Change Log
All notable changes to “Obi - Advanced ropes for Unity” will be documented in this file.
## [7.1]
## [6.5.4]
### Added
- ObiBone now exposes one particle group per bone in the hierarchy, allowing to easily use attachments.
- New ObiBoneOverride component that allows to override curve-driven properties for a specific sub-hierarchy.
- Solvers can now optionally enforce boundary limits, so that particles can't go outside those limits. This is often more convenient than manually placing invisible colliders for the same purpose.
- Dynamic ObiParticleAttachments now have a "projection" boolean, when enabled it forces the rendered position/orientation of the attached particles to match that of the attachment location, even if the constraint doesn't fully converge. This is useful to avoid visual gaps under extreme conditions.
- Actors now have a "mass scale" parameter, that multiplies the mass of all particles in the blueprinyt at the time of loading it into the solver. This is handy to create actors of different masses without the need to create a new blueprint.
- ObiForceZones now have a "color" parameter, that can be used to change the color of particles entering the zone.
### Fixed
- Workaround for kinematic rigidbody velocities not writable in Unity 2022.1 and above.
## [6.5.3]
### Changed
- Improved performance for large amounts of static colliders: they're not processed at all during ObiSolver.Update().
- Updated UnsafeList with its generic version for supporting newer versions of the Collections package.
### Fixed
- Null reference exception when using a ObiRopeExtrudedRenderer that doesn't reference a section asset.
## [7.0.5]
### Added
- New pinhole constraint type and ObiPinhole component, that allows to constrain ropes to a point in space while allowing it to slide trough it. Supports two-way rigidbody coupling and can be motor driven.
### Fixed
- Erratic bend/twist constraint behavior when darboux vector is close to identity.
- Crash when attempting to bake ObiRopeExtrudedRenderer paired with an ObiPathSmoother that uses a non-zero decimation factor.
- IndexOutOfRangeError when having ropes using multiple different section assets and disabling all rope instances using one of them.
- InvalidOperationException in Burst backend when having simulateWhenInvisible = false and solver not seen by any camera.
## [7.0.4]
### Fixed
- Bug that caused inactive particles to still be rendered by ObiInstancedParticleRenderer.
- Bug that preventing pin constraints' break threshold from working when using the Compute backend.
## [7.0.3]
### Added
- Object layer support for all renderers.
- New "Synchronous Fixed" solver synchronization mode, similar to Obi 6, offers tighter integration with rigidbody physics.
- New "Tangled Ropes" sample scene.
## [7.0.2]
### Fixed
- Solvers not placed at the scene origin would result in actors having incorrect motion blur in HDRP.
- Fixed issue when disabling all solvers and colliders simultaneously: ipon re-enabling them, the colliders would be ignored.
- Issue withe ElectricalSparks sample scene, ObiRopePrefabPlugger sample component may sometimes thorw an exception dependin on Unity's OnEnable call order.
- Rope would sometimes disappear when using aerodynamic constraints with zero wind in Burst, due to a math.project returning NaN. Replaced with math.projectsafe.
## [7.0.1]
### Added
- BakeMesh functionality to ObiRopeChainRenderer, you can now export baked chain meshes.
- Render layer mask support to all rope renderers and particle renderers.
### Fixed
- Sceneview mouse lookaround in flytrough mode (right click + drag) didn't work in the path editor in Windows.
- Having a ObiParticleRenderer with no material applied resulted in a exception in builds due GetInstanceID() returning 0 in editor but raising a nullref exception in the build.
## [7.0]
### Added
- Compute shader based GPU solver backend.
- More efficient solver update cycle, that also removes the need to have ObiUpdater components.
- Aerodynamic constraint support for ObiRope, ObiRod and ObiBone.
## [6.5.2]
### Changed
- Rendering system is now fully multithreaded, integrated with the solver backend.
### Removed
- Native library based 'Oni' solver backend.
- ObiUpdater and all derived classes have been removed.
- Slightly improved overall performance by only updating collision material references during OnValidate()
- Exposed solver.activeParticles and solver.colors as a ObiNativeIntList instead of int[], which allows to use them directly in jobs.
- Updated for compatibility with newest Collections package.
## [6.5.1]

View File

@@ -85,7 +85,7 @@ namespace Obi
EditorGUI.BeginChangeCheck();
meshBasedEditor.particleCulling = (ObiMeshBasedActorBlueprintEditor.ParticleCulling)EditorGUILayout.EnumPopup("Culling", meshBasedEditor.particleCulling);
if (ObiActorBlueprintEditor.selectedCount == 0)
if (editor.selectedCount == 0)
{
EditorGUILayout.HelpBox("Select at least one particle to use selection mask.", MessageType.Info);
selectionMask = false;
@@ -111,16 +111,13 @@ namespace Obi
public override bool Editable(int index)
{
return editor.visible[index] && (!selectionMask || ObiActorBlueprintEditor.selectionStatus[index]);
return editor.visible[index] && (!selectionMask || editor.selectionStatus[index]);
}
public override void OnSceneGUI(SceneView view)
{
if (Camera.current != null)
{
var blueprint = meshBasedEditor.blueprint as ObiMeshBasedActorBlueprint;
paintBrush.raycastTransform = blueprint != null ? Matrix4x4.TRS(Vector3.zero, blueprint.rotation, blueprint.scale) : Matrix4x4.identity;
paintBrush.raycastTarget = meshBasedEditor.sourceMesh;
paintBrush.DoBrush(editor.blueprint.positions);
}

View File

@@ -32,8 +32,8 @@ namespace Obi
public override string GetHelpString()
{
if (ObiActorBlueprintEditor.selectedCount > 0)
return "" + ObiActorBlueprintEditor.selectedCount + " selected particles.";
if (editor.selectedCount > 0)
return "" + editor.selectedCount + " selected particles.";
else
return "No particles selected. Click and drag over particles to select them.";
}
@@ -65,12 +65,12 @@ namespace Obi
{
if ((Event.current.modifiers & EventModifiers.Shift) == 0)
{
for (int p = 0; p < ObiActorBlueprintEditor.selectionStatus.Length; p++)
ObiActorBlueprintEditor.selectionStatus[p] = false;
for (int p = 0; p < editor.selectionStatus.Length; p++)
editor.selectionStatus[p] = false;
}
foreach (int p in group.particleIndices)
ObiActorBlueprintEditor.selectionStatus[p] = true;
editor.selectionStatus[p] = true;
UpdateSelection();
}
@@ -78,9 +78,9 @@ namespace Obi
if (GUI.Button(new Rect(rect.x + rect.width * 0.5f, rect.y, rect.width * 0.5f, EditorGUIUtility.singleLineHeight), "Set", EditorStyles.miniButtonRight))
{
group.particleIndices.Clear();
for (int p = 0; p < ObiActorBlueprintEditor.selectionStatus.Length; p++)
for (int p = 0; p < editor.selectionStatus.Length; p++)
{
if (ObiActorBlueprintEditor.selectionStatus[p])
if (editor.selectionStatus[p])
group.particleIndices.Add(p);
}
}
@@ -95,9 +95,9 @@ namespace Obi
var group = editor.blueprint.AppendNewParticleGroup("new group");
for (int i = 0; i < ObiActorBlueprintEditor.selectionStatus.Length; i++)
for (int i = 0; i < editor.selectionStatus.Length; i++)
{
if (ObiActorBlueprintEditor.selectionStatus[i])
if (editor.selectionStatus[i])
group.particleIndices.Add(i);
}
@@ -116,33 +116,33 @@ namespace Obi
GUILayout.FlexibleSpace();
if (GUILayout.Button(new GUIContent(Resources.Load<Texture2D>("InvertButton"), "Invert selection"), GUILayout.MaxHeight(24), GUILayout.MaxWidth(48)))
{
for (int i = 0; i < ObiActorBlueprintEditor.selectionStatus.Length; i++)
for (int i = 0; i < editor.selectionStatus.Length; i++)
{
if (editor.blueprint.IsParticleActive(i))
ObiActorBlueprintEditor.selectionStatus[i] = !ObiActorBlueprintEditor.selectionStatus[i];
editor.selectionStatus[i] = !editor.selectionStatus[i];
}
UpdateSelection();
}
GUI.enabled = ObiActorBlueprintEditor.selectedCount > 0;
GUI.enabled = editor.selectedCount > 0;
if (GUILayout.Button(new GUIContent(Resources.Load<Texture2D>("ClearButton"), "Clear selection"), GUILayout.MaxHeight(24), GUILayout.MaxWidth(48)))
{
for (int i = 0; i < ObiActorBlueprintEditor.selectionStatus.Length; i++)
ObiActorBlueprintEditor.selectionStatus[i] = false;
for (int i = 0; i < editor.selectionStatus.Length; i++)
editor.selectionStatus[i] = false;
UpdateSelection();
}
if (GUILayout.Button(new GUIContent(Resources.Load<Texture2D>("OptimizeButton"), "Optimize selected"), GUILayout.MaxHeight(24), GUILayout.MaxWidth(48)))
{
Undo.RecordObject(editor.blueprint, "Optimize particles away");
editor.blueprint.RemoveSelectedParticles(ref ObiActorBlueprintEditor.selectionStatus);
editor.blueprint.RemoveSelectedParticles(ref editor.selectionStatus);
editor.Refresh();
}
if (GUILayout.Button(new GUIContent(Resources.Load<Texture2D>("RemoveButton"), "Remove selected"), GUILayout.MaxHeight(24), GUILayout.MaxWidth(48)))
{
Undo.RecordObject(editor.blueprint, "Remove particles");
editor.blueprint.RemoveSelectedParticles(ref ObiActorBlueprintEditor.selectionStatus, false);
editor.blueprint.RemoveSelectedParticles(ref editor.selectionStatus, false);
editor.Refresh();
}
GUI.enabled = true;
@@ -175,12 +175,12 @@ namespace Obi
maxSelectionValue = EditorGUILayout.FloatField("Maximum " + property.name, maxSelectionValue);
if (EditorGUI.EndChangeCheck())
{
for (int i = 0; i < ObiActorBlueprintEditor.selectionStatus.Length; i++)
for (int i = 0; i < editor.selectionStatus.Length; i++)
{
if (editor.blueprint.IsParticleActive(i))
{
var value = property.Get(i);
ObiActorBlueprintEditor.selectionStatus[i] = value >= minSelectionValue && value <= maxSelectionValue;
editor.selectionStatus[i] = value >= minSelectionValue && value <= maxSelectionValue;
}
}
UpdateSelection();
@@ -244,9 +244,9 @@ namespace Obi
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(editor.blueprint, "Set particle property");
for (int i = 0; i < ObiActorBlueprintEditor.selectionStatus.Length; i++)
for (int i = 0; i < editor.selectionStatus.Length; i++)
{
if (!ObiActorBlueprintEditor.selectionStatus[i]) continue;
if (!editor.selectionStatus[i]) continue;
editor.currentProperty.SetDefaultToIndex(i);
}
editor.Refresh();
@@ -287,7 +287,7 @@ namespace Obi
EditorGUILayout.BeginVertical(EditorStyles.inspectorDefaultMargins);
editor.RenderModeSelector();
ObiActorBlueprintEditor.dotRadiusScale = EditorGUILayout.Slider(new GUIContent("Particle dot size"), ObiActorBlueprintEditor.dotRadiusScale, 0, 5);
editor.dotRadiusScale = EditorGUILayout.Slider(new GUIContent("Particle dot size"), editor.dotRadiusScale, 0, 5);
editor.currentProperty.VisualizationOptions();
EditorGUILayout.EndVertical();
@@ -301,31 +301,31 @@ namespace Obi
protected void UpdateSelection()
{
ObiActorBlueprintEditor.selectedCount = 0;
editor.selectedCount = 0;
mixedPropertyValue = false;
// Find out how many selected particles we have, and whether they all have the same value for the current property:
for (int i = 0; i < ObiActorBlueprintEditor.selectionStatus.Length; i++)
for (int i = 0; i < editor.selectionStatus.Length; i++)
{
if (editor.blueprint.IsParticleActive(i) && ObiActorBlueprintEditor.selectionStatus[i])
if (editor.blueprint.IsParticleActive(i) && editor.selectionStatus[i])
{
ObiActorBlueprintEditor.selectedCount++;
editor.selectedCount++;
if (ObiActorBlueprintEditor.activeParticle >= 0)
if (editor.activeParticle >= 0)
{
if (!editor.currentProperty.Equals(ObiActorBlueprintEditor.activeParticle, i))
if (!editor.currentProperty.Equals(editor.activeParticle, i))
mixedPropertyValue = true;
}
else
ObiActorBlueprintEditor.activeParticle = i;
editor.activeParticle = i;
}
else if (ObiActorBlueprintEditor.activeParticle == i)
ObiActorBlueprintEditor.activeParticle = -1;
else if (editor.activeParticle == i)
editor.activeParticle = -1;
}
// Set initial property value:
if (!mixedPropertyValue && ObiActorBlueprintEditor.activeParticle >= 0)
editor.currentProperty.GetDefaultFromIndex(ObiActorBlueprintEditor.activeParticle);
if (!mixedPropertyValue && editor.activeParticle >= 0)
editor.currentProperty.GetDefaultFromIndex(editor.activeParticle);
editor.Repaint();
SceneView.RepaintAll();

View File

@@ -52,7 +52,7 @@ namespace Obi
private void FloatFromTexture(int i, Color color)
{
if (!selectionMask || ObiActorBlueprintEditor.selectionStatus[i])
if (!selectionMask || editor.selectionStatus[i])
{
float value = minPropertyValue + color[(int)textureChannel] * (maxPropertyValue - minPropertyValue);
floatProperty.Set(i, value);
@@ -61,7 +61,7 @@ namespace Obi
private void ColorFromTexture(int i, Color color)
{
if (!selectionMask || ObiActorBlueprintEditor.selectionStatus[i])
if (!selectionMask || editor.selectionStatus[i])
colorProperty.Set(i, color);
}

View File

@@ -57,20 +57,20 @@ namespace Obi
if (GUILayout.Button("Generate tethers",GUILayout.MinHeight(32)))
{
// Select all particles in the tethered groups:
for (int i = 0; i < ObiActorBlueprintEditor.selectionStatus.Length; ++i)
for (int i = 0; i < editor.selectionStatus.Length; ++i)
{
ObiActorBlueprintEditor.selectionStatus[i] = false;
editor.selectionStatus[i] = false;
for (int j = 0; j < tetheredGroups.Length; ++j)
{
if (tetheredGroups[j] && editor.blueprint.groups[j].ContainsParticle(i))
{
ObiActorBlueprintEditor.selectionStatus[i] = true;
editor.selectionStatus[i] = true;
break;
}
}
}
editor.blueprint.GenerateTethers(ObiActorBlueprintEditor.selectionStatus);
editor.blueprint.GenerateTethers(editor.selectionStatus);
editor.Refresh();
}

View File

@@ -17,7 +17,7 @@ namespace Obi
protected override float WeightFromDistance(float distance)
{
// anything outside the brush should have zero weight:
if (distance * EditorGUIUtility.pixelsPerPoint > radius)
if (distance > radius)
return 0;
return 1;
}

View File

@@ -14,27 +14,29 @@ namespace Obi
[CustomEditor(typeof(ObiActorBlueprint), true)]
public class ObiActorBlueprintEditor : Editor, IObiSelectableParticleProvider
{
protected IEnumerator routine;
public List<ObiBlueprintEditorTool> tools = new List<ObiBlueprintEditorTool>();
public int currentToolIndex = 0;
public List<ObiBlueprintPropertyBase> properties = new List<ObiBlueprintPropertyBase>();
protected List<ObiBlueprintPropertyBase> properties = new List<ObiBlueprintPropertyBase>();
public int currentPropertyIndex = 0;
public List<ObiBlueprintRenderMode> renderModes = new List<ObiBlueprintRenderMode>();
protected List<ObiBlueprintRenderMode> renderModes = new List<ObiBlueprintRenderMode>();
public int renderModeFlags = 0;
BooleanPreference showRenderModes;
public bool autoGenerate = false;
public bool editMode = false;
public bool isEditing = false;
protected List<SceneStateCache> m_SceneStates;
protected SceneSetup[] oldSetup;
protected UnityEngine.Object oldSelection;
//Additional status info for all particles:
public static float dotRadiusScale = 1;
public static int selectedCount = 0;
public static int activeParticle = -1;
public static bool[] selectionStatus = new bool[0];
public float dotRadiusScale = 1;
public int selectedCount = 0;
public int activeParticle = -1;
public bool[] selectionStatus = new bool[0];
public bool[] visible = new bool[0];
public Color[] tint = new Color[0];
protected float[] sqrDistanceToCamera = new float[0];
@@ -76,10 +78,6 @@ namespace Obi
public virtual void OnEnable()
{
properties.Clear();
renderModes.Clear();
tools.Clear();
properties.Add(new ObiBlueprintMass(this));
properties.Add(new ObiBlueprintRadius(this));
properties.Add(new ObiBlueprintFilterCategory(this));
@@ -90,12 +88,11 @@ namespace Obi
#if (UNITY_2019_1_OR_NEWER)
renderCallback = new System.Action<ScriptableRenderContext, Camera>((cntxt, cam) => { DrawWithCamera(cam); });
RenderPipelineManager.beginCameraRendering -= renderCallback;
RenderPipelineManager.beginCameraRendering += renderCallback;
#endif
Camera.onPreCull -= DrawWithCamera;
Camera.onPreCull += DrawWithCamera;
SceneView.duringSceneGui += OnSceneGUI;
EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
}
public virtual void OnDisable()
@@ -106,8 +103,8 @@ namespace Obi
RenderPipelineManager.beginCameraRendering -= renderCallback;
#endif
Camera.onPreCull -= DrawWithCamera;
SceneView.duringSceneGui -= OnSceneGUI;
EditorApplication.playModeStateChanged -= OnPlayModeStateChanged;
ObiParticleEditorDrawing.DestroyParticlesMesh();
foreach (var tool in tools)
{
@@ -119,77 +116,51 @@ namespace Obi
{
renderMode.OnDestroy();
}
properties.Clear();
renderModes.Clear();
}
void OnPlayModeStateChanged(PlayModeStateChange playmodeState)
protected void Generate()
{
if (playmodeState == PlayModeStateChange.ExitingEditMode)
{
if (StageUtility.GetCurrentStage() is ObiActorBlueprintEditorStage)
StageUtility.GoToMainStage();
}
}
protected bool Generate()
{
if (!blueprint.edited)
if (blueprint.empty)
{
EditorUtility.SetDirty(target);
CoroutineJob job = new CoroutineJob();
IEnumerator routine = job.Start(blueprint.Generate());
EditorCoroutine.ShowCoroutineProgressBar("Generating blueprint...", routine);
routine = job.Start(blueprint.Generate());
EditorCoroutine.ShowCoroutineProgressBar("Generating blueprint...", ref routine);
Refresh();
EditorGUIUtility.ExitGUI();
}
else
{
if (EditorUtility.DisplayDialog("Blueprint generation", "This blueprint contains manually edited data. If you regenerate the blueprint, these changes will be lost. Are you sure you want to proceed?", "Ok", "Cancel"))
if (EditorUtility.DisplayDialog("Blueprint generation", "This blueprint already contains data. Are you sure you want to re-generate this blueprint from scratch?", "Ok", "Cancel"))
{
EditorUtility.SetDirty(target);
CoroutineJob job = new CoroutineJob();
IEnumerator routine = job.Start(blueprint.Generate());
EditorCoroutine.ShowCoroutineProgressBar("Generating blueprint...", routine);
routine = job.Start(blueprint.Generate());
EditorCoroutine.ShowCoroutineProgressBar("Generating blueprint...", ref routine);
Refresh();
EditorGUIUtility.ExitGUI();
}
else return false;
}
return true;
}
protected virtual bool ValidateBlueprint() { return true; }
private void DrawGenerationControls()
{
GUILayout.BeginHorizontal();
float originalLabelWidth = EditorGUIUtility.labelWidth;
EditorGUIUtility.labelWidth = 72;
autoGenerate = EditorGUILayout.ToggleLeft("Auto Generate", autoGenerate, GUILayout.ExpandWidth(false));
EditorGUIUtility.labelWidth = originalLabelWidth;
GUI.enabled = !autoGenerate;
if (GUILayout.Button("Generate", GUI.skin.FindStyle("LargeButton"), GUILayout.Height(32)))
Generate();
GUILayout.EndHorizontal();
}
public override void OnInspectorGUI()
{
serializedObject.UpdateIfRequiredOrScript();
EditorGUILayout.BeginVertical(EditorStyles.inspectorDefaultMargins);
EditorGUI.BeginChangeCheck();
DrawBlueprintProperties();
bool blueprintPropertiesChanged = EditorGUI.EndChangeCheck();
bool blueprintValid = ValidateBlueprint();
GUILayout.Space(10);
GUI.enabled = blueprintValid;
DrawGenerationControls();
GUI.enabled = ValidateBlueprint();
if (GUILayout.Button("Generate", GUI.skin.FindStyle("LargeButton"), GUILayout.Height(32)))
Generate();
GUI.enabled = (blueprint != null && !blueprint.empty && !Application.isPlaying);
EditorGUI.BeginChangeCheck();
@@ -209,10 +180,7 @@ namespace Obi
if (GUI.changed)
{
serializedObject.ApplyModifiedPropertiesWithoutUndo();
if (autoGenerate && blueprintValid && blueprintPropertiesChanged)
blueprint.GenerateImmediate();
serializedObject.ApplyModifiedProperties();
// There might be blueprint editing operations that have no undo entry, so do this to
// ensure changes are serialized to disk by Unity.
@@ -238,17 +206,51 @@ namespace Obi
}
}
[System.Serializable]
protected class SceneStateCache
{
public SceneView view;
public SceneView.SceneViewState state;
}
void EnterBlueprintEditMode()
{
if (!isEditing)
{
ActiveEditorTracker.sharedTracker.isLocked = true;
#if (UNITY_2019_1_OR_NEWER)
SceneView.duringSceneGui -= this.OnSceneGUI;
SceneView.duringSceneGui += this.OnSceneGUI;
#else
SceneView.onSceneGUIDelegate -= this.OnSceneGUI;
SceneView.onSceneGUIDelegate += this.OnSceneGUI;
#endif
string assetPath = AssetDatabase.GetAssetPath(blueprint);
ObiActorBlueprintEditorStage stage = ObiActorBlueprintEditorStage.CreateStage(assetPath, this);
StageUtility.GoToStage(stage, true);
oldSelection = Selection.activeObject;
if (EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo())
{
ActiveEditorTracker.sharedTracker.isLocked = true;
isEditing = true;
oldSetup = EditorSceneManager.GetSceneManagerSetup();
EditorSceneManager.NewScene(NewSceneSetup.EmptyScene);
// Set properties for all scene views:
m_SceneStates = new List<SceneStateCache>();
foreach (SceneView s in SceneView.sceneViews)
{
m_SceneStates.Add(new SceneStateCache { state = new SceneView.SceneViewState(s.sceneViewState), view = s });
s.sceneViewState.showFlares = false;
s.sceneViewState.alwaysRefresh = false;
s.sceneViewState.showFog = false;
s.sceneViewState.showSkybox = false;
s.sceneViewState.showImageEffects = false;
s.sceneViewState.showParticleSystems = false;
s.Frame(blueprint.bounds);
}
isEditing = true;
Repaint();
}
}
}
@@ -256,16 +258,50 @@ namespace Obi
{
if (isEditing)
{
isEditing = false;
AssetDatabase.SaveAssets();
StageUtility.GoToMainStage();
}
}
public void CleanupEditor()
{
ActiveEditorTracker.sharedTracker.isLocked = false;
ObiParticleEditorDrawing.DestroyParticlesMesh();
isEditing = false;
AssetDatabase.SaveAssets();
// Reset all scene views:
foreach (var state in m_SceneStates)
{
if (state.view == null)
continue;
state.view.sceneViewState.showFog = state.state.showFog;
state.view.sceneViewState.showFlares = state.state.showFlares;
state.view.sceneViewState.alwaysRefresh = state.state.alwaysRefresh;
state.view.sceneViewState.showSkybox = state.state.showSkybox;
state.view.sceneViewState.showImageEffects = state.state.showImageEffects;
state.view.sceneViewState.showParticleSystems = state.state.showParticleSystems;
}
ActiveEditorTracker.sharedTracker.isLocked = false;
if (SceneManager.GetActiveScene().path.Length <= 0)
{
if (oldSetup != null && oldSetup.Length > 0)
{
EditorSceneManager.RestoreSceneManagerSetup(oldSetup);
oldSetup = null;
}
else
{
EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects);
}
}
Selection.activeObject = oldSelection;
#if (UNITY_2019_1_OR_NEWER)
SceneView.duringSceneGui -= this.OnSceneGUI;
#else
SceneView.onSceneGUIDelegate -= this.OnSceneGUI;
#endif
Repaint();
}
}
public virtual void OnSceneGUI(SceneView sceneView)
@@ -282,7 +318,7 @@ namespace Obi
{
// Update camera facing status and world space positions array:
UpdateParticleVisibility(sceneView.camera);
UpdateParticleVisibility();
// Generate sorted indices for back-to-front rendering:
for (int i = 0; i < sortedIndices.Length; i++)
@@ -303,7 +339,7 @@ namespace Obi
UpdateTintColor();
// Draw particle handles:
ObiParticleEditorDrawing.DrawParticles(sceneView.camera, blueprint, visible, tint, sortedIndices, dotRadiusScale);
ObiParticleEditorDrawing.DrawParticles(sceneView.camera, blueprint, activeParticle, visible, tint, sortedIndices, dotRadiusScale);
}
@@ -334,7 +370,6 @@ namespace Obi
{
if (blueprint.positions != null)
{
activeParticle = Mathf.Min(activeParticle, blueprint.positions.Length - 1);
Array.Resize(ref selectionStatus, blueprint.positions.Length);
Array.Resize(ref visible, blueprint.positions.Length);
Array.Resize(ref tint, blueprint.positions.Length);
@@ -378,9 +413,7 @@ namespace Obi
public void Refresh()
{
// currentProperty might be null after reloading editor during
// asset saving.
currentProperty?.RecalculateMinMax();
currentProperty.RecalculateMinMax();
// refresh render modes:
for (int i = 0; i < renderModes.Count; ++i)
@@ -392,7 +425,7 @@ namespace Obi
SceneView.RepaintAll();
}
public virtual void UpdateParticleVisibility(Camera cam)
public virtual void UpdateParticleVisibility()
{
for (int i = 0; i < blueprint.positions.Length; i++)
@@ -403,7 +436,7 @@ namespace Obi
if (Camera.current != null)
{
Vector3 camToParticle = cam.transform.position - blueprint.positions[i];
Vector3 camToParticle = Camera.current.transform.position - blueprint.positions[i];
sqrDistanceToCamera[i] = camToParticle.sqrMagnitude;
}
}

View File

@@ -1,72 +0,0 @@
using System;
using System.IO;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
namespace Obi
{
[Serializable]
class ObiActorBlueprintEditorStage : PreviewSceneStage
{
ObiActorBlueprintEditor m_BlueprintEditor;
string m_AssetPath;
public override string assetPath { get { return m_AssetPath; } }
internal static ObiActorBlueprintEditorStage CreateStage(string assetPath, ObiActorBlueprintEditor avatarEditor)
{
ObiActorBlueprintEditorStage stage = CreateInstance<ObiActorBlueprintEditorStage>();
stage.Init(assetPath, avatarEditor);
return stage;
}
private void Init(string modelAssetPath, ObiActorBlueprintEditor avatarEditor)
{
m_AssetPath = modelAssetPath;
m_BlueprintEditor = avatarEditor;
}
protected override bool OnOpenStage()
{
base.OnOpenStage();
if (!File.Exists(assetPath))
{
Debug.LogError("ActivateStage called on BlueprintStage with an invalid path: Blueprint file not found " + assetPath);
return false;
}
return true;
}
protected override void OnCloseStage()
{
m_BlueprintEditor.CleanupEditor();
base.OnCloseStage();
}
protected override void OnFirstTimeOpenStageInSceneView(SceneView sceneView)
{
// Frame in scene view
sceneView.Frame(m_BlueprintEditor.blueprint.bounds);
// Setup Scene view state
sceneView.sceneViewState.showFlares = false;
sceneView.sceneViewState.alwaysRefresh = false;
sceneView.sceneViewState.showFog = false;
sceneView.sceneViewState.showSkybox = false;
sceneView.sceneViewState.showImageEffects = false;
sceneView.sceneViewState.showParticleSystems = false;
sceneView.sceneLighting = true;
}
protected override GUIContent CreateHeaderContent()
{
return new GUIContent(
"Blueprint Editor",
Resources.Load<Texture2D>("Icons/ObiActorBlueprint Icon"));
}
}
}

View File

@@ -18,7 +18,6 @@ namespace Obi
}
protected Mesh visualizationMesh;
protected Mesh visualizationWireMesh;
public ParticleCulling particleCulling = ParticleCulling.Back;
protected Material gradientMaterial;
@@ -76,50 +75,46 @@ namespace Obi
public abstract int VertexToParticle(int vertexIndex);
public override void UpdateParticleVisibility(Camera cam)
public override void UpdateParticleVisibility()
{
if (cam != null)
if (sourceMesh != null && Camera.current != null)
{
for (int i = 0; i < blueprint.positions.Length; i++)
Vector3[] meshNormals = sourceMesh.normals;
for (int i = 0; i < sourceMesh.vertexCount; i++)
{
if (blueprint.IsParticleActive(i))
{
Vector3 camToParticle = cam.transform.position - blueprint.positions[i];
sqrDistanceToCamera[i] = camToParticle.sqrMagnitude;
int particle = VertexToParticle(i);
Vector3 normal;
if (particle >= 0 && particle < blueprint.positions.Length)
{
Vector3 camToParticle = Camera.current.transform.position - blueprint.positions[particle];
sqrDistanceToCamera[particle] = camToParticle.sqrMagnitude;
switch (particleCulling)
{
case ParticleCulling.Off:
visible[i] = true;
visible[particle] = true;
break;
case ParticleCulling.Back:
normal = blueprint.restOrientations[i] * Vector3.forward;
visible[i] = Vector3.Dot(normal, camToParticle) > 0;
visible[particle] = Vector3.Dot(meshNormals[i], camToParticle) > 0;
break;
case ParticleCulling.Front:
normal = blueprint.restOrientations[i] * Vector3.forward;
visible[i] = Vector3.Dot(normal, camToParticle) <= 0;
visible[particle] = Vector3.Dot(meshNormals[i], camToParticle) <= 0;
break;
}
}
}
if ((renderModeFlags & 1) != 0)
Refresh();
}
}
public void DrawGradientMesh(float[] vertexWeights = null, float[] wireframeWeights = null)
{
// Due to this Unity bug: https://issuetracker.unity3d.com/issues/drawmeshnow-is-not-drawing-mesh-immediately-dx12
// we need to create two meshes insteaf of one :(
if (sourceMesh == null)
return;
visualizationMesh = GameObject.Instantiate(sourceMesh);
visualizationWireMesh = GameObject.Instantiate(sourceMesh);
if (gradientMaterial.SetPass(0))
{
@@ -162,16 +157,15 @@ namespace Obi
colors[i] = Color.gray;
}
visualizationWireMesh.colors = colors;
visualizationMesh.colors = colors;
GL.wireframe = true;
Graphics.DrawMeshNow(visualizationWireMesh, matrix);
Graphics.DrawMeshNow(visualizationMesh, matrix);
GL.wireframe = false;
}
}
GameObject.DestroyImmediate(visualizationMesh);
GameObject.DestroyImmediate(visualizationWireMesh);
}
@@ -229,8 +223,7 @@ namespace Obi
RenderTexture.active = tempRT;
GL.PushMatrix();
var proj = Matrix4x4.Ortho(0, 1, 0, 1, -1, 1);
GL.LoadProjectionMatrix(Matrix4x4.Ortho(0, 1, 0, 1, -1, 1));
Color[] colors = new Color[sourceMesh.vertexCount];
for (int i = 0; i < colors.Length; i++)

View File

@@ -32,7 +32,7 @@ namespace Obi
GameObject.DestroyImmediate(particlesMesh);
}
public static void DrawParticles(Camera cam, ObiActorBlueprint blueprint, bool[] visible, Color[] baseColor, int[] sortedIndices, float radiusScale = 1)
public static void DrawParticles(Camera cam, ObiActorBlueprint blueprint, int activeParticle, bool[] visible, Color[] baseColor, int[] sortedIndices, float radiusScale = 1)
{
CreateParticlesMesh();
CreateParticleMaterials();

View File

@@ -22,7 +22,6 @@ namespace Obi
public override void Set(int index, Color value)
{
editor.blueprint.colors[index] = value;
editor.blueprint.edited = true;
}
public override bool Masked(int index)
{

View File

@@ -22,7 +22,6 @@ namespace Obi
public override void Set(int index, int value)
{
editor.blueprint.filters[index] = ObiUtils.MakeFilter(ObiUtils.GetMaskFromFilter(editor.blueprint.filters[index]), value);
editor.blueprint.edited = true;
}
public override bool Masked(int index)
{

View File

@@ -22,7 +22,6 @@
public override void Set(int index, int value)
{
editor.blueprint.filters[index] = ObiUtils.MakeFilter(value,ObiUtils.GetCategoryFromFilter(editor.blueprint.filters[index]));
editor.blueprint.edited = true;
}
public override bool Masked(int index)
{

View File

@@ -23,7 +23,6 @@ namespace Obi
public override void Set(int index, float value)
{
editor.blueprint.invMasses[index] = ObiUtils.MassToInvMass(value);
editor.blueprint.edited = true;
}
public override bool Masked(int index)
{

View File

@@ -27,7 +27,6 @@ namespace Obi
value = Mathf.Max(0.0000001f, value);
float ratio = value / Get(index);
editor.blueprint.principalRadii[index] = editor.blueprint.principalRadii[index] * ratio;
editor.blueprint.edited = true;
}
public override bool Masked(int index)
{

View File

@@ -24,10 +24,10 @@ namespace Obi
{
ObiPaintBrushEditorTool paintTool = (ObiPaintBrushEditorTool)meshBasedEditor.currentTool;
float[] weights = new float[ObiActorBlueprintEditor.selectionStatus.Length];
float[] weights = new float[editor.selectionStatus.Length];
for (int i = 0; i < weights.Length; i++)
{
if (paintTool.selectionMask && !ObiActorBlueprintEditor.selectionStatus[i])
if (paintTool.selectionMask && !editor.selectionStatus[i])
weights[i] = 0;
else
weights[i] = 1;

View File

@@ -13,13 +13,11 @@ namespace Obi
private Shader shader;
private Material material;
private ParticleImpostorRendering impostorDrawer;
private MaterialPropertyBlock mpb;
public ObiBlueprintRenderModeParticles(ObiActorBlueprintEditor editor) :base(editor)
{
impostorDrawer = new ParticleImpostorRendering();
impostorDrawer.UpdateMeshes(editor.blueprint);
mpb = new MaterialPropertyBlock();
}
void CreateMaterialIfNeeded()
@@ -45,10 +43,8 @@ namespace Obi
public override void DrawWithCamera(Camera camera)
{
CreateMaterialIfNeeded();
mpb.SetFloat("_RadiusScale", 1);
mpb.SetColor("_ParticleColor", Color.white);
foreach (Mesh mesh in impostorDrawer.Meshes)
Graphics.DrawMesh(mesh, Matrix4x4.identity, material, 0, camera, 0, mpb);
Graphics.DrawMesh(mesh, Matrix4x4.identity, material, 0, camera);
}
public override void Refresh()

View File

@@ -1,12 +1,11 @@
using UnityEditor;
using UnityEngine;
namespace Obi
{
[CustomEditor(typeof(ObiColliderBase), true), CanEditMultipleObjects]
public class ObiColliderEditor : Editor
{
namespace Obi{
[CustomEditor(typeof(ObiColliderBase), true), CanEditMultipleObjects]
public class ObiColliderEditor : Editor
{
ObiColliderBase collider;
SerializedProperty collisionFilter;
@@ -17,42 +16,11 @@ namespace Obi
collisionFilter = serializedObject.FindProperty("filter");
}
protected void NonReadableMeshWarning(Mesh mesh)
{
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
Texture2D icon = EditorGUIUtility.Load("icons/console.erroricon.png") as Texture2D;
EditorGUILayout.LabelField(new GUIContent("The input mesh is not readable. Read/Write must be enabled in the mesh import settings.", icon), EditorStyles.wordWrappedMiniLabel);
EditorGUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
if (GUILayout.Button("Fix now", GUILayout.MaxWidth(100), GUILayout.MinHeight(32)))
{
string assetPath = AssetDatabase.GetAssetPath(mesh);
ModelImporter modelImporter = AssetImporter.GetAtPath(assetPath) as ModelImporter;
if (modelImporter != null)
{
modelImporter.isReadable = true;
}
modelImporter.SaveAndReimport();
}
EditorGUILayout.EndHorizontal();
EditorGUILayout.EndVertical();
}
public override void OnInspectorGUI()
{
serializedObject.UpdateIfRequiredOrScript();
foreach (ObiColliderBase t in targets)
{
ObiMeshShapeTracker meshTracker = t.Tracker as ObiMeshShapeTracker;
if (meshTracker != null)
{
if (meshTracker.targetMesh != null && !meshTracker.targetMesh.isReadable)
NonReadableMeshWarning(meshTracker.targetMesh);
}
}
var rect = EditorGUILayout.GetControlRect();
var label = EditorGUI.BeginProperty(rect, new GUIContent("Collision category"), collisionFilter);
@@ -88,13 +56,8 @@ namespace Obi
}
EditorGUI.EndProperty();
DrawPropertiesExcluding(serializedObject, "m_Script", "CollisionMaterial", "filter", "Thickness", "Inverted");
foreach (ObiColliderBase t in targets)
{
if (!t.gameObject.isStatic)
t.ForceUpdate();
}
DrawPropertiesExcluding(serializedObject, "m_Script", "CollisionMaterial", "filter", "Thickness");
// Apply changes to the serializedProperty
if (GUI.changed)

View File

@@ -68,7 +68,7 @@ namespace Obi{
EditorUtility.SetDirty(target);
CoroutineJob job = new CoroutineJob();
routine = job.Start( distanceField.Generate());
EditorCoroutine.ShowCoroutineProgressBar("Generating distance field", routine);
EditorCoroutine.ShowCoroutineProgressBar("Generating distance field",ref routine);
UpdatePreview();
EditorGUIUtility.ExitGUI();
}

View File

@@ -1,30 +0,0 @@
using UnityEditor;
using UnityEngine;
namespace Obi
{
/**
* Custom inspector for ObiForceZone component.
*/
[CustomEditor(typeof(ObiForceZone)), CanEditMultipleObjects]
public class ObiForceZoneEditor : Editor
{
public override void OnInspectorGUI()
{
serializedObject.UpdateIfRequiredOrScript();
DrawPropertiesExcluding(serializedObject, "m_Script");
// Apply changes to the serializedProperty
if (GUI.changed)
serializedObject.ApplyModifiedProperties();
}
}
}

View File

@@ -24,20 +24,10 @@ namespace Obi
GUI.Box(position,"",ObiEditorUtils.GetToggleablePropertyGroupStyle());
GUI.enabled = true;
// Draw main constraint toggle:
EditorGUI.BeginProperty(position, label, enabled);
EditorGUI.BeginChangeCheck();
var newEnabled = EditorGUI.ToggleLeft(contRect, label.text, enabled.boolValue, EditorStyles.boldLabel);
// Only assign the value back if it was actually changed by the user.
// Otherwise a single value will be assigned to all objects when multi-object editing,
// even when the user didn't touch the control.
if (EditorGUI.EndChangeCheck())
{
enabled.boolValue = newEnabled;
}
EditorGUI.EndProperty();
// Draw main constraint toggle:
enabled.boolValue = EditorGUI.ToggleLeft(contRect, label.text, enabled.boolValue, EditorStyles.boldLabel);
if (enabled.boolValue){
if (enabled.boolValue){
Rect evalRect = new Rect(position.x+padding, position.y+propHeight+padding, position.width-padding*2, propHeight);
Rect iterRect = new Rect(position.x+padding, position.y+propHeight*2+padding, position.width-padding*2, propHeight);

View File

@@ -1,12 +1,10 @@
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
using System.Collections;
namespace Obi
{
public class ObiEditorSettings : ScriptableObject
class ObiEditorSettings : ScriptableObject
{
public const string m_ObiEditorSettingsPath = "Assets/ObiEditorSettings.asset";
@@ -16,7 +14,6 @@ namespace Obi
[SerializeField] private Color m_SelectedParticle;
[SerializeField] private Color m_ActiveParticle;
[SerializeField] private Gradient m_PropertyGradient;
[SerializeField] private bool m_ParticlePicking;
public Color brushColor
{
@@ -42,13 +39,8 @@ namespace Obi
{
get { return m_PropertyGradient; }
}
public bool sceneViewParticlePicking
{
get { return m_ParticlePicking; }
}
#if UNITY_EDITOR
public static ObiEditorSettings GetOrCreateSettings()
internal static ObiEditorSettings GetOrCreateSettings()
{
var settings = AssetDatabase.LoadAssetAtPath<ObiEditorSettings>(m_ObiEditorSettingsPath);
if (settings == null)
@@ -60,7 +52,6 @@ namespace Obi
settings.m_SelectedParticle = new Color32(243, 77, 43, 255);
settings.m_ActiveParticle = new Color32(243, 243, 43, 255);
settings.m_PropertyGradient = new Gradient();
settings.m_ParticlePicking = true;
// Populate the color keys at the relative time 0 and 1 (0 and 100%)
var colorKey = new GradientColorKey[2];
@@ -84,11 +75,9 @@ namespace Obi
return settings;
}
public static SerializedObject GetSerializedSettings()
internal static SerializedObject GetSerializedSettings()
{
return new SerializedObject(GetOrCreateSettings());
}
#endif
}
}

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using UnityEditor;
namespace Obi
{
[InitializeOnLoad]
public class ObiOniInitialize
{
private static BuildTargetGroup[] supportedBuildTargetGroups =
{
BuildTargetGroup.Standalone,
BuildTargetGroup.Android,
BuildTargetGroup.iOS
};
static ObiOniInitialize()
{
foreach(var group in supportedBuildTargetGroups)
{
var defines = GetDefinesList(group);
if (!defines.Contains("OBI_ONI_SUPPORTED"))
{
defines.Add("OBI_ONI_SUPPORTED");
PlayerSettings.SetScriptingDefineSymbolsForGroup(group, string.Join(";", defines.ToArray()));
}
}
}
private static List<string> GetDefinesList(BuildTargetGroup group)
{
return new List<string>(PlayerSettings.GetScriptingDefineSymbolsForGroup(group).Split(';'));
}
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: b9656e2c54d9e4c478c74ca6d97428f8
guid: e97d151316d5f4d16ac5ae6e68acccb6
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -15,9 +15,7 @@ namespace Obi
public static GUIContent brushWireframe = new GUIContent("Brush wireframe");
public static GUIContent particle = new GUIContent("Particle");
public static GUIContent selectedParticle = new GUIContent("Selected particle");
public static GUIContent activeParticle = new GUIContent("Active particle");
public static GUIContent propertyGradient = new GUIContent("Property gradient");
public static GUIContent particlePicking = new GUIContent("Particle GO picking");
}
const string m_ObiEditorSettingsPath = "Assets/ObiEditorSettings.asset";
@@ -54,11 +52,7 @@ namespace Obi
EditorGUILayout.PropertyField(m_ObiSettings.FindProperty("m_BrushWireframe"),Styles.brushWireframe);
EditorGUILayout.PropertyField(m_ObiSettings.FindProperty("m_Particle"),Styles.particle);
EditorGUILayout.PropertyField(m_ObiSettings.FindProperty("m_SelectedParticle"),Styles.selectedParticle);
EditorGUILayout.PropertyField(m_ObiSettings.FindProperty("m_ActiveParticle"), Styles.activeParticle);
EditorGUILayout.PropertyField(m_ObiSettings.FindProperty("m_PropertyGradient"), Styles.propertyGradient);
EditorGUILayout.LabelField("Scene view", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(m_ObiSettings.FindProperty("m_ParticlePicking"), Styles.particlePicking);
}
// Register the SettingsProvider

View File

@@ -1,6 +1,5 @@
using UnityEditor;
using UnityEngine;
using UnityEditor.IMGUI.Controls;
using UnityEditorInternal;
using System;
using System.Collections;
@@ -41,34 +40,13 @@ namespace Obi
ObiSolver solver;
SerializedProperty backend;
SerializedProperty substeps;
SerializedProperty maxStepsPerFrame;
SerializedProperty synchronization;
SerializedProperty simulateWhenInvisible;
SerializedProperty parameters;
SerializedProperty gravity;
SerializedProperty gravitySpace;
SerializedProperty ambientWind;
SerializedProperty windSpace;
SerializedProperty useLimits;
SerializedProperty boundaryLimits;
SerializedProperty killOffLimitsParticles;
SerializedProperty worldLinearInertiaScale;
SerializedProperty worldAngularInertiaScale;
SerializedProperty foamSubsteps;
SerializedProperty foamMinNeighbors;
SerializedProperty foamCollisions;
SerializedProperty foamRadiusScale;
SerializedProperty foamVolumeDensity;
SerializedProperty foamAmbientDensity;
SerializedProperty foamScatterColor;
SerializedProperty foamAmbientColor;
SerializedProperty maxFoamVelocityStretch;
SerializedProperty foamFade;
SerializedProperty foamAccelAgingRange;
SerializedProperty foamAccelAging;
SerializedProperty distanceConstraintParameters;
SerializedProperty bendingConstraintParameters;
SerializedProperty particleCollisionConstraintParameters;
@@ -80,72 +58,37 @@ namespace Obi
SerializedProperty shapeMatchingConstraintParameters;
SerializedProperty tetherConstraintParameters;
SerializedProperty pinConstraintParameters;
SerializedProperty pinholeConstraintParameters;
SerializedProperty stitchConstraintParameters;
SerializedProperty densityConstraintParameters;
SerializedProperty stretchShearConstraintParameters;
SerializedProperty bendTwistConstraintParameters;
SerializedProperty chainConstraintParameters;
SerializedProperty maxSurfaceChunks;
SerializedProperty maxQueryResults;
SerializedProperty maxFoamParticles;
SerializedProperty maxParticleNeighbors;
SerializedProperty maxParticleContacts;
BooleanPreference solverFoldout;
BooleanPreference simulationFoldout;
BooleanPreference advectionFoldout;
BooleanPreference collisionsFoldout;
BooleanPreference constraintsFoldout;
BooleanPreference memoryFoldout;
GUIContent constraintLabelContent;
BoxBoundsHandle limitsBoxHandle;
public void OnEnable()
{
solver = (ObiSolver)target;
constraintLabelContent = new GUIContent();
limitsBoxHandle = new BoxBoundsHandle();
solverFoldout = new BooleanPreference($"{target.GetType()}.solverFoldout", true);
simulationFoldout = new BooleanPreference($"{target.GetType()}.simulationFoldout", false);
advectionFoldout = new BooleanPreference($"{target.GetType()}.advectionFoldout", false);
collisionsFoldout = new BooleanPreference($"{target.GetType()}.collisionsFoldout", false);
constraintsFoldout = new BooleanPreference($"{target.GetType()}.constraintsFoldout", false);
memoryFoldout = new BooleanPreference($"{target.GetType()}.memoryFoldout", false);
backend = serializedObject.FindProperty("m_Backend");
substeps = serializedObject.FindProperty("substeps");
maxStepsPerFrame = serializedObject.FindProperty("maxStepsPerFrame");
synchronization = serializedObject.FindProperty("synchronization");
simulateWhenInvisible = serializedObject.FindProperty("simulateWhenInvisible");
parameters = serializedObject.FindProperty("parameters");
gravity = serializedObject.FindProperty("gravity");
gravitySpace = serializedObject.FindProperty("gravitySpace");
ambientWind = serializedObject.FindProperty("ambientWind");
windSpace = serializedObject.FindProperty("windSpace");
useLimits = serializedObject.FindProperty("useLimits");
boundaryLimits = serializedObject.FindProperty("boundaryLimits");
killOffLimitsParticles = serializedObject.FindProperty("killOffLimitsParticles");
worldLinearInertiaScale = serializedObject.FindProperty("worldLinearInertiaScale");
worldAngularInertiaScale = serializedObject.FindProperty("worldAngularInertiaScale");
foamSubsteps = serializedObject.FindProperty("foamSubsteps");
foamMinNeighbors = serializedObject.FindProperty("foamMinNeighbors");
foamCollisions = serializedObject.FindProperty("foamCollisions");
foamRadiusScale = serializedObject.FindProperty("foamRadiusScale");
foamVolumeDensity = serializedObject.FindProperty("foamVolumeDensity");
foamAmbientDensity = serializedObject.FindProperty("foamAmbientDensity");
foamScatterColor = serializedObject.FindProperty("foamScatterColor");
foamAmbientColor = serializedObject.FindProperty("foamAmbientColor");
maxFoamVelocityStretch = serializedObject.FindProperty("maxFoamVelocityStretch");
foamFade = serializedObject.FindProperty("foamFade");
foamAccelAgingRange = serializedObject.FindProperty("foamAccelAgingRange");
foamAccelAging = serializedObject.FindProperty("foamAccelAging");
distanceConstraintParameters = serializedObject.FindProperty("distanceConstraintParameters");
bendingConstraintParameters = serializedObject.FindProperty("bendingConstraintParameters");
particleCollisionConstraintParameters = serializedObject.FindProperty("particleCollisionConstraintParameters");
@@ -157,45 +100,19 @@ namespace Obi
shapeMatchingConstraintParameters = serializedObject.FindProperty("shapeMatchingConstraintParameters");
tetherConstraintParameters = serializedObject.FindProperty("tetherConstraintParameters");
pinConstraintParameters = serializedObject.FindProperty("pinConstraintParameters");
pinholeConstraintParameters = serializedObject.FindProperty("pinholeConstraintParameters");
stitchConstraintParameters = serializedObject.FindProperty("stitchConstraintParameters");
densityConstraintParameters = serializedObject.FindProperty("densityConstraintParameters");
stretchShearConstraintParameters = serializedObject.FindProperty("stretchShearConstraintParameters");
bendTwistConstraintParameters = serializedObject.FindProperty("bendTwistConstraintParameters");
chainConstraintParameters = serializedObject.FindProperty("chainConstraintParameters");
maxSurfaceChunks = serializedObject.FindProperty("m_MaxSurfaceChunks");
maxQueryResults = serializedObject.FindProperty("maxQueryResults");
maxFoamParticles = serializedObject.FindProperty("maxFoamParticles");
maxParticleNeighbors = serializedObject.FindProperty("maxParticleNeighbors");
maxParticleContacts = serializedObject.FindProperty("maxParticleContacts");
}
public void OnSceneGUI()
{
if (solver.useLimits)
{
using (new Handles.DrawingScope(Color.red, solver.transform.localToWorldMatrix))
{
limitsBoxHandle.center = solver.boundaryLimits.center;
limitsBoxHandle.size = solver.boundaryLimits.size;
EditorGUI.BeginChangeCheck();
limitsBoxHandle.DrawHandle();
if (EditorGUI.EndChangeCheck())
{
solver.boundaryLimits = new Bounds(limitsBoxHandle.center, limitsBoxHandle.size);
EditorUtility.SetDirty(target);
}
}
}
}
public override void OnInspectorGUI()
{
serializedObject.UpdateIfRequiredOrScript();
EditorGUILayout.HelpBox("Particles:" + solver.allocParticleCount + "\n" +
"Simplices:" + solver.simplexCounts.simplexCount + "\n" +
EditorGUILayout.HelpBox("Particles:" + solver.allocParticleCount +"\n"+
"Simplices:" + solver.simplexCounts.simplexCount+"\n" +
"Contacts:" + solver.contactCount + "\n" +
"Simplex contacts:" + solver.particleContactCount, MessageType.None);
@@ -206,14 +123,13 @@ namespace Obi
EditorGUILayout.PropertyField(backend);
#if !(OBI_BURST && OBI_MATHEMATICS && OBI_COLLECTIONS)
if (backend.enumValueIndex == (int)ObiSolver.BackendType.Burst)
EditorGUILayout.HelpBox("The Burst backend depends on the following packages: Mathematics, Collections, Jobs and Burst. Please install the required dependencies. The solver will try to fall back to the Compute backend instead.", MessageType.Warning);
if (backend.enumValueIndex == (int)ObiSolver.BackendType.Burst)
EditorGUILayout.HelpBox("The Burst backend depends on the following packages: Mathematics, Collections, Jobs and Burst. The default backend (Oni) will be used instead, if possible.", MessageType.Warning);
#endif
#if !(OBI_ONI_SUPPORTED)
if (backend.enumValueIndex == (int)ObiSolver.BackendType.Oni)
EditorGUILayout.HelpBox("The Oni backend is not compatible with the target platform. Please switch to a compatible platform, or use the Burst backend instead.", MessageType.Warning);
#endif
if (!SystemInfo.supportsComputeShaders)
{
EditorGUILayout.HelpBox("This platform doesn't support compute shaders. Please switch to the Burst backend.", MessageType.Error);
}
if (EditorGUI.EndChangeCheck())
{
@@ -222,11 +138,9 @@ namespace Obi
(t as ObiSolver).UpdateBackend();
}
EditorGUILayout.PropertyField(parameters.FindPropertyRelative("mode"));
EditorGUILayout.PropertyField(parameters.FindPropertyRelative("interpolation"));
EditorGUILayout.PropertyField(synchronization);
EditorGUILayout.PropertyField(substeps);
EditorGUILayout.PropertyField(maxStepsPerFrame);
}
EditorGUILayout.EndFoldoutHeaderGroup();
@@ -235,57 +149,24 @@ namespace Obi
{
EditorGUILayout.PropertyField(gravitySpace);
EditorGUILayout.PropertyField(gravity);
EditorGUILayout.PropertyField(windSpace);
EditorGUILayout.PropertyField(ambientWind);
EditorGUILayout.PropertyField(parameters.FindPropertyRelative("sleepThreshold"));
EditorGUILayout.PropertyField(parameters.FindPropertyRelative("maxVelocity"));
EditorGUILayout.PropertyField(parameters.FindPropertyRelative("maxAngularVelocity"));
EditorGUILayout.PropertyField(parameters.FindPropertyRelative("damping"));
EditorGUILayout.PropertyField(worldLinearInertiaScale);
EditorGUILayout.PropertyField(worldAngularInertiaScale);
EditorGUILayout.PropertyField(parameters.FindPropertyRelative("maxAnisotropy"));
EditorGUILayout.PropertyField(simulateWhenInvisible);
EditorGUILayout.PropertyField(useLimits);
if (useLimits.boolValue)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(killOffLimitsParticles);
EditorGUILayout.PropertyField(boundaryLimits);
EditorGUI.indentLevel--;
}
}
EditorGUILayout.EndFoldoutHeaderGroup();
advectionFoldout.value = EditorGUILayout.BeginFoldoutHeaderGroup(advectionFoldout, "Foam settings");
if (advectionFoldout)
{
EditorGUILayout.PropertyField(foamSubsteps);
EditorGUILayout.PropertyField(foamMinNeighbors);
EditorGUILayout.PropertyField(foamCollisions, new GUIContent("Foam Collisions (Compute only)"));
EditorGUILayout.PropertyField(foamRadiusScale);
EditorGUILayout.PropertyField(foamVolumeDensity);
EditorGUILayout.PropertyField(foamAmbientDensity);
EditorGUILayout.PropertyField(foamScatterColor);
EditorGUILayout.PropertyField(foamAmbientColor);
EditorGUILayout.PropertyField(maxFoamVelocityStretch);
EditorGUILayout.PropertyField(parameters.FindPropertyRelative("foamGravityScale"));
EditorGUILayout.PropertyField(foamFade);
EditorGUILayout.PropertyField(foamAccelAgingRange);
EditorGUILayout.PropertyField(foamAccelAging);
}
EditorGUILayout.EndFoldoutHeaderGroup();
collisionsFoldout.value = EditorGUILayout.BeginFoldoutHeaderGroup(collisionsFoldout, "Collision settings");
if (collisionsFoldout)
{
EditorGUILayout.PropertyField(parameters.FindPropertyRelative("colliderCCD"));
EditorGUILayout.PropertyField(parameters.FindPropertyRelative("particleCCD"));
EditorGUILayout.PropertyField(parameters.FindPropertyRelative("continuousCollisionDetection"));
EditorGUILayout.PropertyField(parameters.FindPropertyRelative("collisionMargin"));
EditorGUILayout.PropertyField(parameters.FindPropertyRelative("maxDepenetration"));
EditorGUILayout.PropertyField(parameters.FindPropertyRelative("shockPropagation"));
EditorGUILayout.PropertyField(parameters.FindPropertyRelative("surfaceCollisionIterations"));
EditorGUILayout.PropertyField(parameters.FindPropertyRelative("surfaceCollisionTolerance"));
EditorGUILayout.PropertyField(parameters.FindPropertyRelative("diffusionMask"));
}
EditorGUILayout.EndFoldoutHeaderGroup();
@@ -325,9 +206,6 @@ namespace Obi
constraintLabelContent.text = "Pin";
EditorGUILayout.PropertyField(pinConstraintParameters, constraintLabelContent);
constraintLabelContent.text = "Pinhole";
EditorGUILayout.PropertyField(pinholeConstraintParameters, constraintLabelContent);
constraintLabelContent.text = "Stitch";
EditorGUILayout.PropertyField(stitchConstraintParameters, constraintLabelContent);
@@ -345,46 +223,13 @@ namespace Obi
}
EditorGUILayout.EndFoldoutHeaderGroup();
memoryFoldout.value = EditorGUILayout.BeginFoldoutHeaderGroup(memoryFoldout, "Memory budget");
if (memoryFoldout)
{
EditorGUILayout.PropertyField(maxQueryResults);
EditorGUILayout.PropertyField(maxFoamParticles);
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(maxSurfaceChunks);
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
foreach (var t in targets)
(t as ObiSolver).dirtyRendering |= (int)Oni.RenderingSystemType.Fluid;
}
EditorGUILayout.PropertyField(maxParticleNeighbors);
EditorGUILayout.PropertyField(maxParticleContacts);
uint usedChunks = solver.usedSurfaceChunks;
float usagePercentage = usedChunks / (float)maxSurfaceChunks.intValue;
uint foamParticles = solver.initialized ? solver.implementation.activeFoamParticleCount : 0;
// memory consumption per chunk:
// (8 + 12 + 64*4 + 64*6*4 + 64*16) = 2836 bytes
EditorGUILayout.HelpBox("Active foam particles: " + foamParticles + "/" + maxFoamParticles.intValue + "\n"+
"Surface memory (Mb): " + string.Format("{0:N2}", maxSurfaceChunks.intValue * 0.002836f)+ "\n"+
"Used surface chunks: "+ usedChunks + "/"+ maxSurfaceChunks.intValue + ", hashtable usage "+ string.Format("{0:N1}", usagePercentage * 100) + "%", MessageType.None);
if (usagePercentage >= 0.5f)
{
EditorGUILayout.HelpBox("Hashtable usage should be below 50% for best performance. Increase max surface chunks if % is too high.", MessageType.Warning);
}
}
EditorGUILayout.EndFoldoutHeaderGroup();
// Apply changes to the serializedProperty
if (GUI.changed)
{
serializedObject.ApplyModifiedProperties();
solver.PushSolverParameters();
}
}
@@ -392,12 +237,15 @@ namespace Obi
[DrawGizmo(GizmoType.InSelectionHierarchy | GizmoType.Selected)]
static void DrawGizmoForSolver(ObiSolver solver, GizmoType gizmoType)
{
if ((gizmoType & GizmoType.InSelectionHierarchy) != 0)
{
Gizmos.color = new Color(1, 1, 1, 0.5f);
var bounds = solver.bounds;
Bounds bounds = solver.Bounds;
Gizmos.DrawWireCube(bounds.center, bounds.size);
}
}
}

View File

@@ -4,7 +4,6 @@ using UnityEngine.SceneManagement;
using UnityEditor;
using UnityEditor.SceneManagement;
using System.IO;
using UnityEngine.Rendering;
namespace Obi{
@@ -128,7 +127,17 @@ namespace Obi{
public static GameObject CreateNewSolver()
{
// Root for the actors.
var root = new GameObject("Obi Solver", typeof(ObiSolver));
var root = new GameObject("Obi Solver");
ObiSolver solver = root.AddComponent<ObiSolver>();
// Try to find a fixed updater in the scene (though other kinds of updaters can exist, updating in FixedUpdate is the preferred option).
ObiFixedUpdater updater = StageUtility.GetCurrentStageHandle().FindComponentOfType<ObiFixedUpdater>();
// If we could not find an fixed updater in the scene, add one to the solver object.
if (updater == null)
updater = root.AddComponent<ObiFixedUpdater>();
// Add the solver to the updater:
updater.solvers.Add(solver);
// Works for all stages.
StageUtility.PlaceGameObjectInCurrentStage(root);
@@ -221,34 +230,7 @@ namespace Obi{
// Return the currently selected item's index
return selected;
}
public static void DrawArrowHandle(Vector3 posA, Vector3 posB, float headAngle = 30, float headLength = 0.18f)
{
Handles.DrawLine(posA, posB);
var look = Quaternion.LookRotation(posA - posB, Camera.current.transform.forward);
var one = look * Quaternion.Euler(0, 180 + headAngle, 0) * new Vector3(0, 0, 1);
var two = look * Quaternion.Euler(0, 180 - headAngle, 0) * new Vector3(0, 0, 1);
var sizeA = HandleUtility.GetHandleSize(posA) * headLength;
Handles.DrawLine(posA, posA + one * sizeA);
Handles.DrawLine(posA, posA + two * sizeA);
var sizeB = HandleUtility.GetHandleSize(posB) * headLength;
Handles.DrawLine(posB, posB - one * sizeB);
Handles.DrawLine(posB, posB - two * sizeB);
}
public static Material GetDefaultMaterial()
{
if (GraphicsSettings.defaultRenderPipeline != null)
{
return GraphicsSettings.defaultRenderPipeline.defaultMaterial;
}
else
{
return AssetDatabase.GetBuiltinExtraResource<Material>("Default-Diffuse.mat");
}
}
}

View File

@@ -1,24 +0,0 @@
using UnityEditor;
using UnityEngine;
namespace Obi
{
[CustomEditor(typeof(ObiFoamGenerator)), CanEditMultipleObjects]
public class ObiFoamGeneratorEditor : Editor
{
public override void OnInspectorGUI()
{
serializedObject.UpdateIfRequiredOrScript();
DrawPropertiesExcluding(serializedObject, "m_Script");
// Apply changes to the serializedProperty
if (GUI.changed)
serializedObject.ApplyModifiedProperties();
}
}
}

View File

@@ -15,7 +15,6 @@ namespace Obi
SerializedProperty targetTransform;
SerializedProperty particleGroup;
SerializedProperty attachmentType;
SerializedProperty projectPosition;
SerializedProperty constrainOrientation;
SerializedProperty compliance;
SerializedProperty breakThreshold;
@@ -29,10 +28,9 @@ namespace Obi
targetTransform = serializedObject.FindProperty("m_Target");
particleGroup = serializedObject.FindProperty("m_ParticleGroup");
attachmentType = serializedObject.FindProperty("m_AttachmentType");
projectPosition = serializedObject.FindProperty("m_Projection");
constrainOrientation = serializedObject.FindProperty("m_ConstrainOrientation");
compliance = serializedObject.FindProperty("m_Compliance");
breakThreshold = serializedObject.FindProperty("breakThreshold");
breakThreshold = serializedObject.FindProperty("m_BreakThreshold");
}
public override void OnInspectorGUI()
@@ -57,16 +55,7 @@ namespace Obi
}
}
EditorGUI.BeginChangeCheck();
Transform trget = EditorGUILayout.ObjectField("Target", attachment.target, typeof(Transform), true) as Transform;
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(attachment, "Set target");
attachment.target = trget;
PrefabUtility.RecordPrefabInstancePropertyModifications(attachment);
}
EditorGUILayout.PropertyField(targetTransform, new GUIContent("Target"));
var blueprint = attachment.actor.sourceBlueprint;
if (blueprint != null)
@@ -100,7 +89,6 @@ namespace Obi
if (attachment.attachmentType == ObiParticleAttachment.AttachmentType.Dynamic)
{
EditorGUILayout.PropertyField(projectPosition, new GUIContent("Projection"));
EditorGUILayout.PropertyField(compliance, new GUIContent("Compliance"));
EditorGUILayout.PropertyField(breakThreshold, new GUIContent("Break threshold"));
}

View File

@@ -42,9 +42,6 @@ namespace Obi{
if (EditorGUI.EndChangeCheck()){
Undo.RecordObject(stitcher, "Set first actor");
stitcher.Actor1 = actor1;
if (actor1 != null)
sewingToolHandle1 = actor1.transform.position;
PrefabUtility.RecordPrefabInstancePropertyModifications(stitcher);
}
EditorGUI.BeginChangeCheck();
@@ -52,10 +49,7 @@ namespace Obi{
if (EditorGUI.EndChangeCheck()){
Undo.RecordObject(stitcher, "Set second actor");
stitcher.Actor2 = actor2;
if (actor2 != null)
sewingToolHandle2 = actor2.transform.position;
PrefabUtility.RecordPrefabInstancePropertyModifications(stitcher);
}
}
if (stitcher.Actor1 != null && stitcher.Actor2 != null && stitcher.Actor1.solver != stitcher.Actor2.solver){
EditorGUILayout.HelpBox("Both actors must be managed by the same solver.",MessageType.Error);
@@ -69,13 +63,14 @@ namespace Obi{
if (editing){
EditorGUILayout.HelpBox("Remember that when working with the sewing tool, you can use Unity's snap to vertex feature by pressing 'V' in your keyboard.",MessageType.Info);
// Clear all stitches
if (GUILayout.Button("Clear all stitches")){
if (EditorUtility.DisplayDialog("Clearing stitches","Are you sure you want to remove all stitches?","Ok","Cancel")){
Undo.RecordObject(stitcher, "Clear all stitches");
stitcher.Clear();
PrefabUtility.RecordPrefabInstancePropertyModifications(stitcher);
}
}
}
// Remove selected stitches
@@ -98,22 +93,19 @@ namespace Obi{
foreach(int i in removedStitches.OrderByDescending(i => i)){
stitcher.RemoveStitch(i);
}
PrefabUtility.RecordPrefabInstancePropertyModifications(stitcher);
}
}
}
// Add stitch:
if (GUILayout.Button("Add Stitch"))
{
FindClosestParticles(out int particle1, out int particle2);
if (GUILayout.Button("Add Stitch")){
Undo.RecordObject(stitcher, "Add stitch");
if (particle1 >= 0 && particle2 >= 0)
{
Undo.RecordObject(stitcher, "Add stitch");
stitcher.AddStitch(particle1, particle2);
PrefabUtility.RecordPrefabInstancePropertyModifications(stitcher);
}
}
int particle1 = 0;
int particle2 = 0;
UseSewingTool(ref particle1, ref particle2);
stitcher.AddStitch(particle1,particle2);
}
}
GUI.enabled = true;
@@ -128,28 +120,16 @@ namespace Obi{
}
public void FindClosestParticles(out int particle1, out int particle2)
{
particle1 = -1;
particle2 = -1;
float minDistance = float.MaxValue;
public void UseSewingTool(ref int particle1, ref int particle2){
if (stitcher.Actor1 == null || stitcher.Actor2 == null)
return;
float minDistance = float.MaxValue;
var handle1 = HandleUtility.WorldToGUIPointWithDepth(sewingToolHandle1);
var handle2 = HandleUtility.WorldToGUIPointWithDepth(sewingToolHandle2);
if (stitcher.Actor1 == stitcher.Actor2)
{
if (stitcher.Actor1 == stitcher.Actor2){
float minDistance2 = float.MaxValue;
for (int i = 0; i < stitcher.Actor1.activeParticleCount;++i)
{
for (int i = 0; i < stitcher.Actor1.particleCount;++i){
Vector3 pos = stitcher.Actor1.GetParticlePosition(stitcher.Actor1.solverIndices[i]);
pos = HandleUtility.WorldToGUIPointWithDepth(pos);
float distance1 = (pos - handle1).sqrMagnitude;
float distance2 = (pos - handle2).sqrMagnitude;
float distance1 = (pos - sewingToolHandle1).sqrMagnitude;
float distance2 = (pos - sewingToolHandle2).sqrMagnitude;
if (distance1 < minDistance){
minDistance = distance1;
particle1 = i;
@@ -162,28 +142,24 @@ namespace Obi{
}else{
// find closest particle to each end of the sewing tool:
for (int i = 0; i < stitcher.Actor1.activeParticleCount; ++i)
{
for (int i = 0; i < stitcher.Actor1.particleCount;++i){
Vector3 pos = stitcher.Actor1.GetParticlePosition(stitcher.Actor1.solverIndices[i]);
pos = HandleUtility.WorldToGUIPointWithDepth(pos);
float min = (pos - handle1).sqrMagnitude;
if (min < minDistance)
{
float distance1 = (pos - sewingToolHandle1).sqrMagnitude;
float distance2 = (pos - sewingToolHandle2).sqrMagnitude;
float min = Mathf.Min(distance1,distance2);
if (min < minDistance){
minDistance = min;
particle1 = i;
}
}
minDistance = float.MaxValue;
for (int i = 0; i < stitcher.Actor2.activeParticleCount; ++i)
{
for (int i = 0; i < stitcher.Actor2.particleCount;++i){
Vector3 pos = stitcher.Actor2.GetParticlePosition(stitcher.Actor2.solverIndices[i]);
pos = HandleUtility.WorldToGUIPointWithDepth(pos);
float min = (pos - handle2).sqrMagnitude;
if (min < minDistance)
{
float distance1 = (pos - sewingToolHandle1).sqrMagnitude;
float distance2 = (pos - sewingToolHandle2).sqrMagnitude;
float min = Mathf.Min(distance1,distance2);
if (min < minDistance){
minDistance = min;
particle2 = i;
}
@@ -191,32 +167,10 @@ namespace Obi{
}
}
public void DrawSewingTool()
{
FindClosestParticles(out int particle1, out int particle2);
if (particle1 >= 0 && particle2 >= 0)
{
sewingToolHandle1 = stitcher.Actor1.GetParticlePosition(stitcher.Actor1.solverIndices[particle1]);
sewingToolHandle2 = stitcher.Actor2.GetParticlePosition(stitcher.Actor2.solverIndices[particle2]);
float radius1 = stitcher.Actor1.GetParticleMaxRadius(stitcher.Actor1.solverIndices[particle1]);
float radius2 = stitcher.Actor2.GetParticleMaxRadius(stitcher.Actor2.solverIndices[particle2]);
Handles.color = Color.white;
#if (UNITY_2022_1_OR_NEWER)
sewingToolHandle1 = Handles.FreeMoveHandle(sewingToolHandle1, radius1 * 2, new Vector3(.5f,.5f,.5f),Handles.SphereHandleCap);
sewingToolHandle2 = Handles.FreeMoveHandle(sewingToolHandle2, radius2 * 2, new Vector3(.5f,.5f,.5f),Handles.SphereHandleCap);
#else
sewingToolHandle1 = Handles.FreeMoveHandle(sewingToolHandle1, Quaternion.identity, radius1 * 2, new Vector3(.5f, .5f, .5f), Handles.SphereHandleCap);
sewingToolHandle2 = Handles.FreeMoveHandle(sewingToolHandle2, Quaternion.identity, radius2 * 2, new Vector3(.5f, .5f, .5f), Handles.SphereHandleCap);
#endif
Vector3 direction = Vector3.Normalize(sewingToolHandle2 - sewingToolHandle1);
Handles.color = Color.yellow;
ObiEditorUtils.DrawArrowHandle(sewingToolHandle1 + direction*(radius1 + 0.05f), sewingToolHandle2 - direction*(radius2+0.05f));
}
public void DrawSewingTool(){
var fmh_171_72_639027316145683117 = Quaternion.identity; sewingToolHandle1 = Handles.FreeMoveHandle(sewingToolHandle1,HandleUtility.GetHandleSize(sewingToolHandle1)*0.05f,new Vector3(.5f,.5f,.5f),Handles.RectangleHandleCap);
var fmh_172_66_639027316145718628 = Quaternion.identity; sewingToolHandle2 = Handles.FreeMoveHandle(sewingToolHandle2,HandleUtility.GetHandleSize(sewingToolHandle2)*0.05f,new Vector3(.5f,.5f,.5f),Handles.RectangleHandleCap);
Handles.DrawDottedLine(sewingToolHandle1,sewingToolHandle2,2);
}
/**
@@ -267,7 +221,7 @@ namespace Obi{
}
break;
case EventType.Repaint:
Handles.color = selectionStatus[i]?Color.red:Color.cyan;
Handles.color = selectionStatus[i]?Color.red:Color.green;
Handles.DrawDottedLine(pos1,pos2,2);
break;
}

View File

@@ -81,8 +81,8 @@ Material:
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _AABBMax: {r: 1.1746451, g: 1.1746451, b: 1.1746451, a: 0}
- _AABBMin: {r: -1.1746451, g: -1.1746451, b: -1.1746451, a: 0}
- _AABBMax: {r: 1.3624613, g: 1.3624613, b: 1.3624613, a: 0}
- _AABBMin: {r: -1.3624613, g: -1.3624613, b: -1.3624613, a: 0}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _InsideColor: {r: 1, g: 1, b: 1, a: 1}

View File

@@ -18,8 +18,8 @@
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
#include "../../Resources/ObiMaterials/Common/ObiEllipsoids.cginc"
#include "../../Resources/ObiMaterials/Common/ObiUtils.cginc"
#include "../../Resources/ObiMaterials/ObiEllipsoids.cginc"
#include "../../Resources/ObiMaterials/ObiUtils.cginc"
fixed4 _Color;
@@ -42,7 +42,6 @@
float3 lightDir : TEXCOORD2;
float3 a2 : TEXCOORD3;
float3 a3 : TEXCOORD4;
//float3x3 P : TEXCOORD5;
};
struct fout
@@ -66,7 +65,6 @@
o.mapping = float4(v.corner.xy,1/length(eye),radius); // A[1]
o.viewRay = mul((float3x3)UNITY_MATRIX_V,view); // A[0]
o.color = v.color * _Color;
//o.P = float3x3(v.t0.xyz,v.t1.xyz,v.t2.xyz);
BuildAuxiliaryNormalVectors(v.vertex,worldPos,view,P,IP,o.a2,o.a3);
@@ -88,19 +86,6 @@
// clip space position:
float4 pos = mul(UNITY_MATRIX_P,float4(p,1.0));
// local space normal, use to calculate UVs
/*float3 ln = mul(mul((float3x3)i.P,UNITY_MATRIX_I_V) ,n);
float2 uv = float2(
// atan returns a value between -pi and pi
// so we divide by pi * 2 to get -0.5 to 0.5
atan2(ln.x, ln.y) / (3.1415 * 2.0),
// acos returns 0.0 at the top, pi at the bottom
// so we flip the y to align with Unity's OpenGL style
// texture UVs so 0.0 is at the bottom
acos(-ln.z) / 3.1415
);*/
// simple lighting: ambient
float3 modelUp = mul (UNITY_MATRIX_IT_MV,float3(0,1,0));
float vecHemi = dot(n, modelUp) * 0.5f + 0.5f;

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -0,0 +1,92 @@
fileFormatVersion: 2
guid: 092f06332c018434b8c8ea86164ef4fd
timeCreated: 1482503923
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: iPhone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Android
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -0,0 +1,92 @@
fileFormatVersion: 2
guid: 7b6e7fb3568d24300be305b5d1d7554d
timeCreated: 1454660299
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
linearTexture: 1
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: iPhone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Android
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -0,0 +1,117 @@
fileFormatVersion: 2
guid: 4e2c952f509ae40bdaf836136058d487
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 5
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: 1
mipBias: -1
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

View File

@@ -8,8 +8,8 @@
Pass {
Offset -0.5, -0.5
Cull Back
Offset 0, -50
Cull Back
Fog { Mode Off }
CGPROGRAM
@@ -49,7 +49,7 @@
Pass {
Offset -1, -1
Offset 0, -100
Cull Back
ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha

View File

@@ -1,18 +1,17 @@
fileFormatVersion: 2
guid: 931c48569a82e4dae84d4702bf6da199
timeCreated: 1478802054
licenseType: Store
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
@@ -21,78 +20,40 @@ TextureImporter:
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
filterMode: -1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
spritePixelsToUnits: 100
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 1
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
buildTargetSettings: []
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 1
pSDShowRemoveMatteOption: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -33,10 +33,6 @@ namespace Obi
SerializedProperty plasticYield;
SerializedProperty plasticCreep;
SerializedProperty aerodynamicsEnabled;
SerializedProperty drag;
SerializedProperty lift;
SerializedProperty fixRoot;
SerializedProperty stretchBones;
SerializedProperty ignored;
@@ -73,9 +69,6 @@ namespace Obi
plasticYield = serializedObject.FindProperty("_plasticYield");
plasticCreep = serializedObject.FindProperty("_plasticCreep");
aerodynamicsEnabled = serializedObject.FindProperty("_aerodynamicsEnabled");
drag = serializedObject.FindProperty("_drag");
lift = serializedObject.FindProperty("_lift");
}
public void OnDisable()
@@ -151,12 +144,6 @@ namespace Obi
EditorGUILayout.PropertyField(plasticCreep, new GUIContent("Plastic creep"));
});
ObiEditorUtils.DoToggleablePropertyGroup(aerodynamicsEnabled, new GUIContent("Aerodynamics", Resources.Load<Texture2D>("Icons/ObiAerodynamicConstraints Icon")),
() => {
EditorGUILayout.PropertyField(drag, new GUIContent("Drag"));
EditorGUILayout.PropertyField(lift, new GUIContent("Lift"));
});
if (GUI.changed)
serializedObject.ApplyModifiedProperties();

View File

@@ -2,38 +2,12 @@ using UnityEngine;
using UnityEditor;
using UnityEditor.EditorTools;
using System;
using UnityEditor.Overlays;
using UnityEngine.UIElements;
namespace Obi
{
[EditorTool("Obi Path Editor Tool",typeof(ObiRopeBase))]
public class ObiPathEditor : EditorTool
{
[Overlay(typeof(SceneView), "Obi Path Editor", "Obi Path Editor", "Obi Path Editor", true)]
[Icon("Assets/Obi/Editor/Resources/EditCurves.psd")]
class PathEditorOverlay : Overlay, ITransientOverlay
{
public static ObiPathEditor editor;
public override VisualElement CreatePanelContent()
{
var root = new VisualElement();
root.Add(new IMGUIContainer(editor.DrawToolPanel));
return root;
}
// Use the visible property to hide or show this instance from within the class.
public bool visible
{
get
{
return ToolManager.activeToolType == typeof(ObiPathEditor);
}
}
}
enum PathEditorTool
{
TranslatePoints,
@@ -90,7 +64,6 @@ namespace Obi
{
this.useOrientation = target is ObiRod;
selectedStatus = new bool[0];
PathEditorOverlay.editor = this;
}
public void ResizeCPArrays()
@@ -98,6 +71,7 @@ namespace Obi
Array.Resize(ref selectedStatus, path.ControlPointCount);
}
int windowId;
public override void OnToolGUI(EditorWindow window)
{
needsRepaint = false;
@@ -108,7 +82,11 @@ namespace Obi
ResizeCPArrays();
HandleUtility.AddDefaultControl(GUIUtility.GetControlID("PathEditor".GetHashCode(), FocusType.Passive));
HandleUtility.AddDefaultControl(GUIUtility.GetControlID(FocusType.Passive));
// get a window ID:
if (Event.current.type != EventType.Used)
windowId = GUIUtility.GetControlID(FocusType.Passive);
Matrix4x4 prevMatrix = Handles.matrix;
Handles.matrix = matrix;
@@ -120,6 +98,9 @@ namespace Obi
needsRepaint |= DrawControlPoint(i);
}
// Control point selection handle:
needsRepaint |= ObiPathHandles.SplineCPSelector(path, selectedStatus);
// Count selected and calculate average position:
selectionAverage = GetControlPointAverage(out lastSelected, out selectedCount);
@@ -129,8 +110,10 @@ namespace Obi
if (showThicknessHandles)
needsRepaint |= DoThicknessHandles(thicknessScale);
// Control point selection handle:
needsRepaint |= ObiPathHandles.SplineCPSelector(path, selectedStatus);
// Sceneview GUI:
Handles.BeginGUI();
GUILayout.Window(windowId, new Rect(10, 28, 0, 0), DrawUIWindow, "Path editor");
Handles.EndGUI();
Handles.matrix = prevMatrix;
@@ -562,7 +545,7 @@ namespace Obi
return false;
}
public void DrawToolPanel()
public void DrawUIWindow(int windowID)
{
DrawToolButtons();
@@ -1073,7 +1056,7 @@ namespace Obi
}
EditorGUI.BeginChangeCheck();
color = EditorGUILayout.ColorField(new GUIContent("Color"), color, true, true, true, GUILayout.MinWidth(94));
color = EditorGUILayout.ColorField("Color", color, GUILayout.MinWidth(94));
EditorGUI.showMixedValue = false;
if (EditorGUI.EndChangeCheck())
{
@@ -1170,7 +1153,7 @@ namespace Obi
for (int index = 0; index < 4; ++index)
{
int controlId = GUIUtility.GetControlID("ObiPathThicknessHandle".GetHashCode(), FocusType.Passive);
int controlId = GUIUtility.GetControlID("ObiPathThicknessHandle".GetHashCode(), FocusType.Keyboard);
Vector3 position1 = position + radius * vector3Array[index];
bool changed = GUI.changed;
GUI.changed = false;
@@ -1214,7 +1197,7 @@ namespace Obi
Vector2 currentPoint = HandleUtility.WorldToGUIPoint(path.m_Points.Evaluate(_p, p, p_, p__, i * step));
float mu;
float distance = Vector2.SqrMagnitude((Vector2)ObiUtils.ProjectPointLine(lastPoint, currentPoint, screenPoint, out mu) - screenPoint);
float distance = Vector2.SqrMagnitude((Vector2)ObiUtils.ProjectPointLine(screenPoint, lastPoint, currentPoint, out mu) - screenPoint);
if (distance < minDistance)
{

View File

@@ -28,9 +28,27 @@ namespace Obi
// select vertex on mouse click:
switch (Event.current.GetTypeForControl(controlID))
{
case EventType.Layout:
case EventType.MouseMove:
case EventType.MouseDown:
{
if ((Event.current.modifiers & EventModifiers.Control) == 0 &&
(HandleUtility.nearestControl != controlID || Event.current.button != 0)) break;
startPos = Event.current.mousePosition;
marquee.Set(0, 0, 0, 0);
// If the user is pressing shift, accumulate selection.
if ((Event.current.modifiers & EventModifiers.Shift) == 0 && (Event.current.modifiers & EventModifiers.Alt) == 0)
{
for (int i = 0; i < selectionStatus.Length; i++)
selectionStatus[i] = false;
}
// If the user is holding down control, dont allow selection of other objects and use marquee tool.
if ((Event.current.modifiers & EventModifiers.Control) != 0)
GUIUtility.hotControl = controlID;
float minSqrDistance = System.Single.MaxValue;
float sqrMinSelectionDistance = minSelectionDistance * minSelectionDistance;
@@ -41,94 +59,50 @@ namespace Obi
Vector2 pos = HandleUtility.WorldToGUIPoint(path.points[i].position);
// get distance from mouse position to particle position:
float sqrDistance = Vector2.SqrMagnitude(Event.current.mousePosition - pos);
float sqrDistance = Vector2.SqrMagnitude(startPos - pos);
// check if this control point is closer to the cursor that any previously considered point.
if (sqrDistance < sqrMinSelectionDistance && sqrDistance < minSqrDistance)
{
{
minSqrDistance = sqrDistance;
selectedCPIndex = i;
}
}
HandleUtility.AddControl(controlID, Mathf.Sqrt(minSqrDistance));
break;
case EventType.MouseDown:
marquee.Set(0, 0, 0, 0);
startPos = Event.current.mousePosition;
if (selectedCPIndex >= 0)
{ // toggle particle selection status.
if (Event.current.button == 0)
{
selectionStatus[selectedCPIndex] = !selectionStatus[selectedCPIndex];
selectionStatusChanged = true;
if (HandleUtility.nearestControl == controlID)
{
GUIUtility.hotControl = controlID;
// Prevent spline deselection if we have selected a particle:
GUIUtility.hotControl = controlID;
Event.current.Use();
// If the user is pressing shift or ctrl, accumulate selection.
if ((Event.current.modifiers & (EventModifiers.Shift | EventModifiers.Control)) == 0 && (Event.current.modifiers & EventModifiers.Alt) == 0)
{
for (int i = 0; i < selectionStatus.Length; i++)
selectionStatus[i] = false;
selectionStatusChanged = true;
}
minSqrDistance = System.Single.MaxValue;
sqrMinSelectionDistance = minSelectionDistance * minSelectionDistance;
for (int i = 0; i < path.ControlPointCount; i++)
{
// get particle position in gui space:
Vector2 pos = HandleUtility.WorldToGUIPoint(path.points[i].position);
// get distance from mouse position to particle position:
float sqrDistance = Vector2.SqrMagnitude(startPos - pos);
// check if this control point is closer to the cursor that any previously considered point.
if (sqrDistance < sqrMinSelectionDistance && sqrDistance < minSqrDistance)
{
minSqrDistance = sqrDistance;
selectedCPIndex = i;
}
}
if (selectedCPIndex >= 0)
{ // toggle particle selection status.
selectionStatus[selectedCPIndex] = !selectionStatus[selectedCPIndex];
selectionStatusChanged = true;
// Prevent spline deselection if we have selected a particle:
Event.current.Use();
}
}
else if ((Event.current.modifiers & (EventModifiers.Shift | EventModifiers.Control)) == 0 && (Event.current.modifiers & EventModifiers.Alt) == 0)
{
for (int i = 0; i < selectionStatus.Length; i++)
selectionStatus[i] = false;
selectionStatusChanged = true;
}
}
else if (Event.current.modifiers == EventModifiers.None)
{ // deselect all particles:
for (int i = 0; i < selectionStatus.Length; i++)
selectionStatus[i] = false;
selectionStatusChanged = true;
}
}
break;
case EventType.MouseDrag:
if (Event.current.button == 0 && (Event.current.modifiers & EventModifiers.Alt) == 0)
if (GUIUtility.hotControl == controlID)
{
currentPos = Event.current.mousePosition;
if (!dragging && Vector2.Distance(startPos, currentPos) > 5)
{
dragging = true;
}
if (dragging)
else
{
GUIUtility.hotControl = controlID;
Event.current.Use();
@@ -187,6 +161,34 @@ namespace Obi
break;
case EventType.Layout:
{
float minSqrDistance = System.Single.MaxValue;
float sqrMinSelectionDistance = minSelectionDistance * minSelectionDistance;
for (int i = 0; i < path.ControlPointCount; i++)
{
// get particle position in gui space:
Vector2 pos = HandleUtility.WorldToGUIPoint(path.points[i].position);
// get distance from mouse position to particle position:
float sqrDistance = Vector2.SqrMagnitude(Event.current.mousePosition - pos);
// check if this control point is closer to the cursor that any previously considered point.
if (sqrDistance < sqrMinSelectionDistance && sqrDistance < minSqrDistance)
{ //magic number 900 = 30*30, where 30 is min distance in pixels to select a particle.
minSqrDistance = sqrDistance;
}
}
HandleUtility.AddControl(controlID, Mathf.Sqrt(minSqrDistance));
}
break;
}
return selectionStatusChanged;

View File

@@ -17,8 +17,6 @@ namespace Obi
static void CreateObiRod(MenuCommand menuCommand)
{
GameObject go = new GameObject("Obi Rod", typeof(ObiRod), typeof(ObiRopeExtrudedRenderer));
var renderer = go.GetComponent<ObiRopeExtrudedRenderer>();
renderer.material = ObiEditorUtils.GetDefaultMaterial();
ObiEditorUtils.PlaceActorRoot(go, menuCommand);
}
@@ -28,8 +26,7 @@ namespace Obi
SerializedProperty collisionMaterial;
SerializedProperty selfCollisions;
SerializedProperty surfaceCollisions;
SerializedProperty massScale;
SerializedProperty surfaceCollisions;
SerializedProperty stretchShearConstraintsEnabled;
SerializedProperty stretchCompliance;
@@ -43,10 +40,6 @@ namespace Obi
SerializedProperty plasticYield;
SerializedProperty plasticCreep;
SerializedProperty aerodynamicsEnabled;
SerializedProperty drag;
SerializedProperty lift;
SerializedProperty chainConstraintsEnabled;
SerializedProperty tightness;
@@ -61,7 +54,6 @@ namespace Obi
collisionMaterial = serializedObject.FindProperty("m_CollisionMaterial");
selfCollisions = serializedObject.FindProperty("m_SelfCollisions");
surfaceCollisions = serializedObject.FindProperty("m_SurfaceCollisions");
massScale = serializedObject.FindProperty("m_MassScale");
stretchShearConstraintsEnabled = serializedObject.FindProperty("_stretchShearConstraintsEnabled");
stretchCompliance = serializedObject.FindProperty("_stretchCompliance");
@@ -75,10 +67,6 @@ namespace Obi
plasticYield = serializedObject.FindProperty("_plasticYield");
plasticCreep = serializedObject.FindProperty("_plasticCreep");
aerodynamicsEnabled = serializedObject.FindProperty("_aerodynamicsEnabled");
drag = serializedObject.FindProperty("_drag");
lift = serializedObject.FindProperty("_lift");
chainConstraintsEnabled = serializedObject.FindProperty("_chainConstraintsEnabled");
tightness = serializedObject.FindProperty("_tightness");
}
@@ -122,30 +110,8 @@ namespace Obi
using (new EditorGUI.DisabledScope(ToolManager.activeToolType == typeof(ObiPathEditor)))
{
GUILayout.BeginHorizontal();
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(rodBlueprint, new GUIContent("Blueprint"));
if (actor.rodBlueprint == null)
{
if (GUILayout.Button("Create", EditorStyles.miniButton, GUILayout.MaxWidth(80)))
{
string path = EditorUtility.SaveFilePanel("Save blueprint", "Assets/", "RodBlueprint", "asset");
if (!string.IsNullOrEmpty(path))
{
path = FileUtil.GetProjectRelativePath(path);
ObiRodBlueprint asset = ScriptableObject.CreateInstance<ObiRodBlueprint>();
AssetDatabase.CreateAsset(asset, path);
AssetDatabase.SaveAssets();
actor.rodBlueprint = asset;
}
}
}
if (EditorGUI.EndChangeCheck())
{
foreach (var t in targets)
@@ -157,12 +123,8 @@ namespace Obi
foreach (var t in targets)
(t as ObiRod).AddToSolver();
}
GUILayout.EndHorizontal();
}
EditorGUILayout.PropertyField(massScale, new GUIContent("m_MassScale"));
DoEditButton();
EditorGUILayout.Space();
@@ -188,12 +150,6 @@ namespace Obi
EditorGUILayout.PropertyField(plasticCreep, new GUIContent("Plastic creep"));
});
ObiEditorUtils.DoToggleablePropertyGroup(aerodynamicsEnabled, new GUIContent("Aerodynamics", Resources.Load<Texture2D>("Icons/ObiAerodynamicConstraints Icon")),
() => {
EditorGUILayout.PropertyField(drag, new GUIContent("Drag"));
EditorGUILayout.PropertyField(lift, new GUIContent("Lift"));
});
ObiEditorUtils.DoToggleablePropertyGroup(chainConstraintsEnabled, new GUIContent("Chain Constraints", Resources.Load<Texture2D>("Icons/ObiChainConstraints Icon")),
() => {
EditorGUILayout.PropertyField(tightness, new GUIContent("Tightness"));

View File

@@ -15,27 +15,8 @@ namespace Obi{
public void OnEnable(){
renderer = (ObiRopeChainRenderer)target;
}
[MenuItem("CONTEXT/ObiRopeChainRenderer/Bake mesh")]
static void Bake(MenuCommand command)
{
ObiRopeChainRenderer renderer = (ObiRopeChainRenderer)command.context;
if (renderer.actor.isLoaded)
{
var system = renderer.actor.solver.GetRenderSystem<ObiRopeChainRenderer>() as ObiChainRopeRenderSystem;
if (system != null)
{
var mesh = new Mesh();
system.BakeMesh(renderer, ref mesh, true);
ObiEditorUtils.SaveMesh(mesh, "Save chain mesh", "chain mesh");
GameObject.DestroyImmediate(mesh);
}
}
}
public override void OnInspectorGUI() {
public override void OnInspectorGUI() {
serializedObject.UpdateIfRequiredOrScript();
@@ -44,7 +25,12 @@ namespace Obi{
// Apply changes to the serializedProperty
if (GUI.changed){
serializedObject.ApplyModifiedProperties();
serializedObject.ApplyModifiedProperties();
renderer.ClearChainLinkInstances();
renderer.CreateChainLinkInstances(renderer.GetComponent<ObiRopeBase>());
renderer.UpdateRenderer(renderer.GetComponent<ObiRopeBase>());
}
}

View File

@@ -65,19 +65,17 @@ namespace Obi
private static void DrawGizmos(ObiRopeCursor cursor, GizmoType gizmoType)
{
var rope = cursor.GetComponent<ObiRope>();
if (rope.isLoaded)
if (rope.solver != null)
{
Handles.matrix = rope.solver.transform.localToWorldMatrix;
Handles.color = new Color(1, 0.5f, 0.2f, 1);
Gizmos.color = new Color(1, 0.5f, 0, 0.75f);
// draw source particle:
int sourceIndex = cursor.sourceParticleIndex;
if (sourceIndex >= 0 && rope.IsParticleActive(rope.solver.particleToActor[sourceIndex].indexInActor))
{
Vector3 pos = rope.solver.positions[sourceIndex];
float size = HandleUtility.GetHandleSize(pos) * 0.15f;
Handles.SphereHandleCap(0, pos, Quaternion.identity, size, EventType.Repaint);
Vector3 pos = rope.GetParticlePosition(sourceIndex);
Gizmos.DrawWireSphere(pos, HandleUtility.GetHandleSize(pos) * 0.4f);
}
// draw cursor:
@@ -85,12 +83,13 @@ namespace Obi
if (element != null && element.particle1 != element.particle2)
{
Vector3 pos = rope.solver.positions[cursor.direction ? element.particle1 : element.particle2];
Vector3 pos2 = rope.solver.positions[cursor.direction ? element.particle2 : element.particle1];
Vector3 pos = rope.GetParticlePosition(cursor.direction ? element.particle1 : element.particle2);
Vector3 pos2 = rope.GetParticlePosition(cursor.direction ? element.particle2 : element.particle1);
Vector3 direction = pos2 - pos;
float size = HandleUtility.GetHandleSize(pos) * 0.25f;
Handles.ConeHandleCap(0, pos + Vector3.Normalize(direction)*size*0.5f, Quaternion.LookRotation(direction), size, EventType.Repaint);
float size = HandleUtility.GetHandleSize(pos) * 0.4f;
Gizmos.matrix = Matrix4x4.TRS(pos, Quaternion.LookRotation(direction), Vector3.one * size);
DrawArrow();
}
}
}

View File

@@ -1,6 +1,11 @@
using UnityEditor;
using UnityEditor.EditorTools;
using UnityEditorInternal;
using UnityEngine;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Obi
{
@@ -13,8 +18,6 @@ namespace Obi
static void CreateObiRope(MenuCommand menuCommand)
{
GameObject go = new GameObject("Obi Rope", typeof(ObiRope), typeof(ObiRopeExtrudedRenderer));
var renderer = go.GetComponent<ObiRopeExtrudedRenderer>();
renderer.material = ObiEditorUtils.GetDefaultMaterial();
ObiEditorUtils.PlaceActorRoot(go, menuCommand);
}
@@ -25,7 +28,6 @@ namespace Obi
SerializedProperty collisionMaterial;
SerializedProperty selfCollisions;
SerializedProperty surfaceCollisions;
SerializedProperty massScale;
SerializedProperty distanceConstraintsEnabled;
SerializedProperty stretchingScale;
@@ -38,10 +40,6 @@ namespace Obi
SerializedProperty plasticYield;
SerializedProperty plasticCreep;
SerializedProperty aerodynamicsEnabled;
SerializedProperty drag;
SerializedProperty lift;
SerializedProperty tearingEnabled;
SerializedProperty tearResistanceMultiplier;
SerializedProperty tearRate;
@@ -57,7 +55,6 @@ namespace Obi
collisionMaterial = serializedObject.FindProperty("m_CollisionMaterial");
selfCollisions = serializedObject.FindProperty("m_SelfCollisions");
surfaceCollisions = serializedObject.FindProperty("m_SurfaceCollisions");
massScale = serializedObject.FindProperty("m_MassScale");
distanceConstraintsEnabled = serializedObject.FindProperty("_distanceConstraintsEnabled");
stretchingScale = serializedObject.FindProperty("_stretchingScale");
@@ -70,10 +67,6 @@ namespace Obi
plasticYield = serializedObject.FindProperty("_plasticYield");
plasticCreep = serializedObject.FindProperty("_plasticCreep");
aerodynamicsEnabled = serializedObject.FindProperty("_aerodynamicsEnabled");
drag = serializedObject.FindProperty("_drag");
lift = serializedObject.FindProperty("_lift");
tearingEnabled = serializedObject.FindProperty("tearingEnabled");
tearResistanceMultiplier = serializedObject.FindProperty("tearResistanceMultiplier");
tearRate = serializedObject.FindProperty("tearRate");
@@ -119,29 +112,8 @@ namespace Obi
using (new EditorGUI.DisabledScope(ToolManager.activeToolType == typeof(ObiPathEditor)))
{
GUILayout.BeginHorizontal();
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(ropeBlueprint, new GUIContent("Blueprint"));
if (actor.ropeBlueprint == null)
{
if (GUILayout.Button("Create", EditorStyles.miniButton, GUILayout.MaxWidth(80)))
{
string path = EditorUtility.SaveFilePanel("Save blueprint", "Assets/", "RopeBlueprint", "asset");
if (!string.IsNullOrEmpty(path))
{
path = FileUtil.GetProjectRelativePath(path);
ObiRopeBlueprint asset = ScriptableObject.CreateInstance<ObiRopeBlueprint>();
AssetDatabase.CreateAsset(asset, path);
AssetDatabase.SaveAssets();
actor.ropeBlueprint = asset;
}
}
}
if (EditorGUI.EndChangeCheck())
{
foreach (var t in targets)
@@ -153,14 +125,8 @@ namespace Obi
foreach (var t in targets)
(t as ObiRope).AddToSolver();
}
GUILayout.EndHorizontal();
}
GUI.enabled = !Application.isPlaying;
EditorGUILayout.PropertyField(massScale, new GUIContent("Mass scale"));
GUI.enabled = true;
DoEditButton();
EditorGUILayout.Space();
@@ -193,11 +159,6 @@ namespace Obi
EditorGUILayout.PropertyField(plasticCreep, new GUIContent("Plastic creep"));
});
ObiEditorUtils.DoToggleablePropertyGroup(aerodynamicsEnabled, new GUIContent("Aerodynamics", Resources.Load<Texture2D>("Icons/ObiAerodynamicConstraints Icon")),
() => {
EditorGUILayout.PropertyField(drag, new GUIContent("Drag"));
EditorGUILayout.PropertyField(lift, new GUIContent("Lift"));
});
if (GUI.changed)
serializedObject.ApplyModifiedProperties();

View File

@@ -16,28 +16,22 @@ namespace Obi{
renderer = (ObiRopeExtrudedRenderer)target;
}
[MenuItem("CONTEXT/ObiRopeExtrudedRenderer/Bake mesh")]
static void Bake(MenuCommand command)
private void BakeMesh()
{
ObiRopeExtrudedRenderer renderer = (ObiRopeExtrudedRenderer)command.context;
if (renderer.actor.isLoaded)
if (renderer != null && renderer.extrudedMesh != null)
{
var system = renderer.actor.solver.GetRenderSystem<ObiRopeExtrudedRenderer>() as ObiExtrudedRopeRenderSystem;
if (system != null)
{
var mesh = new Mesh();
system.BakeMesh(renderer, ref mesh, true);
ObiEditorUtils.SaveMesh(mesh, "Save rope mesh", "rope mesh");
GameObject.DestroyImmediate(mesh);
}
ObiEditorUtils.SaveMesh(renderer.extrudedMesh, "Save extruded mesh", "rope mesh");
}
}
public override void OnInspectorGUI() {
serializedObject.UpdateIfRequiredOrScript();
if (GUILayout.Button("BakeMesh"))
{
BakeMesh();
}
Editor.DrawPropertiesExcluding(serializedObject,"m_Script");
@@ -46,6 +40,8 @@ namespace Obi{
serializedObject.ApplyModifiedProperties();
renderer.UpdateRenderer(renderer.GetComponent<ObiRopeBase>());
}
}

View File

@@ -27,7 +27,7 @@ namespace Obi{
serializedObject.ApplyModifiedProperties();
//renderer.UpdateRenderer(null);
renderer.UpdateRenderer(null);
}

View File

@@ -1,5 +1,8 @@
using UnityEditor;
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
namespace Obi{
@@ -8,34 +11,28 @@ namespace Obi{
{
ObiRopeMeshRenderer renderer;
[MenuItem("CONTEXT/ObiRopeMeshRenderer/Bake mesh")]
static void Bake(MenuCommand command)
{
ObiRopeMeshRenderer renderer = (ObiRopeMeshRenderer)command.context;
if (renderer.actor.isLoaded)
{
var system = renderer.actor.solver.GetRenderSystem<ObiRopeMeshRenderer>() as ObiMeshRopeRenderSystem;
if (system != null)
{
var mesh = new Mesh();
system.BakeMesh(renderer, ref mesh, true);
ObiEditorUtils.SaveMesh(mesh, "Save rope mesh", "rope mesh");
GameObject.DestroyImmediate(mesh);
}
}
}
public void OnEnable(){
public void OnEnable(){
renderer = (ObiRopeMeshRenderer)target;
}
private void BakeMesh()
{
if (renderer != null && renderer.deformedMesh != null)
{
ObiEditorUtils.SaveMesh(renderer.deformedMesh, "Save deformed mesh", "rope mesh");
}
}
public override void OnInspectorGUI() {
serializedObject.UpdateIfRequiredOrScript();
if (GUILayout.Button("BakeMesh"))
{
BakeMesh();
}
Editor.DrawPropertiesExcluding(serializedObject,"m_Script");
// Apply changes to the serializedProperty
@@ -43,6 +40,8 @@ namespace Obi{
serializedObject.ApplyModifiedProperties();
renderer.UpdateRenderer(renderer.GetComponent<ObiRopeBase>());
}
}

View File

@@ -1,169 +0,0 @@
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
using System.Collections.Generic;
using System.Linq;
namespace Obi
{
[CustomEditor(typeof(ObiPinhole))]
public class ObiPinholeEditor : Editor
{
SerializedProperty targetTransform;
SerializedProperty position;
SerializedProperty limitRange;
SerializedProperty range;
SerializedProperty compliance;
SerializedProperty friction;
SerializedProperty motorSpeed;
SerializedProperty motorForce;
SerializedProperty clamp;
SerializedProperty breakThreshold;
ObiPinhole pinhole;
public void OnEnable()
{
pinhole = target as ObiPinhole;
targetTransform = serializedObject.FindProperty("m_Target");
position = serializedObject.FindProperty("m_Position");
limitRange = serializedObject.FindProperty("m_LimitRange");
range = serializedObject.FindProperty("m_Range");
friction = serializedObject.FindProperty("m_Friction");
motorSpeed = serializedObject.FindProperty("m_MotorSpeed");
motorForce = serializedObject.FindProperty("m_MotorForce");
compliance = serializedObject.FindProperty("m_Compliance");
clamp = serializedObject.FindProperty("m_ClampAtEnds");
breakThreshold = serializedObject.FindProperty("breakThreshold");
}
public override void OnInspectorGUI()
{
serializedObject.UpdateIfRequiredOrScript();
// warn about incorrect setups:
if (!targetTransform.hasMultipleDifferentValues)
{
var targetValue = targetTransform.objectReferenceValue as UnityEngine.Component;
if (targetValue != null)
{
var collider = targetValue.GetComponent<ObiColliderBase>();
if (collider == null)
{
EditorGUILayout.HelpBox("Pinholes require the target object to have a ObiCollider component. Please add one.", MessageType.Warning);
}
}
}
EditorGUI.BeginChangeCheck();
Transform trget = EditorGUILayout.ObjectField("Target", pinhole.target, typeof(Transform), true) as Transform;
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(pinhole, "Set target");
pinhole.target = trget;
PrefabUtility.RecordPrefabInstancePropertyModifications(pinhole);
}
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(position, new GUIContent("Position"));
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
pinhole.CalculateMu();
}
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(limitRange, new GUIContent("Limit Range"));
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
pinhole.CalculateRange();
}
if (limitRange.boolValue)
{
EditorGUI.indentLevel++;
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(range, new GUIContent("Range"));
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
pinhole.CalculateRange();
}
EditorGUI.indentLevel--;
}
EditorGUILayout.PropertyField(clamp, new GUIContent("Clamp at ends"));
EditorGUILayout.PropertyField(friction, new GUIContent("Friction"));
EditorGUILayout.PropertyField(motorSpeed, new GUIContent("Motor Target Speed"));
EditorGUILayout.PropertyField(motorForce, new GUIContent("Motor Max Force"));
EditorGUILayout.PropertyField(compliance, new GUIContent("Compliance"));
EditorGUILayout.PropertyField(breakThreshold, new GUIContent("Break threshold"));
if (GUI.changed)
serializedObject.ApplyModifiedProperties();
}
[DrawGizmo(GizmoType.Selected)]
private static void DrawGizmos(ObiPinhole pinhole, GizmoType gizmoType)
{
var rope = pinhole.GetComponent<ObiRope>();
var ropeBlueprint = rope.sharedBlueprint as ObiRopeBlueprintBase;
if (rope.isLoaded && ropeBlueprint != null && ropeBlueprint.deformableEdges != null)
{
Handles.color = new Color(1, 0.5f, 0.2f, 1);
Handles.matrix = rope.solver.transform.localToWorldMatrix;
// draw limits:
if (pinhole.limitRange)
{
for (int i = pinhole.firstEdge.edgeIndex; i <= pinhole.lastEdge.edgeIndex; ++i)
{
if (i >= 0 && i < ropeBlueprint.deformableEdges.Length)
{
int p1 = ropeBlueprint.deformableEdges[i * 2];
int p2 = ropeBlueprint.deformableEdges[i * 2 + 1];
var pos1 = rope.solver.positions[rope.solverIndices[p1]];
var pos2 = rope.solver.positions[rope.solverIndices[p2]];
if (i == pinhole.firstEdge.edgeIndex)
{
pos1 = Vector4.Lerp(pos1, pos2, pinhole.firstEdge.coordinate);
Handles.DrawSolidDisc(pos1, pos2 - pos1, HandleUtility.GetHandleSize(pos1) * 0.05f);
}
if (i == pinhole.lastEdge.edgeIndex)
{
pos2 = Vector4.Lerp(pos1, pos2, pinhole.lastEdge.coordinate);
Handles.DrawSolidDisc(pos2, pos1 - pos2, HandleUtility.GetHandleSize(pos2) * 0.05f);
}
Handles.DrawLine(pos1, pos2, 2);
}
}
}
// draw source particle:
int edgeIndex = pinhole.edgeIndex;
if (edgeIndex >= 0 && edgeIndex < ropeBlueprint.deformableEdges.Length)
{
int p1 = ropeBlueprint.deformableEdges[edgeIndex * 2];
int p2 = ropeBlueprint.deformableEdges[edgeIndex * 2 + 1];
var pos1 = rope.solver.positions[rope.solverIndices[p1]];
var pos2 = rope.solver.positions[rope.solverIndices[p2]];
Vector4 pos = Vector4.Lerp(pos1, pos2, pinhole.edgeCoordinate);
Handles.DrawWireDisc(pos, pos1 - pos2, HandleUtility.GetHandleSize(pos) * 0.1f, 2);
}
}
}
}
}

9
Assets/Obi/Plugins.meta Normal file
View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 8e4e86215c462421ab9ce3fb2940e67e
folderAsset: yes
timeCreated: 1453095262
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: bd54dd4041414433090806277fe28ec5
folderAsset: yes
timeCreated: 1469612501
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 55c2294f77a2c4783b788be18cc01798
guid: d31cde6706d1446b7a73b166ec0b560b
folderAsset: yes
DefaultImporter:
externalObjects: {}

Binary file not shown.

View File

@@ -0,0 +1,102 @@
fileFormatVersion: 2
guid: ec20d84f513be4ff68f6efc457203d9c
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 0
Exclude Editor: 1
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
Exclude iOS: 1
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARM64
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: None
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: LinuxUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
iPhone: iOS
second:
enabled: 0
settings:
AddToEmbeddedBinaries: false
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,102 @@
fileFormatVersion: 2
guid: 2246ddc641dff4615884b65bd5612954
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 0
Exclude Editor: 1
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
Exclude iOS: 1
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARM64
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: None
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: LinuxUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
iPhone: iOS
second:
enabled: 0
settings:
AddToEmbeddedBinaries: false
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: ef39573ee97374cefb6e9a4b7bd78901
folderAsset: yes
timeCreated: 1469720436
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,90 @@
fileFormatVersion: 2
guid: 17ee7dcf8e257477b93c077d54c798fb
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
'': Linux
second:
enabled: 0
settings:
CPU: x86
- first:
'': OSXIntel
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
'': OSXIntel64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
iPhone: iOS
second:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,90 @@
fileFormatVersion: 2
guid: ba970f948815f4d80931d2e0de373138
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
'': Linux
second:
enabled: 0
settings:
CPU: x86
- first:
'': OSXIntel
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
'': OSXIntel64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
iPhone: iOS
second:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 4f17988a3533442abbe3f5731bcbee89
folderAsset: yes
timeCreated: 1469720436
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,90 @@
fileFormatVersion: 2
guid: 6a8150ad1b7c140b98640eab40a1c2b0
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
'': Linux
second:
enabled: 0
settings:
CPU: x86
- first:
'': OSXIntel
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
'': OSXIntel64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Android: Android
second:
enabled: 1
settings:
CPU: x86
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
iPhone: iOS
second:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,90 @@
fileFormatVersion: 2
guid: a91ed7ff7ee034fc891e4b665a3dfbff
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
'': Linux
second:
enabled: 0
settings:
CPU: x86
- first:
'': OSXIntel
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
'': OSXIntel64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Android: Android
second:
enabled: 1
settings:
CPU: x86
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
iPhone: iOS
second:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: ac2c20e2696d84b29a8bb41e98e72009
folderAsset: yes
timeCreated: 1454285704
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,435 @@
/*
* Oni.h
* Oni
*
* Created by José María Méndez González on 21/9/15.
* Copyright (c) 2015 ArK. All rights reserved.
*
*/
#ifndef Oni_
#define Oni_
#include "Solver.h"
#include "HalfEdgeMesh.h"
#include "ParticleGrid.h"
#include "ColliderGrid.h"
#if defined(__APPLE__) || defined(ANDROID) || defined(__linux__)
#define EXPORT __attribute__((visibility("default")))
#else
#define EXPORT __declspec(dllexport)
#endif
namespace Oni
{
struct ConstraintGroupParameters;
class ConstraintBatchBase;
struct Collider;
struct Rigidbody;
class TriangleSkinMap;
class DistanceField;
struct CollisionMaterial;
struct ProfileInfo;
struct DFNode;
struct TriangleMeshHeader;
struct EdgeMeshHeader;
struct BIHNode;
struct Triangle;
struct Edge;
template<class T>
struct ObjHandle
{
std::shared_ptr<T> ptr;
ObjHandle(T* obj):ptr(std::shared_ptr<T>(obj)){}
ObjHandle(std::shared_ptr<T> obj):ptr(obj){}
std::shared_ptr<T> operator->() const{
return ptr;
}
};
extern "C"
{
typedef ObjHandle<ConstraintBatchBase> ConstraintBatchHandle;
typedef ObjHandle<Collider> ColliderHandle;
typedef ObjHandle<Rigidbody> RigidbodyHandle;
typedef ObjHandle<CollisionMaterial> CollisionMaterialHandle;
typedef ObjHandle<DistanceField> DistanceFieldHandle;
typedef ObjHandle<Task> TaskHandle;
// Colliders ********************:
EXPORT void UpdateColliderGrid(float dt);
EXPORT void SetColliders(Collider* shapes, Bounds* bounds, Transform* transforms, int count);
EXPORT void SetRigidbodies(Rigidbody* rigidbodies);
EXPORT void SetCollisionMaterials(CollisionMaterial* materials);
EXPORT void SetTriangleMeshData(TriangleMeshHeader* headers, BIHNode* nodes, Triangle* triangles, Eigen::Vector3f* vertices);
EXPORT void SetEdgeMeshData(EdgeMeshHeader* headers, BIHNode* nodes, Edge* edges, Eigen::Vector2f* vertices);
EXPORT void SetDistanceFieldData(DistanceFieldHeader* headers, DFNode* nodes);
EXPORT void SetHeightFieldData(HeightFieldHeader* hf_headers, float* hf_samples);
// Distance fields ********************:
EXPORT DistanceFieldHandle* CreateDistanceField();
EXPORT void DestroyDistanceField(DistanceFieldHandle* df);
EXPORT void StartBuildingDistanceField(DistanceFieldHandle* df,float max_error,
int max_depth,
Eigen::Vector3f* vertex_positions,
int* triangle_indices_,
int num_vertices,
int num_triangles);
EXPORT bool ContinueBuildingDistanceField(DistanceFieldHandle* df);
EXPORT float SampleDistanceField(DistanceFieldHandle* df, float x, float y, float z);
EXPORT int GetDistanceFieldNodeCount(DistanceFieldHandle* df);
EXPORT void GetDistanceFieldNodes(DistanceFieldHandle* df, DFNode* nodes);
EXPORT void SetDistanceFieldNodes(DistanceFieldHandle* df, const DFNode* nodes, int num);
// Collision materials *****************:
EXPORT CollisionMaterialHandle* CreateCollisionMaterial();
EXPORT void UpdateCollisionMaterial(CollisionMaterialHandle* material, const CollisionMaterial& adaptor);
EXPORT void DestroyCollisionMaterial(CollisionMaterialHandle* collider);
// Solver ********************:
EXPORT Solver* CreateSolver(int capacity);
EXPORT void DestroySolver(Solver* solver);
EXPORT void SetCapacity(Solver* solver,int capacity);
EXPORT void InitializeFrame(Solver* solver,const Vector4fUnaligned& position, const Vector4fUnaligned& scale, const QuaternionfUnaligned& rotation);
EXPORT void UpdateFrame(Solver* solver,const Vector4fUnaligned& position, const Vector4fUnaligned& scale, const QuaternionfUnaligned& rotation, float dt);
EXPORT void ApplyFrame(Solver* solver, float linear_velocity_scale, float angular_velocity_scale, float linear_inertia_scale,float angular_inertia_scale, float dt);
EXPORT void GetBounds(Solver* solver, Eigen::Vector3f& min, Eigen::Vector3f& max);
EXPORT int GetParticleGridSize(Solver* solver);
EXPORT void GetParticleGrid(Solver* solver, Bounds* cells);
EXPORT void SetSolverParameters(Solver* solver, const SolverParameters* parameters);
EXPORT void GetSolverParameters(Solver* solver, SolverParameters* parameters);
EXPORT TaskHandle* CollisionDetection(Solver* solver, float step_time);
EXPORT TaskHandle* Step(Solver* solver, float step_time, float substep_time, int substeps);
EXPORT int SpatialQuery(Solver* solver, QueryShape* shapes, Transform* transforms, int shape_count);
EXPORT void GetQueryResults(Solver* solver, QueryResult* results, int num);
EXPORT void ApplyPositionInterpolation(Solver* solver,
Eigen::Vector4f* start_positions,
Eigen::Quaternionf* start_orientations,
float step_time,
float unsimulated_time);
EXPORT void UpdateSkeletalAnimation(Solver* solver);
EXPORT void RecalculateInertiaTensors(Solver* solver);
EXPORT void ResetForces(Solver* solver);
EXPORT void SetRigidbodyLinearDeltas(Solver* solver, Eigen::Vector4f* linear_deltas);
EXPORT void SetRigidbodyAngularDeltas(Solver* solver, Eigen::Vector4f* angular_deltas);
EXPORT int GetConstraintCount(Solver* solver, const Solver::ConstraintType type);
EXPORT int SetActiveParticles(Solver* solver, const int* active, int num);
EXPORT void SetParticleCollisionMaterials(Solver* solver, int* material_indices);
EXPORT void SetParticlePhases(Solver* solver, int* phases);
EXPORT void SetParticleFilters(Solver* solver, int* filters);
EXPORT void SetParticlePositions(Solver* solver, Eigen::Vector4f* positions);
EXPORT void SetParticlePreviousPositions(Solver* solver, Eigen::Vector4f* prev_positions);
EXPORT void SetParticleOrientations(Solver* solver,Eigen::Quaternionf* orientations);
EXPORT void SetParticlePreviousOrientations(Solver* solver, Eigen::Quaternionf* prev_orientations);
EXPORT void SetRenderableParticleOrientations(Solver* solver, Eigen::Quaternionf* orientations);
EXPORT void SetRenderableParticlePositions(Solver* solver, Eigen::Vector4f* positions);
EXPORT void SetParticleInverseMasses(Solver* solver, float* inv_masses);
EXPORT void SetParticleInverseRotationalMasses(Solver* solver, float* inv_rot_masses);
EXPORT void SetParticlePrincipalRadii(Solver* solver, Eigen::Vector4f* radii);
EXPORT void SetParticleVelocities(Solver* solver, Eigen::Vector4f* velocities);
EXPORT void SetParticleAngularVelocities(Solver* solver, Eigen::Vector4f* velocities);
EXPORT void SetParticleExternalForces(Solver* solver, Eigen::Vector4f* forces);
EXPORT void SetParticleExternalTorques(Solver* solver, Eigen::Vector4f* torques);
EXPORT void SetParticleWinds(Solver* solver, Eigen::Vector4f* wind);
EXPORT void SetParticlePositionDeltas(Solver* solver, Eigen::Vector4f* deltas);
EXPORT void SetParticleOrientationDeltas(Solver* solver, Eigen::Quaternionf* deltas);
EXPORT void SetParticlePositionConstraintCounts(Solver* solver, int* counts);
EXPORT void SetParticleOrientationConstraintCounts(Solver* solver, int* counts);
EXPORT void SetParticleNormals(Solver* solver, Eigen::Vector4f* normals);
EXPORT void SetParticleInverseInertiaTensors(Solver* solver, Eigen::Vector4f* tensors);
EXPORT int SetSimplices(Solver* solver, const int* simplices, int point_count, int edge_count, int triangle_count);
EXPORT int GetDeformableTriangleCount(Solver* solver);
EXPORT void SetDeformableTriangles(Solver* solver, const int* indices, int num, int dest_offset);
EXPORT int RemoveDeformableTriangles(Solver* solver, int num, int source_offset);
// Fluid ********************:
EXPORT void SetParticleSmoothingRadii(Solver* solver,float* radii);
EXPORT void SetParticleBuoyancy(Solver* solver,float* buoyancy);
EXPORT void SetParticleRestDensities(Solver* solver,float* rest_densities);
EXPORT void SetParticleViscosities(Solver* solver,float* viscosities);
EXPORT void SetParticleSurfaceTension(Solver* solver,float* surf_tension);
EXPORT void SetParticleVorticityConfinement(Solver* solver,float* vort_confinement);
EXPORT void SetParticleAtmosphericDragPressure(Solver* solver,float* atmospheric_drag, float* atmospheric_pressure);
EXPORT void SetParticleDiffusion(Solver* solver,float* diffusion);
EXPORT void SetParticleVorticities(Solver* solver, Eigen::Vector4f* vorticities);
EXPORT void SetParticleFluidData(Solver* solver, Eigen::Vector4f* fluid_data);
EXPORT void SetParticleUserData(Solver* solver, Eigen::Vector4f* user_data);
EXPORT void SetParticleAnisotropies(Solver* solver, Eigen::Vector4f* anisotropies);
EXPORT void SetConstraintGroupParameters(Solver* solver, const Solver::ConstraintType type, const ConstraintGroupParameters* parameters);
EXPORT void GetConstraintGroupParameters(Solver* solver, const Solver::ConstraintType type, ConstraintGroupParameters* parameters);
EXPORT void SetRestPositions(Solver* solver, Eigen::Vector4f* rest_positions);
EXPORT void SetRestOrientations(Solver* solver, Eigen::Quaternionf* rest_orientations);
// Batches ********************:
EXPORT ConstraintBatchHandle* CreateBatch(const Solver::ConstraintType type);
EXPORT void DestroyBatch(ConstraintBatchHandle* batch);
EXPORT void AddBatch(Solver* solver, ConstraintBatchHandle* batch);
EXPORT void RemoveBatch(Solver* solver, ConstraintBatchHandle* batch);
EXPORT void EnableBatch(ConstraintBatchHandle* batch, bool enabled);
EXPORT int GetBatchConstraintForces(ConstraintBatchHandle* batch, float* forces, int num, int source_offset);
// Constraints ********************:
EXPORT void SetBatchConstraintCount(ConstraintBatchHandle* batch, int num);
EXPORT int GetBatchConstraintCount(ConstraintBatchHandle* batch);
EXPORT void SetDistanceConstraints(ConstraintBatchHandle* batch,
int* indices,
float* restLengths,
float* stiffnesses,
float* lambdas,
int num);
EXPORT void SetBendingConstraints(ConstraintBatchHandle* batch,
int* indices,
float* rest_bends,
float* bending_stiffnesses,
float* plasticity,
float* lambdas,
int num);
EXPORT void SetSkinConstraints(ConstraintBatchHandle* batch,
int* indices,
Eigen::Vector4f* skin_points,
Eigen::Vector4f* skin_normals,
float* radii_backstops,
float* stiffnesses,
float* lambdas,
int num);
EXPORT void SetAerodynamicConstraints(ConstraintBatchHandle* batch,
int* triangle_indices,
float* aerodynamic_coeffs,
int num);
EXPORT void SetVolumeConstraints(ConstraintBatchHandle* batch,
int* triangle_indices,
int* first_triangle,
int* num_triangles,
float* rest_volumes,
float* pressure_stiffnesses,
float* lambdas,
int num);
EXPORT void SetShapeMatchingConstraints(ConstraintBatchHandle* batch,
int* shape_indices,
int* first_index,
int* num_indices,
int* explicit_group,
float* shape_material_parameters,
Eigen::Vector4f* rest_coms,
Eigen::Vector4f* coms,
Eigen::Quaternionf* orientations,
Eigen::Matrix4f* linear_transforms,
Eigen::Matrix4f* plastic_deformations,
int num);
EXPORT void CalculateRestShapeMatching(Solver* solver, ConstraintBatchHandle* batch);
EXPORT void SetStretchShearConstraints(ConstraintBatchHandle* batch,
int* particle_indices,
int* orientation_indices,
float* rest_lengths,
Eigen::Quaternionf* rest_orientations,
Eigen::Vector3f* stiffnesses,
Eigen::Vector3f* lambdas,
int num);
EXPORT void SetBendTwistConstraints(ConstraintBatchHandle* batch,
int* orientation_indices,
Eigen::Quaternionf* rest_darboux,
Eigen::Vector3f* stiffnesses,
float* plasticity,
Eigen::Vector3f* lambdas,
int num);
EXPORT void SetTetherConstraints(ConstraintBatchHandle* batch,
int* indices,
float* max_lenght_scales,
float* stiffnesses,
float* lambdas,
int num);
EXPORT void SetPinConstraints(ConstraintBatchHandle* batch,
int* indices,
Vector4f* pin_offsets,
Quaternionf* rest_darboux,
int* colliders,
float* stiffnesses,
Eigen::Vector4f* lambdas,
int num);
EXPORT void SetStitchConstraints(ConstraintBatchHandle* batch,
int* indices,
float* stiffnesses,
float* lambdas,
int num);
EXPORT void SetChainConstraints(ConstraintBatchHandle* batch,
int* indices,
float* rest_lengths,
int* first_index,
int* num_indices,
int num);
// Collision data ********************:
EXPORT void GetCollisionContacts(Solver* solver,Contact* contacts, int num);
EXPORT void GetParticleCollisionContacts(Solver* solver,Contact* contacts, int num);
// Diffuse particles ********************:
EXPORT void InterpolateDiffuseParticles(Solver* solver,
const Eigen::Vector4f* properties,
const Eigen::Vector4f* diffuse_positions,
Eigen::Vector4f* diffuse_properties,
int* neighbour_count,
int count);
// Skin maps ********************:
EXPORT TriangleSkinMap* CreateTriangleSkinMap();
EXPORT void DestroyTriangleSkinMap(TriangleSkinMap* map);
EXPORT void Bind(TriangleSkinMap* map, Mesh* source, Mesh* target,
const unsigned int* source_master_flags,
const unsigned int* target_slave_flags);
EXPORT int GetSkinnedVertexCount(TriangleSkinMap* map);
EXPORT void GetSkinInfo(TriangleSkinMap* map,
int* skin_indices,
int* source_tri_indices,
Eigen::Vector3f* bary_pos,
Eigen::Vector3f* bary_nrm,
Eigen::Vector3f* bary_tan);
EXPORT void SetSkinInfo(TriangleSkinMap* map,
const int* skin_indices,
const int* source_tri_indices,
const Eigen::Vector3f* bary_pos,
const Eigen::Vector3f* bary_nrm,
const Eigen::Vector3f* bary_tan,
int num);
// Tasks ********************:
EXPORT void CompleteAll();
EXPORT void Complete(TaskHandle* task);
EXPORT TaskHandle* CreateEmpty();
EXPORT void Schedule(TaskHandle* task);
EXPORT void AddChild(TaskHandle* task, TaskHandle* child);
// Profiling ****************:
EXPORT int GetMaxSystemConcurrency();
EXPORT void ClearProfiler();
EXPORT void EnableProfiler(bool enabled);
EXPORT void BeginSample(const char* name, unsigned char type);
EXPORT void EndSample();
EXPORT int GetProfilingInfoCount();
EXPORT void GetProfilingInfo(ProfileInfo* info, int count);
}
}
#endif

View File

@@ -0,0 +1,90 @@
fileFormatVersion: 2
guid: 03646faf401f74c9e8e73b6365c17f63
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
'': Linux
second:
enabled: 0
settings:
CPU: x86
- first:
'': OSXIntel
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
'': OSXIntel64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Android: Android
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
iPhone: iOS
second:
enabled: 1
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,72 @@
/*
* OniHelpers.h
* Oni
*
* Created by José María Méndez González on 21/9/15.
* Copyright (c) 2015 ArK. All rights reserved.
*
*/
#ifndef OniHelpers_
#define OniHelpers_
#include "Dense"
#include "HalfEdgeMesh.h"
#if defined(__APPLE__) || defined(ANDROID) || defined(__linux__)
#define EXPORT __attribute__((visibility("default")))
#else
#define EXPORT __declspec(dllexport)
#endif
namespace Oni
{
extern "C"
{
EXPORT int MakePhase(int group, int flags);
EXPORT int GetGroupFromPhase(int phase);
/**
* Calculates the rest bend factor for a bending constraint between 3 particles.
* @param coordinates an array of 9 floats: x,y,z of the first particle, x,y,z of the second particle, x,y,z of the third (central) particle.
*/
EXPORT float BendingConstraintRest(float* coordinates);
EXPORT HalfEdgeMesh* CreateHalfEdgeMesh();
EXPORT void DestroyHalfEdgeMesh(HalfEdgeMesh* mesh);
EXPORT void GetHalfEdgeMeshInfo(HalfEdgeMesh* mesh, HalfEdgeMesh::MeshInformation* mesh_info);
EXPORT void CalculatePrimitiveCounts(HalfEdgeMesh* mesh,
Eigen::Vector3f* vertices,
int* triangles,
int vertex_count,
int triangle_count);
EXPORT void Generate(HalfEdgeMesh* mesh,
Eigen::Vector3f* vertices,
int* triangles,
int vertex_count,
int triangle_count,
float* scale);
EXPORT void SetHalfEdges(HalfEdgeMesh* mesh,HalfEdgeMesh::HalfEdge* half_edges, int count);
EXPORT void SetVertices(HalfEdgeMesh* mesh,HalfEdgeMesh::Vertex* vertices, int count);
EXPORT void SetFaces(HalfEdgeMesh* mesh,HalfEdgeMesh::Face* faces, int count);
EXPORT void SetNormals(HalfEdgeMesh* mesh,Eigen::Vector3f* normals);
EXPORT void SetTangents(HalfEdgeMesh* mesh,Vector4fUnaligned* tangents);
EXPORT void SetInverseOrientations(HalfEdgeMesh* mesh,QuaternionfUnaligned* orientations);
EXPORT void SetVisualMap(HalfEdgeMesh* mesh,int* map);
EXPORT int GetHalfEdgeCount(HalfEdgeMesh* mesh);
EXPORT int GetVertexCount(HalfEdgeMesh* mesh);
EXPORT int GetFaceCount(HalfEdgeMesh* mesh);
EXPORT void GetPointCloudAnisotropy(Eigen::Vector3f* points,int count,float max_anisotropy,float radius, const Eigen::Vector3f& hint_normal, Eigen::Vector3f& centroid, QuaternionfUnaligned& orientation,Eigen::Vector3f& principal_values);
}
}
#endif

View File

@@ -0,0 +1,90 @@
fileFormatVersion: 2
guid: 4f88b733d928048638365465e86b8f3b
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
'': Linux
second:
enabled: 0
settings:
CPU: x86
- first:
'': OSXIntel
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
'': OSXIntel64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Android: Android
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
iPhone: iOS
second:
enabled: 1
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,105 @@
fileFormatVersion: 2
guid: 480286a2338ca4cb6a36110dcd0614f4
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 1
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
Exclude iOS: 0
- first:
Android: Android
second:
enabled: 0
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: LinuxUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
iPhone: iOS
second:
enabled: 1
settings:
AddToEmbeddedBinaries: false
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,40 @@
fileFormatVersion: 2
guid: 2882732abb8524a2dad5a38e94bea1fc
folderAsset: yes
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
'': OSXIntel
second:
enabled: 1
settings: {}
- first:
'': OSXIntel64
second:
enabled: 1
settings: {}
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 63dbef444f58449a5b4786567ee38655
guid: b0f57a84cadd44090a54d60174a2e7e9
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>19E266</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>Oni</string>
<key>CFBundleIdentifier</key>
<string>com.Ark.Oni</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Oni</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>12D4e</string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>DTPlatformVersion</key>
<string>11.1</string>
<key>DTSDKBuild</key>
<string>20C63</string>
<key>DTSDKName</key>
<string>macosx11.1</string>
<key>DTXcode</key>
<string>1240</string>
<key>DTXcodeBuild</key>
<string>12D4e</string>
<key>LSMinimumSystemVersion</key>
<string>10.11</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2016 Ark. All rights reserved.</string>
</dict>
</plist>

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 72e3dd3ad91bf485099095b5e59ff81b
guid: 9571d0925c2004cd38ac86f7d85b061f
folderAsset: yes
DefaultImporter:
externalObjects: {}

Binary file not shown.

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: f31685c4cf95048ceb543a69d4f84ff4
guid: 99a8462e7396040d782ca6004afd63e8
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -0,0 +1,19 @@
include(RegexUtils)
test_escape_string_as_regex()
file(GLOB Eigen_directory_files "*")
escape_string_as_regex(ESCAPED_CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
foreach(f ${Eigen_directory_files})
if(NOT f MATCHES "\\.txt" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/[.].+" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/src")
list(APPEND Eigen_directory_files_to_install ${f})
endif()
endforeach(f ${Eigen_directory_files})
install(FILES
${Eigen_directory_files_to_install}
DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel
)
install(DIRECTORY src DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel FILES_MATCHING PATTERN "*.h")

View File

@@ -0,0 +1,46 @@
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef EIGEN_CHOLESKY_MODULE_H
#define EIGEN_CHOLESKY_MODULE_H
#include "Core"
#include "Jacobi"
#include "src/Core/util/DisableStupidWarnings.h"
/** \defgroup Cholesky_Module Cholesky module
*
*
*
* This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices.
* Those decompositions are also accessible via the following methods:
* - MatrixBase::llt()
* - MatrixBase::ldlt()
* - SelfAdjointView::llt()
* - SelfAdjointView::ldlt()
*
* \code
* #include <Eigen/Cholesky>
* \endcode
*/
#include "src/Cholesky/LLT.h"
#include "src/Cholesky/LDLT.h"
#ifdef EIGEN_USE_LAPACKE
#ifdef EIGEN_USE_MKL
#include "mkl_lapacke.h"
#else
#include "src/misc/lapacke.h"
#endif
#include "src/Cholesky/LLT_LAPACKE.h"
#endif
#include "src/Core/util/ReenableStupidWarnings.h"
#endif // EIGEN_CHOLESKY_MODULE_H
/* vim: set filetype=cpp et sw=2 ts=2 ai: */

View File

@@ -0,0 +1,48 @@
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef EIGEN_CHOLMODSUPPORT_MODULE_H
#define EIGEN_CHOLMODSUPPORT_MODULE_H
#include "SparseCore"
#include "src/Core/util/DisableStupidWarnings.h"
extern "C" {
#include <cholmod.h>
}
/** \ingroup Support_modules
* \defgroup CholmodSupport_Module CholmodSupport module
*
* This module provides an interface to the Cholmod library which is part of the <a href="http://www.suitesparse.com">suitesparse</a> package.
* It provides the two following main factorization classes:
* - class CholmodSupernodalLLT: a supernodal LLT Cholesky factorization.
* - class CholmodDecomposiiton: a general L(D)LT Cholesky factorization with automatic or explicit runtime selection of the underlying factorization method (supernodal or simplicial).
*
* For the sake of completeness, this module also propose the two following classes:
* - class CholmodSimplicialLLT
* - class CholmodSimplicialLDLT
* Note that these classes does not bring any particular advantage compared to the built-in
* SimplicialLLT and SimplicialLDLT factorization classes.
*
* \code
* #include <Eigen/CholmodSupport>
* \endcode
*
* In order to use this module, the cholmod headers must be accessible from the include paths, and your binary must be linked to the cholmod library and its dependencies.
* The dependencies depend on how cholmod has been compiled.
* For a cmake based project, you can use our FindCholmod.cmake module to help you in this task.
*
*/
#include "src/CholmodSupport/CholmodSupport.h"
#include "src/Core/util/ReenableStupidWarnings.h"
#endif // EIGEN_CHOLMODSUPPORT_MODULE_H

View File

@@ -0,0 +1,537 @@
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
// Copyright (C) 2007-2011 Benoit Jacob <jacob.benoit.1@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef EIGEN_CORE_H
#define EIGEN_CORE_H
// first thing Eigen does: stop the compiler from committing suicide
#include "src/Core/util/DisableStupidWarnings.h"
#if defined(__CUDACC__) && !defined(EIGEN_NO_CUDA)
#define EIGEN_CUDACC __CUDACC__
#endif
#if defined(__CUDA_ARCH__) && !defined(EIGEN_NO_CUDA)
#define EIGEN_CUDA_ARCH __CUDA_ARCH__
#endif
#if defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 9)
#define EIGEN_CUDACC_VER ((__CUDACC_VER_MAJOR__ * 10000) + (__CUDACC_VER_MINOR__ * 100))
#elif defined(__CUDACC_VER__)
#define EIGEN_CUDACC_VER __CUDACC_VER__
#else
#define EIGEN_CUDACC_VER 0
#endif
// Handle NVCC/CUDA/SYCL
#if defined(__CUDACC__) || defined(__SYCL_DEVICE_ONLY__)
// Do not try asserts on CUDA and SYCL!
#ifndef EIGEN_NO_DEBUG
#define EIGEN_NO_DEBUG
#endif
#ifdef EIGEN_INTERNAL_DEBUGGING
#undef EIGEN_INTERNAL_DEBUGGING
#endif
#ifdef EIGEN_EXCEPTIONS
#undef EIGEN_EXCEPTIONS
#endif
// All functions callable from CUDA code must be qualified with __device__
#ifdef __CUDACC__
// Do not try to vectorize on CUDA and SYCL!
#ifndef EIGEN_DONT_VECTORIZE
#define EIGEN_DONT_VECTORIZE
#endif
#define EIGEN_DEVICE_FUNC __host__ __device__
// We need cuda_runtime.h to ensure that that EIGEN_USING_STD_MATH macro
// works properly on the device side
#include <cuda_runtime.h>
#else
#define EIGEN_DEVICE_FUNC
#endif
#else
#define EIGEN_DEVICE_FUNC
#endif
// When compiling CUDA device code with NVCC, pull in math functions from the
// global namespace. In host mode, and when device doee with clang, use the
// std versions.
#if defined(__CUDA_ARCH__) && defined(__NVCC__)
#define EIGEN_USING_STD_MATH(FUNC) using ::FUNC;
#else
#define EIGEN_USING_STD_MATH(FUNC) using std::FUNC;
#endif
#if (defined(_CPPUNWIND) || defined(__EXCEPTIONS)) && !defined(__CUDA_ARCH__) && !defined(EIGEN_EXCEPTIONS) && !defined(EIGEN_USE_SYCL)
#define EIGEN_EXCEPTIONS
#endif
#ifdef EIGEN_EXCEPTIONS
#include <new>
#endif
// then include this file where all our macros are defined. It's really important to do it first because
// it's where we do all the alignment settings (platform detection and honoring the user's will if he
// defined e.g. EIGEN_DONT_ALIGN) so it needs to be done before we do anything with vectorization.
#include "src/Core/util/Macros.h"
// Disable the ipa-cp-clone optimization flag with MinGW 6.x or newer (enabled by default with -O3)
// See http://eigen.tuxfamily.org/bz/show_bug.cgi?id=556 for details.
#if EIGEN_COMP_MINGW && EIGEN_GNUC_AT_LEAST(4,6)
#pragma GCC optimize ("-fno-ipa-cp-clone")
#endif
#include <complex>
// this include file manages BLAS and MKL related macros
// and inclusion of their respective header files
#include "src/Core/util/MKL_support.h"
// if alignment is disabled, then disable vectorization. Note: EIGEN_MAX_ALIGN_BYTES is the proper check, it takes into
// account both the user's will (EIGEN_MAX_ALIGN_BYTES,EIGEN_DONT_ALIGN) and our own platform checks
#if EIGEN_MAX_ALIGN_BYTES==0
#ifndef EIGEN_DONT_VECTORIZE
#define EIGEN_DONT_VECTORIZE
#endif
#endif
#if EIGEN_COMP_MSVC
#include <malloc.h> // for _aligned_malloc -- need it regardless of whether vectorization is enabled
#if (EIGEN_COMP_MSVC >= 1500) // 2008 or later
// Remember that usage of defined() in a #define is undefined by the standard.
// a user reported that in 64-bit mode, MSVC doesn't care to define _M_IX86_FP.
#if (defined(_M_IX86_FP) && (_M_IX86_FP >= 2)) || EIGEN_ARCH_x86_64
#define EIGEN_SSE2_ON_MSVC_2008_OR_LATER
#endif
#endif
#else
// Remember that usage of defined() in a #define is undefined by the standard
#if (defined __SSE2__) && ( (!EIGEN_COMP_GNUC) || EIGEN_COMP_ICC || EIGEN_GNUC_AT_LEAST(4,2) )
#define EIGEN_SSE2_ON_NON_MSVC_BUT_NOT_OLD_GCC
#endif
#endif
#ifndef EIGEN_DONT_VECTORIZE
#if defined (EIGEN_SSE2_ON_NON_MSVC_BUT_NOT_OLD_GCC) || defined(EIGEN_SSE2_ON_MSVC_2008_OR_LATER)
// Defines symbols for compile-time detection of which instructions are
// used.
// EIGEN_VECTORIZE_YY is defined if and only if the instruction set YY is used
#define EIGEN_VECTORIZE
#define EIGEN_VECTORIZE_SSE
#define EIGEN_VECTORIZE_SSE2
// Detect sse3/ssse3/sse4:
// gcc and icc defines __SSE3__, ...
// there is no way to know about this on msvc. You can define EIGEN_VECTORIZE_SSE* if you
// want to force the use of those instructions with msvc.
#ifdef __SSE3__
#define EIGEN_VECTORIZE_SSE3
#endif
#ifdef __SSSE3__
#define EIGEN_VECTORIZE_SSSE3
#endif
#ifdef __SSE4_1__
#define EIGEN_VECTORIZE_SSE4_1
#endif
#ifdef __SSE4_2__
#define EIGEN_VECTORIZE_SSE4_2
#endif
#ifdef __AVX__
#define EIGEN_VECTORIZE_AVX
#define EIGEN_VECTORIZE_SSE3
#define EIGEN_VECTORIZE_SSSE3
#define EIGEN_VECTORIZE_SSE4_1
#define EIGEN_VECTORIZE_SSE4_2
#endif
#ifdef __AVX2__
#define EIGEN_VECTORIZE_AVX2
#endif
#ifdef __FMA__
#define EIGEN_VECTORIZE_FMA
#endif
#if defined(__AVX512F__) && defined(EIGEN_ENABLE_AVX512)
#define EIGEN_VECTORIZE_AVX512
#define EIGEN_VECTORIZE_AVX2
#define EIGEN_VECTORIZE_AVX
#define EIGEN_VECTORIZE_FMA
#ifdef __AVX512DQ__
#define EIGEN_VECTORIZE_AVX512DQ
#endif
#ifdef __AVX512ER__
#define EIGEN_VECTORIZE_AVX512ER
#endif
#endif
// include files
// This extern "C" works around a MINGW-w64 compilation issue
// https://sourceforge.net/tracker/index.php?func=detail&aid=3018394&group_id=202880&atid=983354
// In essence, intrin.h is included by windows.h and also declares intrinsics (just as emmintrin.h etc. below do).
// However, intrin.h uses an extern "C" declaration, and g++ thus complains of duplicate declarations
// with conflicting linkage. The linkage for intrinsics doesn't matter, but at that stage the compiler doesn't know;
// so, to avoid compile errors when windows.h is included after Eigen/Core, ensure intrinsics are extern "C" here too.
// notice that since these are C headers, the extern "C" is theoretically needed anyways.
extern "C" {
// In theory we should only include immintrin.h and not the other *mmintrin.h header files directly.
// Doing so triggers some issues with ICC. However old gcc versions seems to not have this file, thus:
#if EIGEN_COMP_ICC >= 1110
#include <immintrin.h>
#else
#include <mmintrin.h>
#include <emmintrin.h>
#include <xmmintrin.h>
#ifdef EIGEN_VECTORIZE_SSE3
#include <pmmintrin.h>
#endif
#ifdef EIGEN_VECTORIZE_SSSE3
#include <tmmintrin.h>
#endif
#ifdef EIGEN_VECTORIZE_SSE4_1
#include <smmintrin.h>
#endif
#ifdef EIGEN_VECTORIZE_SSE4_2
#include <nmmintrin.h>
#endif
#if defined(EIGEN_VECTORIZE_AVX) || defined(EIGEN_VECTORIZE_AVX512)
#include <immintrin.h>
#endif
#endif
} // end extern "C"
#elif defined __VSX__
#define EIGEN_VECTORIZE
#define EIGEN_VECTORIZE_VSX
#include <altivec.h>
// We need to #undef all these ugly tokens defined in <altivec.h>
// => use __vector instead of vector
#undef bool
#undef vector
#undef pixel
#elif defined __ALTIVEC__
#define EIGEN_VECTORIZE
#define EIGEN_VECTORIZE_ALTIVEC
#include <altivec.h>
// We need to #undef all these ugly tokens defined in <altivec.h>
// => use __vector instead of vector
#undef bool
#undef vector
#undef pixel
#elif (defined __ARM_NEON) || (defined __ARM_NEON__)
#define EIGEN_VECTORIZE
#define EIGEN_VECTORIZE_NEON
#include <arm_neon.h>
#elif (defined __s390x__ && defined __VEC__)
#define EIGEN_VECTORIZE
#define EIGEN_VECTORIZE_ZVECTOR
#include <vecintrin.h>
#endif
#endif
#if defined(__F16C__) && !defined(EIGEN_COMP_CLANG)
// We can use the optimized fp16 to float and float to fp16 conversion routines
#define EIGEN_HAS_FP16_C
#endif
#if defined __CUDACC__
#define EIGEN_VECTORIZE_CUDA
#include <vector_types.h>
#if EIGEN_CUDACC_VER >= 70500
#define EIGEN_HAS_CUDA_FP16
#endif
#endif
#if defined EIGEN_HAS_CUDA_FP16
#include <host_defines.h>
#include <cuda_fp16.h>
#endif
#if (defined _OPENMP) && (!defined EIGEN_DONT_PARALLELIZE)
#define EIGEN_HAS_OPENMP
#endif
#ifdef EIGEN_HAS_OPENMP
#include <omp.h>
#endif
// MSVC for windows mobile does not have the errno.h file
#if !(EIGEN_COMP_MSVC && EIGEN_OS_WINCE) && !EIGEN_COMP_ARM
#define EIGEN_HAS_ERRNO
#endif
#ifdef EIGEN_HAS_ERRNO
#include <cerrno>
#endif
#include <cstddef>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <functional>
#include <iosfwd>
#include <cstring>
#include <string>
#include <limits>
#include <climits> // for CHAR_BIT
// for min/max:
#include <algorithm>
// for std::is_nothrow_move_assignable
#ifdef EIGEN_INCLUDE_TYPE_TRAITS
#include <type_traits>
#endif
// for outputting debug info
#ifdef EIGEN_DEBUG_ASSIGN
#include <iostream>
#endif
// required for __cpuid, needs to be included after cmath
#if EIGEN_COMP_MSVC && EIGEN_ARCH_i386_OR_x86_64 && !EIGEN_OS_WINCE
#include <intrin.h>
#endif
/** \brief Namespace containing all symbols from the %Eigen library. */
namespace Eigen {
inline static const char *SimdInstructionSetsInUse(void) {
#if defined(EIGEN_VECTORIZE_AVX512)
return "AVX512, FMA, AVX2, AVX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2";
#elif defined(EIGEN_VECTORIZE_AVX)
return "AVX SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2";
#elif defined(EIGEN_VECTORIZE_SSE4_2)
return "SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2";
#elif defined(EIGEN_VECTORIZE_SSE4_1)
return "SSE, SSE2, SSE3, SSSE3, SSE4.1";
#elif defined(EIGEN_VECTORIZE_SSSE3)
return "SSE, SSE2, SSE3, SSSE3";
#elif defined(EIGEN_VECTORIZE_SSE3)
return "SSE, SSE2, SSE3";
#elif defined(EIGEN_VECTORIZE_SSE2)
return "SSE, SSE2";
#elif defined(EIGEN_VECTORIZE_ALTIVEC)
return "AltiVec";
#elif defined(EIGEN_VECTORIZE_VSX)
return "VSX";
#elif defined(EIGEN_VECTORIZE_NEON)
return "ARM NEON";
#elif defined(EIGEN_VECTORIZE_ZVECTOR)
return "S390X ZVECTOR";
#else
return "None";
#endif
}
} // end namespace Eigen
#if defined EIGEN2_SUPPORT_STAGE40_FULL_EIGEN3_STRICTNESS || defined EIGEN2_SUPPORT_STAGE30_FULL_EIGEN3_API || defined EIGEN2_SUPPORT_STAGE20_RESOLVE_API_CONFLICTS || defined EIGEN2_SUPPORT_STAGE10_FULL_EIGEN2_API || defined EIGEN2_SUPPORT
// This will generate an error message:
#error Eigen2-support is only available up to version 3.2. Please go to "http://eigen.tuxfamily.org/index.php?title=Eigen2" for further information
#endif
namespace Eigen {
// we use size_t frequently and we'll never remember to prepend it with std:: everytime just to
// ensure QNX/QCC support
using std::size_t;
// gcc 4.6.0 wants std:: for ptrdiff_t
using std::ptrdiff_t;
}
/** \defgroup Core_Module Core module
* This is the main module of Eigen providing dense matrix and vector support
* (both fixed and dynamic size) with all the features corresponding to a BLAS library
* and much more...
*
* \code
* #include <Eigen/Core>
* \endcode
*/
#include "src/Core/util/Constants.h"
#include "src/Core/util/Meta.h"
#include "src/Core/util/ForwardDeclarations.h"
#include "src/Core/util/StaticAssert.h"
#include "src/Core/util/XprHelper.h"
#include "src/Core/util/Memory.h"
#include "src/Core/NumTraits.h"
#include "src/Core/MathFunctions.h"
#include "src/Core/GenericPacketMath.h"
#include "src/Core/MathFunctionsImpl.h"
#include "src/Core/arch/Default/ConjHelper.h"
#if defined EIGEN_VECTORIZE_AVX512
#include "src/Core/arch/SSE/PacketMath.h"
#include "src/Core/arch/AVX/PacketMath.h"
#include "src/Core/arch/AVX512/PacketMath.h"
#include "src/Core/arch/AVX512/MathFunctions.h"
#elif defined EIGEN_VECTORIZE_AVX
// Use AVX for floats and doubles, SSE for integers
#include "src/Core/arch/SSE/PacketMath.h"
#include "src/Core/arch/SSE/Complex.h"
#include "src/Core/arch/SSE/MathFunctions.h"
#include "src/Core/arch/AVX/PacketMath.h"
#include "src/Core/arch/AVX/MathFunctions.h"
#include "src/Core/arch/AVX/Complex.h"
#include "src/Core/arch/AVX/TypeCasting.h"
#include "src/Core/arch/SSE/TypeCasting.h"
#elif defined EIGEN_VECTORIZE_SSE
#include "src/Core/arch/SSE/PacketMath.h"
#include "src/Core/arch/SSE/MathFunctions.h"
#include "src/Core/arch/SSE/Complex.h"
#include "src/Core/arch/SSE/TypeCasting.h"
#elif defined(EIGEN_VECTORIZE_ALTIVEC) || defined(EIGEN_VECTORIZE_VSX)
#include "src/Core/arch/AltiVec/PacketMath.h"
#include "src/Core/arch/AltiVec/MathFunctions.h"
#include "src/Core/arch/AltiVec/Complex.h"
#elif defined EIGEN_VECTORIZE_NEON
#include "src/Core/arch/NEON/PacketMath.h"
#include "src/Core/arch/NEON/MathFunctions.h"
#include "src/Core/arch/NEON/Complex.h"
#elif defined EIGEN_VECTORIZE_ZVECTOR
#include "src/Core/arch/ZVector/PacketMath.h"
#include "src/Core/arch/ZVector/MathFunctions.h"
#include "src/Core/arch/ZVector/Complex.h"
#endif
// Half float support
#include "src/Core/arch/CUDA/Half.h"
#include "src/Core/arch/CUDA/PacketMathHalf.h"
#include "src/Core/arch/CUDA/TypeCasting.h"
#if defined EIGEN_VECTORIZE_CUDA
#include "src/Core/arch/CUDA/PacketMath.h"
#include "src/Core/arch/CUDA/MathFunctions.h"
#endif
#include "src/Core/arch/Default/Settings.h"
#include "src/Core/functors/TernaryFunctors.h"
#include "src/Core/functors/BinaryFunctors.h"
#include "src/Core/functors/UnaryFunctors.h"
#include "src/Core/functors/NullaryFunctors.h"
#include "src/Core/functors/StlFunctors.h"
#include "src/Core/functors/AssignmentFunctors.h"
// Specialized functors to enable the processing of complex numbers
// on CUDA devices
#include "src/Core/arch/CUDA/Complex.h"
#include "src/Core/IO.h"
#include "src/Core/DenseCoeffsBase.h"
#include "src/Core/DenseBase.h"
#include "src/Core/MatrixBase.h"
#include "src/Core/EigenBase.h"
#include "src/Core/Product.h"
#include "src/Core/CoreEvaluators.h"
#include "src/Core/AssignEvaluator.h"
#ifndef EIGEN_PARSED_BY_DOXYGEN // work around Doxygen bug triggered by Assign.h r814874
// at least confirmed with Doxygen 1.5.5 and 1.5.6
#include "src/Core/Assign.h"
#endif
#include "src/Core/ArrayBase.h"
#include "src/Core/util/BlasUtil.h"
#include "src/Core/DenseStorage.h"
#include "src/Core/NestByValue.h"
// #include "src/Core/ForceAlignedAccess.h"
#include "src/Core/ReturnByValue.h"
#include "src/Core/NoAlias.h"
#include "src/Core/PlainObjectBase.h"
#include "src/Core/Matrix.h"
#include "src/Core/Array.h"
#include "src/Core/CwiseTernaryOp.h"
#include "src/Core/CwiseBinaryOp.h"
#include "src/Core/CwiseUnaryOp.h"
#include "src/Core/CwiseNullaryOp.h"
#include "src/Core/CwiseUnaryView.h"
#include "src/Core/SelfCwiseBinaryOp.h"
#include "src/Core/Dot.h"
#include "src/Core/StableNorm.h"
#include "src/Core/Stride.h"
#include "src/Core/MapBase.h"
#include "src/Core/Map.h"
#include "src/Core/Ref.h"
#include "src/Core/Block.h"
#include "src/Core/VectorBlock.h"
#include "src/Core/Transpose.h"
#include "src/Core/DiagonalMatrix.h"
#include "src/Core/Diagonal.h"
#include "src/Core/DiagonalProduct.h"
#include "src/Core/Redux.h"
#include "src/Core/Visitor.h"
#include "src/Core/Fuzzy.h"
#include "src/Core/Swap.h"
#include "src/Core/CommaInitializer.h"
#include "src/Core/GeneralProduct.h"
#include "src/Core/Solve.h"
#include "src/Core/Inverse.h"
#include "src/Core/SolverBase.h"
#include "src/Core/PermutationMatrix.h"
#include "src/Core/Transpositions.h"
#include "src/Core/TriangularMatrix.h"
#include "src/Core/SelfAdjointView.h"
#include "src/Core/products/GeneralBlockPanelKernel.h"
#include "src/Core/products/Parallelizer.h"
#include "src/Core/ProductEvaluators.h"
#include "src/Core/products/GeneralMatrixVector.h"
#include "src/Core/products/GeneralMatrixMatrix.h"
#include "src/Core/SolveTriangular.h"
#include "src/Core/products/GeneralMatrixMatrixTriangular.h"
#include "src/Core/products/SelfadjointMatrixVector.h"
#include "src/Core/products/SelfadjointMatrixMatrix.h"
#include "src/Core/products/SelfadjointProduct.h"
#include "src/Core/products/SelfadjointRank2Update.h"
#include "src/Core/products/TriangularMatrixVector.h"
#include "src/Core/products/TriangularMatrixMatrix.h"
#include "src/Core/products/TriangularSolverMatrix.h"
#include "src/Core/products/TriangularSolverVector.h"
#include "src/Core/BandMatrix.h"
#include "src/Core/CoreIterators.h"
#include "src/Core/ConditionEstimator.h"
#include "src/Core/BooleanRedux.h"
#include "src/Core/Select.h"
#include "src/Core/VectorwiseOp.h"
#include "src/Core/Random.h"
#include "src/Core/Replicate.h"
#include "src/Core/Reverse.h"
#include "src/Core/ArrayWrapper.h"
#ifdef EIGEN_USE_BLAS
#include "src/Core/products/GeneralMatrixMatrix_BLAS.h"
#include "src/Core/products/GeneralMatrixVector_BLAS.h"
#include "src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h"
#include "src/Core/products/SelfadjointMatrixMatrix_BLAS.h"
#include "src/Core/products/SelfadjointMatrixVector_BLAS.h"
#include "src/Core/products/TriangularMatrixMatrix_BLAS.h"
#include "src/Core/products/TriangularMatrixVector_BLAS.h"
#include "src/Core/products/TriangularSolverMatrix_BLAS.h"
#endif // EIGEN_USE_BLAS
#ifdef EIGEN_USE_MKL_VML
#include "src/Core/Assign_MKL.h"
#endif
#include "src/Core/GlobalFunctions.h"
#include "src/Core/util/ReenableStupidWarnings.h"
#endif // EIGEN_CORE_H

View File

@@ -0,0 +1,7 @@
#include "Core"
#include "LU"
#include "Cholesky"
#include "QR"
#include "SVD"
#include "Geometry"
#include "Eigenvalues"

View File

@@ -0,0 +1,2 @@
#include "Dense"
#include "Sparse"

View File

@@ -0,0 +1,61 @@
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef EIGEN_EIGENVALUES_MODULE_H
#define EIGEN_EIGENVALUES_MODULE_H
#include "Core"
#include "src/Core/util/DisableStupidWarnings.h"
#include "Cholesky"
#include "Jacobi"
#include "Householder"
#include "LU"
#include "Geometry"
/** \defgroup Eigenvalues_Module Eigenvalues module
*
*
*
* This module mainly provides various eigenvalue solvers.
* This module also provides some MatrixBase methods, including:
* - MatrixBase::eigenvalues(),
* - MatrixBase::operatorNorm()
*
* \code
* #include <Eigen/Eigenvalues>
* \endcode
*/
#include "src/misc/RealSvd2x2.h"
#include "src/Eigenvalues/Tridiagonalization.h"
#include "src/Eigenvalues/RealSchur.h"
#include "src/Eigenvalues/EigenSolver.h"
#include "src/Eigenvalues/SelfAdjointEigenSolver.h"
#include "src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h"
#include "src/Eigenvalues/HessenbergDecomposition.h"
#include "src/Eigenvalues/ComplexSchur.h"
#include "src/Eigenvalues/ComplexEigenSolver.h"
#include "src/Eigenvalues/RealQZ.h"
#include "src/Eigenvalues/GeneralizedEigenSolver.h"
#include "src/Eigenvalues/MatrixBaseEigenvalues.h"
#ifdef EIGEN_USE_LAPACKE
#ifdef EIGEN_USE_MKL
#include "mkl_lapacke.h"
#else
#include "src/misc/lapacke.h"
#endif
#include "src/Eigenvalues/RealSchur_LAPACKE.h"
#include "src/Eigenvalues/ComplexSchur_LAPACKE.h"
#include "src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h"
#endif
#include "src/Core/util/ReenableStupidWarnings.h"
#endif // EIGEN_EIGENVALUES_MODULE_H
/* vim: set filetype=cpp et sw=2 ts=2 ai: */

View File

@@ -0,0 +1,62 @@
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef EIGEN_GEOMETRY_MODULE_H
#define EIGEN_GEOMETRY_MODULE_H
#include "Core"
#include "src/Core/util/DisableStupidWarnings.h"
#include "SVD"
#include "LU"
#include <limits>
/** \defgroup Geometry_Module Geometry module
*
* This module provides support for:
* - fixed-size homogeneous transformations
* - translation, scaling, 2D and 3D rotations
* - \link Quaternion quaternions \endlink
* - cross products (\ref MatrixBase::cross, \ref MatrixBase::cross3)
* - orthognal vector generation (\ref MatrixBase::unitOrthogonal)
* - some linear components: \link ParametrizedLine parametrized-lines \endlink and \link Hyperplane hyperplanes \endlink
* - \link AlignedBox axis aligned bounding boxes \endlink
* - \link umeyama least-square transformation fitting \endlink
*
* \code
* #include <Eigen/Geometry>
* \endcode
*/
#include "src/Geometry/OrthoMethods.h"
#include "src/Geometry/EulerAngles.h"
#include "src/Geometry/Homogeneous.h"
#include "src/Geometry/RotationBase.h"
#include "src/Geometry/Rotation2D.h"
#include "src/Geometry/Quaternion.h"
#include "src/Geometry/AngleAxis.h"
#include "src/Geometry/Transform.h"
#include "src/Geometry/Translation.h"
#include "src/Geometry/Scaling.h"
#include "src/Geometry/Hyperplane.h"
#include "src/Geometry/ParametrizedLine.h"
#include "src/Geometry/AlignedBox.h"
#include "src/Geometry/Umeyama.h"
// Use the SSE optimized version whenever possible. At the moment the
// SSE version doesn't compile when AVX is enabled
#if defined EIGEN_VECTORIZE_SSE && !defined EIGEN_VECTORIZE_AVX
#include "src/Geometry/arch/Geometry_SSE.h"
#endif
#include "src/Core/util/ReenableStupidWarnings.h"
#endif // EIGEN_GEOMETRY_MODULE_H
/* vim: set filetype=cpp et sw=2 ts=2 ai: */

Some files were not shown because too many files have changed in this diff Show More