• Hi Guest!

    We are extremely excited to announce the release of our first Beta for VaM2, the next generation of Virt-A-Mate which is currently in development.
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. Once subscribed, download instructions can be found here.

    Click here for information and guides regarding the VaM2 beta. Join our Discord server for more announcements and community discussion about VaM2.
CustomCollider

Plugins + Scripts CustomCollider

Download [0.04 MB]
This plugin lets you easily add as many CPU and/or GPU colliders to your scene as you want.
shapes_crop.png


Does the scene asset you would like to use lack colliders somewhere? Add CPU colliders, which collide with other rigid body objects such as the person body model.

Do you have characters with long hair or clothes and they keep clipping through the furniture in the poses you would like to use? Add GPU colliders, those collide with simulated hair and clothes.


The custom colliders are meant to be used for environment collisions. The plugin won't magically turn CUA objects into properly configured dynamic physical objects - objects that would bounce off other physical surfaces ; the CUA creator would have to set them up correctly in Unity.

Usage​

Add CustomCollider.cslist to any atom in the scene. The collider will be placed relative to that atom's position. If you want to freely place a collider in the scene, the best choice is to use the Empty atom from VAM's Misc category.

Then configure the collider in the plugin's settings.

If you want to, you can add multiple instances of the plugin to the same object, one for each collider.

Shape​

tab_shape.png

This is where all the collider's properties are configured. The supported shapes are:
  • Sphere
  • Capsule (cylinder with sphere caps, oriented along one of the three local axes of the object)
  • Box
  • Plane
Below the Shape choice, you can configure the size properties relevant for the selected shape. The collider will also automatically scale with the parent object's global scale.

You can enable CPU and/or GPU collisions for the colliders. CPU colliders interact with other rigid physical objects, such as character bodies. GPU colliders interact with simulated hair and clothes.

Box Notes:

VAM does not natively support GPU box colliders. If GPU Collider is enabled for the Box Shape, the plugin will approximate the shape by filling it with capsules. The box's height defines the diameter of the capsules, so keep that relatively low. You can choose the orientation in which the capsules will be placed inside the box:
  • Auto: Automatically choose between Width or Length, depending on which is higher. This way the lowest possible amount of capsules will be used to fill the box, which is in general good for performance. But it might not necessarily achieve the best behavior for your scene and pose.
  • Length: The capsules will be oriented along the forward (blue) axis of the object.
  • Width: The capsules will be oriented along the right (red) axis of the object.
  • Length+Width: Capsules in both directions will be used to fill the box.
The Overlap slider controls the density of the capsules. It's recommended to go with lower values for performance reasons, as long as the results look good.

Plane Notes:

The plane collider is not supported as a CPU collider, ticking that checkbox will do nothing. Be aware that the Plane GPU collider is infinite. While for visualization purposes it's rendered as a square, it stretches into infinity. Any cloth or hair crossing the in-front/behind plane's boundaries will collide with the plane. The front of the plane is indicated by the object's up axis (green).

It's a good choice for a room's floor, as long as there are no levels below it. Or even for walls/ceiling, assuming you need GPU colliders there at all. In most cases, it's not a good choice for the top of a sofa or a bed, since it will also collide with any hair and cloth that's next to the furniture, if it crosses its above/below boundary. Consider using the box emulated by capsules for objects like beds instead. But the plane might look and perform better and cause no issues in your scene, if all the hair/cloth action happens only on top of the furniture item.

Position​

The Position tab lets you move and rotate the collider relative to the atom it's attached to. This specifies the Default Position of the collider.

Motion
motion.jpg

On the Motion tab, you can define up to 10 motions for the collider. A motion will move the collider from its Starting Position to the Target Position. It can be used to push things where they should be. It is mostly useful for GPU-only colliders, since exact position of simulated hair or clothes is not saved with poses, a little push can help with configuring the pose as it should look.

A motion is defined by:
  • Starting Position: previewed in blue outline when the tab is active
  • Target Position: previewed in green outline when the tab is active
  • The interpolator to move the collider from the Starting to the Target Position
  • The motion duration
  • Options to enable CPU or GPU Collider when the motion starts
  • Options to disable CPU or GPU Collider after the motion reaches the target
The Starting/Target positions can be defined relatively to the atom in which the plugin is contained, the Default Position defined on the Position tab, or relative to the current position.

The motion module uses the same preset system as DildoLanguage or SexyFluids. You can save or load the presets, and copy-paste them. Copy-paste uses the system clipboard and will work even between different instances of the plugin.

You can test-run the selected motion using the Run Queued or Run Immediately buttons. These differ if there is another motion already running: the Queued option will schedule the new motion to run after the currently active motion finishes, the Immediately option will run the new motion... immediately. You can also start the motions from triggers, the actions are also called Run Queued and Run Immediately.

For example videos of how a motion could be used to help your posing, see the v2 update description. It includes two example videos:
  1. How to fix hair clipping through a surface when a pose is loaded, even if the surface has a collider
  2. How to tweak positioning of simmed clothing, which spawns in its default position when a pose is loaded

Visualization​

Each collider is visualized in two ways:
  • Wireframe: white lines, can be seen through other objects. Let's you see where the collider is placed even if it's inside another object.
  • Solid: blue shape, respecting visibility. Let's you see where the collider protrudes out of visual geometry.
On this tab, you can choose which visualization type is show when. By default the wireframe is drawn when the atom containing this plugin is selected, and the solid is drawn when the plugin's UI is active.

In addition to that, the collider's axes are drawn when the Position tab is active. If there is no local position, these will align with the object's controller graphics, so you might not even notice them.

Triggers​

Most of the collider settings are exposed and can be controlled from VAM's trigger system. Disabling the whole plugin can be also used to disable its collider.

GPU box warning: Changing any of the size properties of a Box shape collider leads to all the internal capsules being recreated, if the box has GPU collisions enabled. For performance reasons, avoid animating those properties.[/SPOILER]

More resources from Foost

Share this resource

Latest updates

  1. v4 - CUA performance fun...

    Implemented a workaround for VAM with the performance patch crashing when a custom GPU collider...
  2. v3 - hotfix and qol tweaks

    Fixes Fixed selected motion's Target Rotation displaying wrong values on the sliders Fixed...
  3. v2 - motions

    Motions The new Motion Preset module let's you animate the collider's motion from one...

Latest reviews

Positive
Version: 4
Holy crap you're my hero!!!!! I can't tell you how many times the 'immersive' nature of a scene for my wife is destroyed because her hair goes through the bed/couch, etc!!! THANK YOU!
Upvote 0
Positive
Version: 4
Going to be one of my favorite plugins going forward. the adjustable box collider with the tubes now allows for easy collision with any surface (hair and clothes). Thank you!!
Upvote 0
Positive
Version: 1
Posted:
Bro I am not even using VAM for a while now, but that exact problem with easy to use capsules is so great. There was workaround with using subscene with capsules, but it was so tedious.. so this is great!
Upvote 0
Positive
Version: 1
Posted:
Thank you.The thing I have been searching for
Upvote 0
Positive
Version: 1
Posted:
So you're telling me that my subscene of 30 capsules arranged side by side to add a collide-able surface to a table or bed is no longer needed!?!?!.... Good! ^_^
Upvote 0
Positive
Version: 1
Posted:
This is super useful, and I suggest to add a function to enable the collision with the floor when set a object's position off and physics on, thus this plugin will be much more widely used for other purposes, like a pair of glasses falling to ground, etc.
Foost
Foost
Thanks. But I don't really understand the request. What floor? Do you mean when you use a CUA environment asset that does not even have a mesh collider so stuff falls through the floor? Just put a Box CPU collider there (or VAM's slate floor and hide it).
Upvote 0
Positive
too
Version: 1
Posted:
Wonderful !
Upvote 0
Back
Top Bottom