• Articles
  • Api Documentation
Show / Hide Table of Contents
  • AsyncGPUReadbackPluginNs
    • AsyncGPUReadbackPlugin
    • AsyncGPUReadbackPluginRequest
  • ZO
    • ZOMouseOrbitCamera
  • ZO.Controllers
    • ZO2FingerGripController
    • ZOLinearActuator
    • ZOLinearActuator.Axis
    • ZOServoMotorActuator
  • ZO.Document
    • ZOSerializationInterface
    • ZOSimDocumentRoot
    • ZOSimOccurrence
  • ZO.Math
    • ZOGaussianNoiseModel
    • ZOMathUtil
    • ZOMatrix4x4Util
    • ZORandom
  • ZO.Networking
    • ZOBinaryMessagePublisher
    • ZOBinaryMessageSubscriber
    • ZOJSONMessagePublisher
    • ZOJSONMessageSubscriber
    • ZOPubSubHeader
    • ZOTCPServer
  • ZO.Physics
    • ZOArticulatedBody
    • ZOFixedJoint
    • ZOHingeJoint
    • ZOJointInterface
    • ZOPIDController
    • ZOSpeedLimiter
  • ZO.ROS
    • ZOROSActionServer<TActionMessage, TGoalMessage>
    • ZOROSAPI
    • ZOROSBridgeConnection
    • ZOROSBridgeConnection.ROSBridgeConnectionChangeHandler
    • ZOROSBridgeConnection.SerializationType
  • ZO.ROS.Controllers
    • ControllerStateEnum
    • ZOArmController
    • ZODifferentialDriveController
    • ZOROSControllerInterface
  • ZO.ROS.MessageTypes
    • ZOROSMessageInterface
  • ZO.ROS.MessageTypes.ActionLib
    • ActionStatusEnum
    • GoalIDMessage
    • GoalStatusArrayMessage
    • GoalStatusMessage
    • ZOROSActionGoalMessageInterface
    • ZOROSActionMessageInterface
  • ZO.ROS.MessageTypes.Control
    • FollowJointTrajectoryActionFeedback
    • FollowJointTrajectoryActionGoal
    • FollowJointTrajectoryActionMessage
    • FollowJointTrajectoryActionResult
    • FollowJointTrajectoryFeedback
    • FollowJointTrajectoryGoal
    • FollowJointTrajectoryResult
    • JointToleranceMessage
    • JointTrajectoryControllerStateMessage
  • ZO.ROS.MessageTypes.ControllerManager
    • ControllerStateMessage
    • HardwareInterfaceResourcesMessage
    • ListControllersResponse
    • ListControllerTypesServiceResponse
    • LoadControllerServiceRequest
    • LoadControllerServiceResponse
    • ReloadControllerLibrariesServiceRequest
    • ReloadControllerLibrariesServiceResponse
    • SwitchControllerServiceRequest
    • SwitchControllerServiceResponse
    • UnloadControllerServiceRequest
    • UnloadControllerServiceResponse
  • ZO.ROS.MessageTypes.Gazebo
    • SpawnModelServiceRequest
    • SpawnModelServiceResponse
  • ZO.ROS.MessageTypes.Geometry
    • PointMessage
    • PoseMessage
    • PoseWithCovarianceMessage
    • QuaternionMessage
    • TransformMessage
    • TransformStampedMessage
    • TwistMessage
    • TwistWithCovarianceMessage
    • Vector3Message
  • ZO.ROS.MessageTypes.Nav
    • OdometryMessage
  • ZO.ROS.MessageTypes.ROSAPI
    • GetParamNamesResponse
    • GetParamResponse
    • GetParamServiceRequest
    • HasParamResponse
    • HasParamServiceRequest
    • SetParamServiceRequest
  • ZO.ROS.MessageTypes.ROSGraph
    • ClockMessage
  • ZO.ROS.MessageTypes.Sensor
    • CameraInfoMessage
    • ImageMessage
    • ImuMessage
    • JointStateMessage
    • LaserScanMessage
    • RegionOfInterestMessage
  • ZO.ROS.MessageTypes.Std
    • DurationMessage
    • EmptyServiceRequest
    • EmptyServiceRespone
    • HeaderMessage
    • Int32Message
    • SetBoolServiceRequest
    • SetBoolServiceResponse
    • StringMessage
    • TimeMessage
  • ZO.ROS.MessageTypes.TF2
    • TFMessage
  • ZO.ROS.MessageTypes.Trajectory
    • JointTrajectoryMessage
    • JointTrajectoryPointMessage
  • ZO.ROS.MessageTypes.ZOSim
    • ZOSimDeleteModelRequest
    • ZOSimDeleteModelResponse
    • ZOSimPrefabSpawnRequest
    • ZOSimPrefabSpawnResponse
    • ZOSimSpawnServiceRequest
    • ZOSimSpawnServiceResponse
  • ZO.ROS.Publisher
    • ZOROSImagePublisher
    • ZOROSIMUPublisher
    • ZOROSIMUPublisher.CoordinateSystemEnum
    • ZOROSJointStatesPublisher
    • ZOROSLaserScanPublisher
    • ZOROSRGBDepthPublisher
    • ZOROSStereoImagePublisher
    • ZOROSTransformPublisher
  • ZO.ROS.Unity
    • ZOROSUnityGameObjectBase
    • ZOROSUnityInterface
    • ZOROSUnityManager
    • ZOROSUnityManager.ROSBridgeConnectionChangeHandler
  • ZO.ROS.Unity.Docker
    • ZOROSLaunchParameters
  • ZO.ROS.Unity.Service
    • ZOControllerManagerService
    • ZOSimDeleteModelService
    • ZOSimPrefabSpawnService
    • ZOSimResetSimulationService
    • ZOSimSpawnService
  • ZO.Sensors
    • ZOContactDetector
    • ZOContactSwitchDualChannel
    • ZOIMU
    • ZOLIDAR2D
    • ZOLIDAR3D
    • ZOLIDAR3D.ReferenceFrame
    • ZORaycastJobBatch
    • ZORGBCamera
    • ZORGBDepthCamera
    • ZORGBDepthCamera.FrameOutputType
  • ZO.Util
    • ZOCenterOfMass
    • ZOClock
    • ZODocker
    • ZODocker.VolumeMapEntry
    • ZODockerRunParameters
    • ZODrawArc
    • ZODrawCircle
    • ZOEarthUtils
    • ZOEarthUtils.GeoPoint
    • ZOEarthUtils.HomeGeoPoint
    • ZOFrequencyCounter
    • ZOFrequencyCounter.TimeSourceType
    • ZOGameObjectBase
    • ZOMagnetometer
    • ZOMoveTest
    • ZOMoveTest.MoveTypeEnum
    • ZORandomizePhysics
    • ZORandomizeTransform
    • ZOReadOnlyAttribute
    • ZOSystem
    • ZOTurnOffSelfCollision
  • ZO.Util.Extensions
    • ZOJSONExtensions
  • ZO.Util.Rendering
    • ZOAsyncGPUReadbackPlugin
    • ZOAsyncGPUReadbackPluginRequest

Class ZOSimDocumentRoot

A ZOSim root document. This is the "document root" and "root" GameObject component in the
Unity object hierarchy.

For example the Unity structure could be:

ZOSimDocumentRoot:
ZOSimOccurrence:
ZOSimOccurrence:
    ZOSimOccurrence:
    ZOSimOccurrence:
        ZOSimOccurrence:

It is primarily responsible for serialization of the Unity structure to ZoSim JSON document and deserialization from ZoSim JSON document to a Unity structure.

Inheritance
System.Object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
ZOSimDocumentRoot
Inherited Members
UnityEngine.MonoBehaviour.IsInvoking()
UnityEngine.MonoBehaviour.CancelInvoke()
UnityEngine.MonoBehaviour.Invoke(System.String, System.Single)
UnityEngine.MonoBehaviour.InvokeRepeating(System.String, System.Single, System.Single)
UnityEngine.MonoBehaviour.CancelInvoke(System.String)
UnityEngine.MonoBehaviour.IsInvoking(System.String)
UnityEngine.MonoBehaviour.StartCoroutine(System.String)
UnityEngine.MonoBehaviour.StartCoroutine(System.String, System.Object)
UnityEngine.MonoBehaviour.StartCoroutine(System.Collections.IEnumerator)
UnityEngine.MonoBehaviour.StartCoroutine_Auto(System.Collections.IEnumerator)
UnityEngine.MonoBehaviour.StopCoroutine(System.Collections.IEnumerator)
UnityEngine.MonoBehaviour.StopCoroutine(UnityEngine.Coroutine)
UnityEngine.MonoBehaviour.StopCoroutine(System.String)
UnityEngine.MonoBehaviour.StopAllCoroutines()
UnityEngine.MonoBehaviour.print(System.Object)
UnityEngine.MonoBehaviour.useGUILayout
UnityEngine.MonoBehaviour.runInEditMode
UnityEngine.Behaviour.enabled
UnityEngine.Behaviour.isActiveAndEnabled
UnityEngine.Component.GetComponent(System.Type)
UnityEngine.Component.GetComponent<T>()
UnityEngine.Component.TryGetComponent(System.Type, UnityEngine.Component)
UnityEngine.Component.TryGetComponent<T>(T)
UnityEngine.Component.GetComponent(System.String)
UnityEngine.Component.GetComponentInChildren(System.Type, System.Boolean)
UnityEngine.Component.GetComponentInChildren(System.Type)
UnityEngine.Component.GetComponentInChildren<T>(System.Boolean)
UnityEngine.Component.GetComponentInChildren<T>()
UnityEngine.Component.GetComponentsInChildren(System.Type, System.Boolean)
UnityEngine.Component.GetComponentsInChildren(System.Type)
UnityEngine.Component.GetComponentsInChildren<T>(System.Boolean)
UnityEngine.Component.GetComponentsInChildren<T>(System.Boolean, System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponentsInChildren<T>()
UnityEngine.Component.GetComponentsInChildren<T>(System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponentInParent(System.Type)
UnityEngine.Component.GetComponentInParent<T>()
UnityEngine.Component.GetComponentsInParent(System.Type, System.Boolean)
UnityEngine.Component.GetComponentsInParent(System.Type)
UnityEngine.Component.GetComponentsInParent<T>(System.Boolean)
UnityEngine.Component.GetComponentsInParent<T>(System.Boolean, System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponentsInParent<T>()
UnityEngine.Component.GetComponents(System.Type)
UnityEngine.Component.GetComponents(System.Type, System.Collections.Generic.List<UnityEngine.Component>)
UnityEngine.Component.GetComponents<T>(System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponents<T>()
UnityEngine.Component.CompareTag(System.String)
UnityEngine.Component.SendMessageUpwards(System.String, System.Object, UnityEngine.SendMessageOptions)
UnityEngine.Component.SendMessageUpwards(System.String, System.Object)
UnityEngine.Component.SendMessageUpwards(System.String)
UnityEngine.Component.SendMessageUpwards(System.String, UnityEngine.SendMessageOptions)
UnityEngine.Component.SendMessage(System.String, System.Object)
UnityEngine.Component.SendMessage(System.String)
UnityEngine.Component.SendMessage(System.String, System.Object, UnityEngine.SendMessageOptions)
UnityEngine.Component.SendMessage(System.String, UnityEngine.SendMessageOptions)
UnityEngine.Component.BroadcastMessage(System.String, System.Object, UnityEngine.SendMessageOptions)
UnityEngine.Component.BroadcastMessage(System.String, System.Object)
UnityEngine.Component.BroadcastMessage(System.String)
UnityEngine.Component.BroadcastMessage(System.String, UnityEngine.SendMessageOptions)
UnityEngine.Component.transform
UnityEngine.Component.gameObject
UnityEngine.Component.tag
UnityEngine.Object.GetInstanceID()
UnityEngine.Object.GetHashCode()
UnityEngine.Object.Equals(System.Object)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion, UnityEngine.Transform)
UnityEngine.Object.Instantiate(UnityEngine.Object)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Transform)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Transform, System.Boolean)
UnityEngine.Object.Instantiate<T>(T)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion, UnityEngine.Transform)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform, System.Boolean)
UnityEngine.Object.Destroy(UnityEngine.Object, System.Single)
UnityEngine.Object.Destroy(UnityEngine.Object)
UnityEngine.Object.DestroyImmediate(UnityEngine.Object, System.Boolean)
UnityEngine.Object.DestroyImmediate(UnityEngine.Object)
UnityEngine.Object.FindObjectsOfType(System.Type)
UnityEngine.Object.FindObjectsOfType(System.Type, System.Boolean)
UnityEngine.Object.DontDestroyOnLoad(UnityEngine.Object)
UnityEngine.Object.DestroyObject(UnityEngine.Object, System.Single)
UnityEngine.Object.DestroyObject(UnityEngine.Object)
UnityEngine.Object.FindSceneObjectsOfType(System.Type)
UnityEngine.Object.FindObjectsOfTypeIncludingAssets(System.Type)
UnityEngine.Object.FindObjectsOfType<T>()
UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
UnityEngine.Object.FindObjectOfType<T>()
UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
UnityEngine.Object.FindObjectsOfTypeAll(System.Type)
UnityEngine.Object.FindObjectOfType(System.Type)
UnityEngine.Object.FindObjectOfType(System.Type, System.Boolean)
UnityEngine.Object.ToString()
UnityEngine.Object.name
UnityEngine.Object.hideFlags
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: ZO.Document
Assembly: Unity.ZeroSim.dll
Syntax
[ExecuteAlways]
public class ZOSimDocumentRoot : MonoBehaviour

Fields

| Improve this Doc View Source

_zoSimDocumentFilePath

The ZOSim JSON document path.

Declaration
[SerializeField]
public string _zoSimDocumentFilePath
Field Value
Type Description
System.String

Properties

| Improve this Doc View Source

AssetBundle

A ZoSim document can have an asset bundle associated with it that contains things like visual and collision meshes. NOTE: This lazy loads the asset bundle on first request

Declaration
public AssetBundle AssetBundle { get; }
Property Value
Type Description
UnityEngine.AssetBundle
| Improve this Doc View Source

JSON

The ZOSim JSON for this document root.

Declaration
public JObject JSON { get; set; }
Property Value
Type Description
Newtonsoft.Json.Linq.JObject
| Improve this Doc View Source

Name

The name of this zosim document root. Note that it should be unique, so if you are spawing a bunch of these make sure to set the "document_name" in the ZeroSim JSON to something unique!

Declaration
public string Name { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

ZOSimDocumentFilePath

Declaration
public string ZOSimDocumentFilePath { get; set; }
Property Value
Type Description
System.String

Methods

| Improve this Doc View Source

Deserialize(JObject)

Declaration
public void Deserialize(JObject json)
Parameters
Type Name Description
Newtonsoft.Json.Linq.JObject json
| Improve this Doc View Source

FindAssetsByName(String)

Attempts to find an assets, first checking asset bundle and then in the Assets directory. NOTE: if only a partial name is give it will return all matches of asset that has the name.

Declaration
public Object[] FindAssetsByName(string name)
Parameters
Type Name Description
System.String name

Either full asset path or a partial name. If given just a partial name and there are multiple matches it will return all the assets that have that partial name.

Returns
Type Description
UnityEngine.Object[]
| Improve this Doc View Source

GetComponentJSON(String)

Get the JSON for a ZoSim component name.

Declaration
public JObject GetComponentJSON(string componentName)
Parameters
Type Name Description
System.String componentName

The name of the component.

Returns
Type Description
Newtonsoft.Json.Linq.JObject

A JSON Object of the conmponent or null if it doesn't exist.

| Improve this Doc View Source

GetOccurrence(String)

Get zosim occurrence by name.

Declaration
public ZOSimOccurrence GetOccurrence(string occurrenceName)
Parameters
Type Name Description
System.String occurrenceName

the name of the occurrence

Returns
Type Description
ZOSimOccurrence

ZOSimOccurrence

| Improve this Doc View Source

GetOccurrenceJSON(String, JArray)

Declaration
public JObject GetOccurrenceJSON(string occurrenceName, JArray occurrences = null)
Parameters
Type Name Description
System.String occurrenceName
Newtonsoft.Json.Linq.JArray occurrences
Returns
Type Description
Newtonsoft.Json.Linq.JObject
| Improve this Doc View Source

LoadFromZOSimFile(String)

Load Zero Sim JSON file.

Declaration
public void LoadFromZOSimFile(string filePath)
Parameters
Type Name Description
System.String filePath

path to zosim file

| Improve this Doc View Source

OnPostDeserializationNotification(Action<ZOSimDocumentRoot>)

If someone needs to be notified after a deserialization of a ZOSim File. For example a ZOHingeJoint needs to fixup the connected bodies that may or may not exist during the Deserialize call.

Declaration
public void OnPostDeserializationNotification(Action<ZOSimDocumentRoot> notification)
Parameters
Type Name Description
System.Action<ZOSimDocumentRoot> notification
| Improve this Doc View Source

SaveToZOSimFile(String)

Saves to ZOSim file.

Declaration
public void SaveToZOSimFile(string filePath)
Parameters
Type Name Description
System.String filePath
| Improve this Doc View Source

Serialize()

Builds ZOSim document by traversing hierarchy.

Declaration
public JObject Serialize()
Returns
Type Description
Newtonsoft.Json.Linq.JObject
| Improve this Doc View Source

ToJSON(Quaternion)

Convert Unity Quaternion to JSON token.

Declaration
public static JToken ToJSON(Quaternion v)
Parameters
Type Name Description
UnityEngine.Quaternion v

Unity Quaternion

Returns
Type Description
Newtonsoft.Json.Linq.JToken

JSON token

| Improve this Doc View Source

ToJSON(Vector3)

Convert Unity Vector3 to JSON token.

Declaration
public static JToken ToJSON(Vector3 v)
Parameters
Type Name Description
UnityEngine.Vector3 v

Unity Vector3

Returns
Type Description
Newtonsoft.Json.Linq.JToken

JSON token

| Improve this Doc View Source

ToQuaternion(JToken)

Convert JSON token to Unity Quaternion.

Declaration
public static Quaternion ToQuaternion(JToken json)
Parameters
Type Name Description
Newtonsoft.Json.Linq.JToken json

JSON Token. Must be a JArray!

Returns
Type Description
UnityEngine.Quaternion

Unity Quaternion

| Improve this Doc View Source

ToVector3(JToken)

Convert JSON token to Unity Vector3.

Declaration
public static Vector3 ToVector3(JToken json)
Parameters
Type Name Description
Newtonsoft.Json.Linq.JToken json

JSON Token. Must be a JArray!

Returns
Type Description
UnityEngine.Vector3
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX