An open API service indexing awesome lists of open source software.

https://github.com/vrlabs/spring-constraint

A constraint with spring behavior.
https://github.com/vrlabs/spring-constraint

Last synced: 5 months ago
JSON representation

A constraint with spring behavior.

Awesome Lists containing this project

README

          

# Spring Constraint

[![Generic badge](https://img.shields.io/github/downloads/VRLabs/Spring-Constraint/total?label=Downloads)](https://github.com/VRLabs/Spring-Constraint/releases/latest)
[![Generic badge](https://img.shields.io/badge/License-MIT-informational.svg)](https://github.com/VRLabs/Spring-Constraint/blob/main/LICENSE)
[![Generic badge](https://img.shields.io/badge/Quest-Compatible-green?logo=Meta)](https://img.shields.io/badge/Quest-Compatible-green?logo=Meta)
[![Generic badge](https://img.shields.io/badge/Unity-2022.3.22f1-lightblue?logo=Unity)](https://unity.com/releases/editor/whats-new/2022.3.22)
[![Generic badge](https://img.shields.io/badge/SDK-AvatarSDK3-lightblue.svg)](https://vrchat.com/home/download)

[![Generic badge](https://img.shields.io/discord/706913824607043605?color=%237289da&label=DISCORD&logo=Discord&style=for-the-badge)](https://discord.vrlabs.dev/)
[![Generic badge](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Dvrlabs%26type%3Dpatrons&style=for-the-badge)](https://patreon.vrlabs.dev/)

A constraint system with spring behavior

![SpringConstraint](https://github.com/VRLabs/Spring-Constraint/assets/76777936/0a21419d-49d6-4054-8265-9d25850dab11)

### ⬇️ [Download Latest Version](https://github.com/VRLabs/Spring-Constraint/releases/latest)

### 📦 [Add to VRChat Creator Companion](https://vrlabs.dev/packages?package=dev.vrlabs.spring-constraint)

---

## How it works

* The constraint is weighted between 3 sources to achieve a spring-like effect.

## Install Guide

https://github.com/VRLabs/Spring-Constraint/assets/76777936/6a5056c7-9f47-4caf-bef0-8eae04f84613

* Drag & drop the ``Spring Constraint`` prefab into the base of your Hierarchy.
* Right click and unpack the prefab, then drag & drop it onto your avatar.
* Expand the prefab hierarchy and find ``Spring Target``
* Move ``Spring Target`` outside of ``Spring Constraint`` and place it anywhere in your avatars hierarchy as needed.

> [!NOTE]
> When building for Quest, you will have to remove unsupported components and shaders

## How to use

* Place your objects inside ``Spring Constraints`` -> ``Container``.
* Alternatively you can constrain the objects to ``Container``.
* To change the characteristics of the spring, change the position constraint values on the ``Motion`` object:
* Sources > Spring Target (default 1.1) controls the strength of the spring. Higher values make it harder to stretch the spring. Min: 1, Max: 2
* Sources > Motion (default 4) dampens acceleration, the higher the value the slower ``Container`` accelerates.

## Performance stats

```c++
Constraints: 2
Constraint Depth: 2
```

## Hierarchy layout

```html
Spring Constraint
|-Container
| |-Cube
|-Motion
|-Spring Target
```

## Contributors

* [lin](https://github.com/oofdesu)
* [PF_Cactus](https://github.com/brandonvdongen)

## License

Spring Constraint is available as-is under MIT. For more information see [LICENSE](https://github.com/VRLabs/Spring-Constraint/blob/main/LICENSE).

[](https://vrlabs.dev "VRLabs")

[](https://discord.vrlabs.dev/ "VRLabs")

[](https://patreon.vrlabs.dev/ "VRLabs")

[](https://twitter.com/vrlabsdev "VRLabs")