mcjCollider plugin for DS4.5

You point a ray at objects in a daz scene and this plugin computes the collision point and the bounce angle.

Although this plugin can be used "by hand" to achieve interesting
effects, it is intended to be used by scripts and other plugins.

In the image below, a Daz Script used mcjCollider's services 256 times.

Installation

a faulty plugin can cause daz studio to crash
so if you experience problems,
you could try removing this (and other) plugins
from your daz studio plugins folder

The plugin, mcjCollider.dll can be found in the attachments at the bottom of this page

This file should be placed in your daz studio plugins folder

typically it's

C:\Program Files\DAZ 3D\DAZStudio4\plugins

You can also download this manual as a pdf file.

Usage
mcjCollider can be used on any solid object in the scene but not on objects that were converted to subD

select the objects that will be the target of the collider

It's preferable to do this selection in the Scene Tab, otherwise you may
accidentally select the whole figure when the area of interest is just
the torso. Parsing the whole figure is much slower since for example a
character's head can comprise 30000 polygon's for a 70000 polygons
figure.

example: we select the cylinder and the floor-cube ( use the CTRL key for multiple selections )

once properly installed you will find mcjCollider in the "Create" menu

now that the mcjCollider is created in the scene, it will remember the list of selected objects, so you
can deselect them if you want.

unfortunately, this list of target nodes is not saved along your scene
file, so you will need to create a new mcjCollider nest time you re-use
the scene

in the Scene tab, select the mcjCollider

position it so that it points toward the objects

go in the parameters tab and modify the "Ray length" property ( click only once! )

tweaking this property activates the collider

within a fraction of a second or a few seconds

the collider should jump to the collision point with the solids

the collider will also be oriented as if it had bounced on the surface

you can also use the script named "mcjActivateCollider.dsa" which is part of mcjColliderScripts.zip

if an mcjCollider is selected when you run this script, this mcjCollider
will be activated, if no collider is selected, the first mcjCollider
found in the scene will be activated.

if there was no collision, the label of the report channel contains the string value "noHit"

if there was a collision, the label of the report channel contains 5 tab-delimited values

example:

shi6f_8206 root 1 580 0

the five parameters contained in this report string are

figure name : example: "shi6f_8206", if the collided object is not a figure, then figure name will be "none",

node name: if the collided object is a figure, this field
will be set to "root" meaning the figure's root node owns the mesh. If
mcjCollider is the version for Daz Studio 3, this field would hold the
name of the bone, since it owns the mesh. If the collided object is not a
figure this field holds the object's name. example: "plane 3".

mcjCollider detects the closest hit point, but it also detects the farthest hit point and up to 1024 layers of hit points.
it's a bit like an MRI scanner. This was done for applications like the conversion of a scene into voxels;

Number getNumHits(); this function/slot returns total number of hit points.

The source code for the mcjColliderNode is released ybder the MIT License

/**********************************************************************
by mCasualJacques
released under the MIT License

Copyright (C) <2012> <mCasual/Jacques>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
**********************************************************************/