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

https://github.com/vrlabs/damping-constraints

Constraints with damping effects.
https://github.com/vrlabs/damping-constraints

Last synced: 5 months ago
JSON representation

Constraints with damping effects.

Awesome Lists containing this project

README

          

# Damping Constraints

[![Generic badge](https://img.shields.io/github/downloads/VRLabs/Damping-Constraints/total?label=Downloads)](https://github.com/VRLabs/Damping-Constraints/releases/latest)
[![Generic badge](https://img.shields.io/badge/License-MIT-informational.svg)](https://github.com/VRLabs/Damping-Constraints/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/)

Constraints with adjustable damping effects

![DampingConstraint](https://github.com/VRLabs/Damping-Constraints/assets/76777936/5582d63d-691e-40f1-bb4f-4fb45f471dc7)

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

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

---

## How it works

* The constraint targets itself at full weight and another source at a weight lower than one.
* This causes a feedback loop where every frame the constraint moves a relative distance towards the target, creating a damping effect.

## Install guide

https://github.com/VRLabs/Damping-Constraints/assets/76777936/98ad4d8a-1e70-4c49-bccc-69b6fc566bf4

Position Damping Constraint

* Drag & Drop the ``Position Damping 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 ``Position Target``.
* Move ``Position Target`` outside of ``Position Damping Constraint`` and place it anywhere in your avatars hierarchy as needed.

Rotation Damping Constraint

* Drag & Drop the ``Rotation Damping 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 ``Rotation Target``.
* Move ``Rotation Target`` outside of ``Rotation Damping 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 the objects you want to dampen inside ``Container``.
* Alternatively you can constrain the objects to ``Container``.
* Changing the weight of the second source in the constraint will change the strength of the damping effect.

## Performance stats

```c++
Constraints: 1
Constraint Depth: 1
```

## Hierarchy layout

Position Damping Constraint:

```html
Position Damping Constraint
|-Container
| |-Cube
|-Position Target
```

Rotation Damping Constraint:

```html
Rotation Damping Constraint
|-Container
| |-Cube
|-Rotation Target
```

## Contributors

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

## License

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

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

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

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

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