浏览代码

Fixed a bug in body parts positions conversion to body space. Fixed camera follow to always look at body.

/PhysXArticulations20201
Vilmantas Balasevicius 5 年前
当前提交
dd91e261
共有 3 个文件被更改,包括 45 次插入8 次删除
  1. 50
      UnitySDK/Assets/ML-Agents/Examples/Crawler/Scenes/ArticulatedCrawlerStaticTarget.unity
  2. 2
      UnitySDK/Assets/ML-Agents/Examples/Crawler/Scripts/ArticulatedCrawlerAgent.cs
  3. 1
      UnitySDK/Assets/ML-Agents/Examples/SharedAssets/Scripts/CameraFollow.cs

50
UnitySDK/Assets/ML-Agents/Examples/Crawler/Scenes/ArticulatedCrawlerStaticTarget.unity


propertyPath: m_Name
value: ArticulatedFixedPlatform (7)
objectReference: {fileID: 0}
- target: {fileID: 1306438584782738, guid: 0647effc95026f46dbf821c2032caba7, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4309919623019186, guid: 0647effc95026f46dbf821c2032caba7, type: 3}
propertyPath: m_LocalPosition.x
value: 200

propertyPath: m_Name
value: ArticulatedFixedPlatform (4)
objectReference: {fileID: 0}
- target: {fileID: 1306438584782738, guid: 0647effc95026f46dbf821c2032caba7, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4309919623019186, guid: 0647effc95026f46dbf821c2032caba7, type: 3}
propertyPath: m_LocalPosition.x
value: 200

propertyPath: m_Name
value: ArticulatedFixedPlatform (9)
objectReference: {fileID: 0}
- target: {fileID: 1306438584782738, guid: 0647effc95026f46dbf821c2032caba7, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4309919623019186, guid: 0647effc95026f46dbf821c2032caba7, type: 3}
propertyPath: m_LocalPosition.x
value: 200

propertyPath: m_Name
value: ArticulatedFixedPlatform (1)
objectReference: {fileID: 0}
- target: {fileID: 1306438584782738, guid: 0647effc95026f46dbf821c2032caba7, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4309919623019186, guid: 0647effc95026f46dbf821c2032caba7, type: 3}
propertyPath: m_LocalPosition.x
value: 200

propertyPath: m_Name
value: ArticulatedFixedPlatform (5)
objectReference: {fileID: 0}
- target: {fileID: 1306438584782738, guid: 0647effc95026f46dbf821c2032caba7, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4309919623019186, guid: 0647effc95026f46dbf821c2032caba7, type: 3}
propertyPath: m_LocalPosition.x
value: 200

- target: {fileID: 1306438584782738, guid: 0647effc95026f46dbf821c2032caba7, type: 3}
propertyPath: m_Name
value: ArticulatedFixedPlatform (8)
objectReference: {fileID: 0}
- target: {fileID: 1306438584782738, guid: 0647effc95026f46dbf821c2032caba7, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4309919623019186, guid: 0647effc95026f46dbf821c2032caba7, type: 3}
propertyPath: m_LocalPosition.x

m_Script: {fileID: 11500000, guid: ec40c70d5160b47cd8deaab79e24892c, type: 3}
m_Name:
m_EditorClassIdentifier:
target: {fileID: 1398146390}
--- !u!4 &1398146390 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 5559669379100656999, guid: 0647effc95026f46dbf821c2032caba7,
type: 3}
m_PrefabInstance: {fileID: 1920093150}
m_PrefabAsset: {fileID: 0}
target: {fileID: 2069169549}
--- !u!1001 &1442348229
PrefabInstance:
m_ObjectHideFlags: 0

- target: {fileID: 1306438584782738, guid: 0647effc95026f46dbf821c2032caba7, type: 3}
propertyPath: m_Name
value: ArticulatedFixedPlatform (2)
objectReference: {fileID: 0}
- target: {fileID: 1306438584782738, guid: 0647effc95026f46dbf821c2032caba7, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4309919623019186, guid: 0647effc95026f46dbf821c2032caba7, type: 3}
propertyPath: m_LocalPosition.x

- target: {fileID: 1306438584782738, guid: 0647effc95026f46dbf821c2032caba7, type: 3}
propertyPath: m_Name
value: ArticulatedFixedPlatform (6)
objectReference: {fileID: 0}
- target: {fileID: 1306438584782738, guid: 0647effc95026f46dbf821c2032caba7, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4309919623019186, guid: 0647effc95026f46dbf821c2032caba7, type: 3}
propertyPath: m_LocalPosition.x

propertyPath: m_Name
value: ArticulatedFixedPlatform (3)
objectReference: {fileID: 0}
- target: {fileID: 1306438584782738, guid: 0647effc95026f46dbf821c2032caba7, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4309919623019186, guid: 0647effc95026f46dbf821c2032caba7, type: 3}
propertyPath: m_LocalPosition.x
value: 200

m_CorrespondingSourceObject: {fileID: 4749909135913778, guid: 0647effc95026f46dbf821c2032caba7,
type: 3}
m_PrefabInstance: {fileID: 1920093150}
m_PrefabAsset: {fileID: 0}
--- !u!4 &2069169549 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 5559669379100656999, guid: 0647effc95026f46dbf821c2032caba7,
type: 3}
m_PrefabInstance: {fileID: 1743765740}
m_PrefabAsset: {fileID: 0}
--- !u!1 &2095421678
GameObject:

2
UnitySDK/Assets/ML-Agents/Examples/Crawler/Scripts/ArticulatedCrawlerAgent.cs


if (bp.arb.transform != body)
{
var localPosRelToBody = body.InverseTransformPoint(arb.transform.TransformPoint(arb.transform.position)); // Translate from world space to body local space, since all articulations are children of body in hiearchy
var localPosRelToBody = body.InverseTransformPoint(arb.transform.position); // Translate from world space to body local space, since all articulations are children of body in hiearchy
AddVectorObs(localPosRelToBody);
AddVectorObs(bp.currentXNormalizedRot); // Current x rot
AddVectorObs(bp.currentYNormalizedRot); // Current y rot

1
UnitySDK/Assets/ML-Agents/Examples/SharedAssets/Scripts/CameraFollow.cs


var newPosition = new Vector3(target.position.x + m_Offset.x, transform.position.y,
target.position.z + m_Offset.z);
gameObject.transform.position = newPosition;
gameObject.transform.LookAt(target);
}
}
}
正在加载...
取消
保存