Giter VIP home page Giter VIP logo

floatingorigin's Introduction

Floating Origin Component

The Floating Origin component is meant to shift the X and Z coordinate's origin point (0,0) based on whether game objects are inside or outside of a predetermined area or dimensions.

Verified on Spatial OS versions: 9.1.0, 10.0.0, 10.1.0

Usage

  1. Add the Floating Origin component to a pre-existing GameObject in your scene such as the GameEntry object.
  2. Define which layers should be tracked by this component; it is recommended to place all SpatialOS EntityPrefabs on their own layer, for example 'entities', and use that to track which entities' their origin should be moved.
  3. On all locations where you pass coordinates to workers, first use the Unshift method of the Vector3 class to ensure you are using global coordinates.
  4. On all location where you receive coordinates from workers, first use the Shift method of the Coordinates class to change the position to use the shifted offset.

Tips

  • Always use the Coordinates class to maintain your World Coordinates; this is a double and as such can manage larger world positions without suffering from floating point imprecisions.
  • Always use Vector3 for your local coordinates in the Client or Worker where you use this component; the Vector3 class has an extension method to work with this component and interacts seamlessly with Unity.

floatingorigin's People

Contributors

mvriel avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.