Obi Official Forum
Help Collision marked as Trigger not collides - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: General (https://obi.virtualmethodstudio.com/forum/forum-5.html)
+--- Thread: Help Collision marked as Trigger not collides (/thread-650.html)



Collision marked as Trigger not collides - mmortall - 16-08-2018

Obi Plugin v.3.5, Unity 2017.4.5f1 LTS
Collision marked as Trigger does not collide with cloth during simulation.
I've added a temporal fix in Oci.cs in two Set functions, see coding example below.

Is there a reason for it and can I turned simulation on also for trigger objects? Thanks.

ps. Also turning on/off isTrugger not makes collider dirty for Obi, so you need to disable and re-enable it for making them counted by Solver. 

Code:
        public void Set(UnityEngine.Collider source, int phase, float thickness){
            boundsMin = source.bounds.min - Vector3.one*(thickness + source.contactOffset);
            boundsMax = source.bounds.max + Vector3.one*(thickness + source.contactOffset);
            translation = source.transform.position;
            rotation = source.transform.rotation;
            scale = source.transform.lossyScale;
            contactOffset = thickness;
            this.collisionGroup = phase;

           //for some reason trigger colliders are not taking part in the simulation
           this.trigger = false;// source.isTrigger;
            this.id = source.GetInstanceID();
        }



RE: Collision marked as Trigger not collides - josemendez - 16-08-2018

(16-08-2018, 12:33 PM)mmortall Wrote: Obi Plugin v.3.5, Unity 2017.4.5f1 LTS
Collision marked as Trigger does not collide with cloth during simulation.
I've added a temporal fix in Oci.cs in two Set functions, see coding example below.

Is there a reason for it and can I turned simulation on also for trigger objects? Thanks.

ps. Also turning on/off isTrugger not makes collider dirty for Obi, so you need to disable and re-enable it for making them counted by Solver. 

Code:
public void Set(UnityEngine.Collider source, int phase, float thickness){
boundsMin = source.bounds.min - Vector3.one*(thickness + source.contactOffset);
boundsMax = source.bounds.max + Vector3.one*(thickness + source.contactOffset);
translation = source.transform.position;
rotation = source.transform.rotation;
scale = source.transform.lossyScale;
contactOffset = thickness;
this.collisionGroup = phase;

           //for some reason trigger colliders are not taking part in the simulation
           this.trigger = false;// source.isTrigger;
this.id = source.GetInstanceID();
}

Triggers are just that, triggers. By definition, they do not generate collisions and won't take part in the simulation at all. See:

https://unity3d.com/es/learn/tutorials/topics/physics/colliders-triggers

Also, excerpt from the Unity manual:

Quote:A collider configured as a Trigger (using the Is Trigger property) does not behave as a solid object and will simply allow other colliders to pass through. When a collider enters its space, a trigger will call the OnTriggerEnter function on the trigger object’s scripts.

https://docs.unity3d.com/Manual/CollidersOverview.html


RE: Collision marked as Trigger not collides - mmortall - 17-08-2018

(16-08-2018, 01:36 PM)josemendez Wrote: Triggers are just that, triggers. By definition, they do not generate collisions and won't take part in the simulation at all. See:

https://unity3d.com/es/learn/tutorials/topics/physics/colliders-triggers

Also, excerpt from the Unity manual:


https://docs.unity3d.com/Manual/CollidersOverview.html

Thanks for clarifying.