Click or drag to resize

ARWorldOriginExampleController Class

A demo showcasing how to use the SetWorldOrigin parameter when creating a cloud anchor to synchronize AR origins. This demo allows AR users to create a world origin for the AR space, then create cloud anchors and spheres on AR planes. AR users can move the most recently created sphere to any position using the textboxes as input and pressing "Submit". This example will not work with a PC user, as the AR World Origin is created after the initial PC setup. Video Example: https://drive.google.com/file/d/1R7Xc98CFY5IYHcNch6H1kndXxmqR7ozp/view?usp=sharing
Inheritance Hierarchy
SystemObject
  Object
    Component
      Behaviour
        MonoBehaviour
          SimpleDemosARWorldOriginExampleController

Namespace:  SimpleDemos
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
public class ARWorldOriginExampleController : MonoBehaviour

The ARWorldOriginExampleController type exposes the following members.

Constructors
  NameDescription
Public methodARWorldOriginExampleController
Initializes a new instance of the ARWorldOriginExampleController class
Top
Methods
  NameDescription
Private methodAwake
Called before start - sets up the singleton object for this class
Private methodGetTouch
Gets the location of the user's touch
Public methodStatic memberNormalCloudAnchorTextUpdate
THe cloud anchor callback that is used to inform the user that a normal cloud anchor was created
Public methodStatic memberSpawnNormalCloudAnchor
Spawns a normal cloud anchor now that the cloud anchor visualization object has been created (red cylinder)
Public methodStatic memberSpawnSphere
The create object call back for the normal spheres - used to inform the user the sphere was created and to scale it down so it matches the size of the other objects
Public methodStatic memberSpawnWorldOrigin
Spawns the world origin cloud anchor after the world origin object visualizer has been created (blue cube)
Private methodStart
Called on start up - sets the initial text for the user and adds a listener for Submit button
Private methodSubmitCoordinates
Called when Submit button is pressed
Private methodUpdate
The logic of this example - listens for screen touches and spawns whichever object is currently active on the drop down menu
Public methodStatic memberWorldOriginTextUpdate
The cloud anchor callback that informs the user the world origin is finished being created
Top
Fields
  NameDescription
Private fieldStatic memberm_Controller
Singleton for this class so that functions can be called after objects and cloud anchors are created using the same parameter they were created with
Private fieldm_CurrentlySpawningCloudAnchor
Flag indicating if we are currently spawning a cloud anchor - 1 user should only spawn 1 cloud anchor at a time
Public fieldm_DisplayInformation
Text that displays scene information to the user
Private fieldm_LastValidPose
Gets the hit position where the user touched the screen to help record where the object is verses where the user tapped
Public fieldm_NormalCloudAnchorObject
GameObject that represents a cloud anchor object (will be placed where the cloud anchor is)
Public fieldm_ObjectToSpawnDropDown
Determines which object to spawn: Cloud Anchor or normal sphere
Private fieldm_SpawnedSphere
GameObject that represents a cloud anchor object (will be placed where the cloud anchor is)
Public fieldm_SubmitButton
Button for submitting coordinates
Public fieldm_WorldOriginCloudAnchorObject
GameObject that represents the world origin cloud anchor (will be placed on where the world origin is)
Private fieldm_WorldOriginInitilized
Flag indicating if the world origin has been initialized or not - it should only be set once
Public fieldm_XInput
Input Box for X value
Public fieldm_YInput
Input Box for Y value
Public fieldm_ZInput
Input Box for Z value
Top
See Also