Skip to content

Commit

Permalink
Initial commit (v1.1.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
yafei-ou committed Nov 15, 2024
0 parents commit bb73f0e
Show file tree
Hide file tree
Showing 253 changed files with 28,543 additions and 0 deletions.
82 changes: 82 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore
#
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
/[Uu]ser[Ss]ettings/

# MemoryCaptures can get excessive in size.
# They also could contain extremely sensitive data
/[Mm]emoryCaptures/

# Recordings can get excessive in size
/[Rr]ecordings/

# Uncomment this line if you wish to ignore the asset store tools plugin
# /[Aa]ssets/AssetStoreTools*

# Autogenerated Jetbrains Rider plugin
/[Aa]ssets/Plugins/Editor/JetBrains*

# Visual Studio cache directory
.vs/

# Gradle cache directory
.gradle/

# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
*.mdb
*.opendb
*.VC.db

# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta

# Unity3D generated file on crash reports
sysinfo.txt

# Builds
*.apk
*.aab
*.unitypackage
*.app

# Crashlytics generated file
crashlytics-build.properties

# Packed Addressables
/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*

# Temporary auto-generated Android Assets
/[Aa]ssets/[Ss]treamingAssets/aa.meta
/[Aa]ssets/[Ss]treamingAssets/aa/*

# VS Code
.vscode/*

# Native libraries
*.dll
*.so

# mono crash report
*.blob
8 changes: 8 additions & 0 deletions Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Editor/Actors.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions Editor/Actors/PhysxActorEditorBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using UnityEditor;
using UnityEngine;

namespace PhysX5ForUnity
{
public abstract class PhysxActorEditorBase : PhysxEditorBase
{
protected virtual void OnEnable()
{
m_scene = serializedObject.FindProperty("m_scene");
}

protected SerializedProperty m_scene;

protected GUIContent m_sceneLabelContent = new GUIContent("PhysX Scene");
}
}
11 changes: 11 additions & 0 deletions Editor/Actors/PhysxActorEditorBase.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions Editor/Actors/PhysxArticulationKinematicTreeEditor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using UnityEditor;

namespace PhysX5ForUnity
{
[CustomEditor(typeof(PhysxArticulationKinematicTree))]
[CanEditMultipleObjects]
public class PhysxArticulationKinematicTreeEditor : PhysxActorEditorBase
{
protected override void OnEnable()
{
base.OnEnable();
m_fixBase = serializedObject.FindProperty("m_fixBase");
m_disableSelfCollision = serializedObject.FindProperty("m_disableSelfCollision");
m_links = serializedObject.FindProperty("m_links");
m_density = serializedObject.FindProperty("m_density");
}

protected override void DrawInspectorGUI()
{
serializedObject.Update();

EditorGUILayout.PropertyField(m_scene, m_sceneLabelContent);
EditorGUILayout.PropertyField(m_fixBase);
EditorGUILayout.PropertyField(m_disableSelfCollision);
EditorGUILayout.PropertyField(m_density);
EditorGUILayout.PropertyField(m_links);

serializedObject.ApplyModifiedProperties();
}

protected SerializedProperty m_fixBase;
protected SerializedProperty m_disableSelfCollision;
protected SerializedProperty m_links;
protected SerializedProperty m_density;
}
}
11 changes: 11 additions & 0 deletions Editor/Actors/PhysxArticulationKinematicTreeEditor.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 59 additions & 0 deletions Editor/Actors/PhysxArticulationLinkEditor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using UnityEditor;
using UnityEngine;

namespace PhysX5ForUnity
{
[CustomEditor(typeof(PhysxArticulationLink))]
[CanEditMultipleObjects]
public class PhysxArticulationLinkEditor : PhysxArticulationLinkEditorBase
{
protected override void OnEnable()
{
base.OnEnable();
m_parentLink = serializedObject.FindProperty("m_parentLink");
m_articulationAxis = serializedObject.FindProperty("m_articulationAxis");
m_isDriveJoint = serializedObject.FindProperty("m_isDriveJoint");
}

protected override void DrawInspectorGUI()
{
serializedObject.Update();

EditorGUILayout.PropertyField(m_parentLink);
EditorGUILayout.PropertyField(m_jointOnParent);
EditorGUILayout.PropertyField(m_jointOnSelf);
EditorGUILayout.PropertyField(m_jointType);

if (m_jointType.enumValueIndex!=0)
{
EditorGUILayout.PropertyField(m_articulationAxis);

GUILayout.BeginVertical("HelpBox");

EditorGUILayout.LabelField("Joint Limits", EditorStyles.boldLabel);
float jointLimMin = m_jointLimLower.floatValue;
float jointLimMax = m_jointLimUpper.floatValue;
EditorGUILayout.MinMaxSlider(ref jointLimMin, ref jointLimMax, -2 * Mathf.PI, 2 * Mathf.PI);
m_jointLimLower.floatValue = jointLimMin;
m_jointLimUpper.floatValue = jointLimMax;
EditorGUILayout.PropertyField(m_jointLimLower, m_jointLimLowerLabelContent);
EditorGUILayout.PropertyField(m_jointLimUpper, m_jointLimUpperLabelContent);

GUILayout.EndVertical();
EditorGUILayout.PropertyField(m_isDriveJoint);
if (m_isDriveJoint.boolValue)
{
EditorGUILayout.PropertyField(m_driveGainP);
EditorGUILayout.PropertyField(m_driveGainD);
EditorGUILayout.PropertyField(m_driveMaxForce);
}
}

serializedObject.ApplyModifiedProperties();
}

protected SerializedProperty m_parentLink;
protected SerializedProperty m_articulationAxis;
protected SerializedProperty m_isDriveJoint;
}
}
11 changes: 11 additions & 0 deletions Editor/Actors/PhysxArticulationLinkEditor.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions Editor/Actors/PhysxArticulationLinkEditorBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using UnityEditor;
using UnityEngine;

namespace PhysX5ForUnity
{
public abstract class PhysxArticulationLinkEditorBase : PhysxEditorBase
{
protected virtual void OnEnable()
{
m_jointOnParent = serializedObject.FindProperty("m_jointOnParent");
m_jointOnSelf = serializedObject.FindProperty("m_jointOnSelf");
m_jointType = serializedObject.FindProperty("m_jointType");
m_jointLimLower = serializedObject.FindProperty("m_jointLimLower");
m_jointLimUpper = serializedObject.FindProperty("m_jointLimUpper");
m_driveGainP = serializedObject.FindProperty("m_driveGainP");
m_driveGainD = serializedObject.FindProperty("m_driveGainD");
m_driveMaxForce = serializedObject.FindProperty("m_driveMaxForce");
}

protected SerializedProperty m_jointOnParent;
protected SerializedProperty m_jointOnSelf;
protected SerializedProperty m_jointType;
protected SerializedProperty m_jointLimLower;
protected SerializedProperty m_jointLimUpper;
protected SerializedProperty m_driveGainP;
protected SerializedProperty m_driveGainD;
protected SerializedProperty m_driveMaxForce;

protected GUIContent m_jointLimLowerLabelContent = new GUIContent("Lower Limit");
protected GUIContent m_jointLimUpperLabelContent = new GUIContent("Upper Limit");
}
}
11 changes: 11 additions & 0 deletions Editor/Actors/PhysxArticulationLinkEditorBase.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions Editor/Actors/PhysxArticulationRobotEditor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using UnityEditor;

namespace PhysX5ForUnity
{
[CustomEditor(typeof(PhysxArticulationRobot))]
[CanEditMultipleObjects]
public class PhysxArticulationRobotEditor : PhysxArticulationKinematicTreeEditor
{
protected override void OnEnable()
{
base.OnEnable();
m_basePose = serializedObject.FindProperty("m_basePose");
m_eeLinks = serializedObject.FindProperty("m_eeLinks");
}

protected override void DrawInspectorGUI()
{
serializedObject.Update();

EditorGUILayout.PropertyField(m_scene, m_sceneLabelContent);
EditorGUILayout.PropertyField(m_fixBase);
EditorGUILayout.PropertyField(m_disableSelfCollision);
EditorGUILayout.PropertyField(m_basePose);
EditorGUILayout.PropertyField(m_density);
EditorGUILayout.PropertyField(m_links);
EditorGUILayout.PropertyField(m_eeLinks);

serializedObject.ApplyModifiedProperties();
}

protected SerializedProperty m_basePose;
protected SerializedProperty m_eeLinks;
}
}
11 changes: 11 additions & 0 deletions Editor/Actors/PhysxArticulationRobotEditor.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions Editor/Actors/PhysxArticulationRobotLinkEditor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using UnityEditor;
using UnityEngine;

namespace PhysX5ForUnity
{
[CustomEditor(typeof(PhysxArticulationRobotLink))]
[CanEditMultipleObjects]
public class PhysxArticulationRobotLinkEditor : PhysxArticulationLinkEditorBase
{
protected override void DrawInspectorGUI()
{
serializedObject.Update();

EditorGUILayout.PropertyField(m_jointOnParent);
EditorGUILayout.PropertyField(m_jointOnSelf);
EditorGUILayout.PropertyField(m_jointType);

if (m_jointType.enumValueIndex!=0)
{
GUILayout.BeginVertical("HelpBox");

EditorGUILayout.LabelField("Joint Limits", EditorStyles.boldLabel);
float jointLimMin = m_jointLimLower.floatValue;
float jointLimMax = m_jointLimUpper.floatValue;
EditorGUILayout.MinMaxSlider(ref jointLimMin, ref jointLimMax, -2 * Mathf.PI, 2 * Mathf.PI);
m_jointLimLower.floatValue = jointLimMin;
m_jointLimUpper.floatValue = jointLimMax;
EditorGUILayout.PropertyField(m_jointLimLower, m_jointLimLowerLabelContent);
EditorGUILayout.PropertyField(m_jointLimUpper, m_jointLimUpperLabelContent);

GUILayout.EndVertical();
EditorGUILayout.PropertyField(m_driveGainP);
EditorGUILayout.PropertyField(m_driveGainD);
EditorGUILayout.PropertyField(m_driveMaxForce);
}

serializedObject.ApplyModifiedProperties();
}
}
}
Loading

0 comments on commit bb73f0e

Please sign in to comment.