Splitter

Splitter will shortly be released as a Unity Asset, available for purchase in the Unity Asset Store.

About

Splitter is a framework developed by NoTime that can be used to dynamically create and manage isolated physics contexts within Unity's built-in 3d physics engine (NVIDIA PhysX). Isolated physics contexts are extremely useful for wrangling things like:
  • Moving/Rotating platforms
  • Ridable Rigidbodies
  • Explorable Interiors of Moving Vehicles
  • Gravity Walls
  • Any combination of the above ( For example, a moving/rotating gravity wall)
  • Any nested combination of the above. For example, an explorable aircraft carrier that rolls in the waves, which has moving platforms on the ship, and is all on a planet that is rotating and moving in space.
Features

  • Dynamically create and manage isolated physics contexts within Unity's built-in 3d physics engine (NVIDIA PhysX).
  • Splitter ensures that transitions to and from these isolated physics scenes are executed as smoothly as possible.
  • Splitter also supports physical interaction between rigidbodies in separate physics scenes.
  • Splitter requires no coding, but does expose useful events and methods if needed.
  • Splitter utilizes the GameObject.SendMessage to provide event level control to programmers.
  • Lastly, Splitter supports all of the standard Rigidbody applications across physics scenes.
Component Documentation

SplitterAnchor
Creates a 'physics anchor' and defines an isolated physics context.
Tip: The anchor's physical orientation in the isolated physics scene is defined by the anchor's local rotation. If this proves to be confusing, try setting SimulationVisible to true to get a visual representation of the simulated anchor.

List<Collider> EntranceTriggers - A list of triggers that are used to define an entrance area. When a subscriber triggers any of these triggers, the subscriber will be evaluated to be entered into this anchor's isolated physics context. Caveat: See EntrancePriority.

List<Collider> StayTriggers - A list of triggers that are used to define a stay area. As long as a subscriber who has entered this anchor's isolated physics context remains in contact with one of these triggers, the subscriber will continue to be simulated in this anchor's isolated physics context. Caveat: See the EntrancePriority property.
Tip: In general, the entrance triggers should be contained within the StayTriggers. The StayTriggers should be slightly larger than the Entrance triggers. This ensures that there is a buffer zone to prevent jittery rapid entrance/exit of an anchor.
int EntrancePriority - Used to manage nested anchors. Defines the priority this anchor takes over other overlapping anchors. For example, imagine a scene with a boat in an ocean on a rotating planet, where the boat and the planet are both SplitterAnchors. In this case, the entrance priority of the ship should be higher than the planet. This way, if the player is already in the planet's physics simulation, we know it is okay to exit and enter the boat's physics simulation if triggered.
bool SimulationVisible - This is made available for debugging only. If this is true on start, then the simulated anchor will remain visible. All simulated anchors can be found at the world position of Vector3(100, 100, 100).
SplitterSubscriber
Gives a rigidbody the ability to interact with SplitterAnchors
List<MonoBehaviour> RunInSimulationSpace - A list of Monobehaviors that should be run inside the physics simulation. In most cases, this can remain unused. However, in the case of the player, you will most likely want to control the player from within the anchor's physics context. So as a rule of thumb, always add the players character controller to this list.
bool SimulationVisible - This is made available for debugging only. If this is true on the start of anchor simulation, then the simulated anchor will remain visible. All simulated anchors can be found at the world position of Vector3(100, 100, 100).
int EntrancePriority - Used to manage nested anchors. Defines the priority this anchor takes over other overlapping anchors. For example, imagine a scene with a boat in an ocean on a rotating planet, where the boat and the planet are both SplitterAnchors. In this case, the entrance priority of the ship should be higher than the planet. This way, if the player is already in the planet's physics simulation, we know it is okay to exit and enter the boat's physics simulation if triggered.
bool SimulationVisible - This is made available for debugging only. If this is true on start, then the simulated anchor will remain visible. All simulated anchors can be found at the world position of Vector3(100, 100, 100).
SplitterEventListener
Provides access to Splitter events.
Some knowledge of the inner workings of Splitter is required when dealing with events. When a subscriber triggers an anchor, a complete copy of the subscriber game object is made and entered into the anchor's physics simulation. The SplitterEventListener's events allow us to access the simulated subscriber and simulated anchor.
To utilize this event listener, have the relevant components inherit from SplitterEventListener instead of MonoBehaviour. Then override any of the following public virtual methods as needed.
OnEnterAnchor(SplitterEvent evt) - Occurs for subsribers. Occurs when the subscriber successfully enters an anchor.
OnExitAnchor(SplitterEvent evt) - Occurs for subsribers. Occurs when the subscriber successfully exits an anchor.
OnSimulationStart(SplitterEvent evt) - Occurs for anchors. Occurs when the anchor starts simulating a physics context.
SplitterEvent
This class simply holds relevant information for events.
SplitterAnchor Anchor - The SplitterAnchor associated with the event.
Transform SimulatedAnchor - The transform of the simulated anchor associated with the event.
SplitterSubscriber Subscriber - The SplitterSubscriber associated with the event.
OnExitAnchor(SplitterEvent evt) - Occurs for subsribers. Occurs when the subscriber successfully exits an anchor.
Transform SimulatedSubscriber - The transform of the simulated subscriber associated with the event.
Contact

No Time is a small tech and media company located in Lehigh Valley, Pennsylvania, USA.
Questions or Comments? Or just interested? Feel free to contact us!