コード例 #1
0
 /// <summary>
 /// Called automatically to update positional data when the offset of the FloatingOrigin changes
 /// </summary>
 /// <param name="sceneCenter"></param>
 public virtual void OnOriginChange(WorldPosition sceneCenter)
 {
     UpdateUnityPosition(sceneCenter);
 }
コード例 #2
0
 public void Start()
 {
     FloatingOrigin.Add(this);
     this.worldPosition = new WorldPosition(this.unityPosition);
     UpdateColliderList();
 }
コード例 #3
0
        public static WorldPosition operator -(WorldPosition a, WorldPosition b)
        {
            WorldPosition p = new WorldPosition(a.sectorOffset - b.sectorOffset, a.sector - b.sector);

            return(p);
        }
コード例 #4
0
 public WorldPosition(WorldPosition other) : this()
 {
     this.sector       = new Long3(other.sector);
     this.sectorOffset = new Vector3(other.sectorOffset.x, other.sectorOffset.y, other.sectorOffset.z);
 }
コード例 #5
0
 public static double SqrDistance(WorldPosition a, WorldPosition b)
 {
     return((b - a).sqrMagnitude);
 }
コード例 #6
0
 public static double Distance(WorldPosition a, WorldPosition b)
 {
     return((b - a).magnitude);
 }
コード例 #7
0
 /// <summary>
 /// Check if two another world position occupies the same sector of space
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool SameSector(WorldPosition other)
 {
     return(this.sector == other.sector);
 }
コード例 #8
0
 /// <summary>
 /// Called automatically when the object's world position sector exits the floating origin's center sector
 /// </summary>
 /// <param name="sceneCenter"></param>
 public virtual void OnOriginExit(WorldPosition sceneCenter)
 {
 }
コード例 #9
0
 /// <summary>
 /// Called automatically when the WorldPosition changes from one sector to another
 /// </summary>
 /// <param name="old"></param>
 /// <param name="new"></param>
 public virtual void OnSectorChange(WorldPosition oldPosition, WorldPosition newPosition)
 {
 }