|
|
Dynamic Pin Constraints? |
Posted by: gxiv. - 14-08-2017, 02:04 AM - Forum: Obi Rope
- Replies (4)
|
|
Hi!
What is the method for dynamically adding pin constraints to a rope??
I've tried creating an ObiPinConstraintBatch object, using the AddConstraint function, and then using AddBatch to add the pinconstraintbatch to the ropes pin constraints. I reference the pin constraints of my rope with:
pinConstraints = swingRope.GetComponent<ObiPinConstraints> ();
Is this the proper way of doing this? Because what I've written appears to have no affect! I would appreciate any help!!
gxiv
|
|
|
Figure out what Actor was collided with |
Posted by: niZmo - 09-08-2017, 12:40 AM - Forum: Obi Rope
- Replies (4)
|
|
I am going to be cutting ropes, with multiple ropes on one solver. I have a knife which tears the rope at the particle index collided with. The only problem is I don't know how to get which rope is being collided with to cut the right one. I've looked through the classes and couldn't find anything. Right now I have a public field to apply the tear to a rope. Here is the code, which is applied to the knife object.
Code: using UnityEngine;
using Obi;
public class RopeCutter : MonoBehaviour
{
public ObiSolver solver;
public ObiRope rope;
void OnEnable()
{
solver.OnCollision += Solver_OnCollision;
}
void OnDisable()
{
solver.OnCollision -= Solver_OnCollision;
}
void Solver_OnCollision(object sender, Obi.ObiSolver.ObiCollisionEventArgs e)
{
if (solver.colliderGroup == null) return;
foreach (Oni.Contact c in e.contacts)
{
// make sure this is an actual contact:
if (c.distance < 0.01f)
{
// get the collider:
//Collider collider = solver.colliderGroup.colliders[c.other];
// Cut at particle index
CutRopeAtIndex(rope, c.particle);
}
}
}
void CutRopeAtIndex(ObiRope rope, int index)
{
// remove constraints from solver:
rope.DistanceConstraints.RemoveFromSolver(null);
rope.BendingConstraints.RemoveFromSolver(null);
rope.Tear(index); // tear the fifth distance constraint.
// you could call Tear() as many times as you wish here.
// add constraints to solver
rope.BendingConstraints.AddToSolver(rope);
rope.DistanceConstraints.AddToSolver(rope);
// update active bending constraints:
rope.BendingConstraints.SetActiveConstraints();
// only for cloth: commit changes to the topology:
// UpdateDeformableTriangles();
// upload active particle list to solver:
rope.Solver.UpdateActiveParticles();
}
}
|
|
|
Fluid made up of animated sprites? |
Posted by: liero116 - 08-08-2017, 09:47 PM - Forum: Obi Fluid
- Replies (1)
|
|
So I need a plugin to do something fairly specific. I think Obi Fluid might be it but I want to make sure since I can't completely tell by looking at promotional material.
Basically I need to simulate fluid, but the fluid needs to be made up of animated sprites. It seems like I can use a mesh which means I can use a plane and attach a simple animated texture to it, but I just want to make sure this is possible before I buy.
|
|
|
Independent Timescale |
Posted by: momothemonster - 07-08-2017, 08:27 PM - Forum: Obi Rope
- Replies (2)
|
|
Is there a way to make Obi Rope use an independent timescale? I'm slowing down Timescale in my game for a slow-motion effect but I want my rope to continue resolving at full-speed. Thanks!
|
|
|
complex mesh interaction |
Posted by: baryy - 26-07-2017, 07:51 PM - Forum: Obi Fluid
- Replies (2)
|
|
Hi I'm really hoping someone can advise on this notion. I wish to drive the simple fluid sim with a kinect driven avatar. Could anyone knowledgeable point me in a direction which might work? I understand that the classic colliders will not interact but is it possible to incorporate the mesh normals to react with the particles and repel around the kinect silhouette or via any other router?
|
|
|
Cloth collision is not working? |
Posted by: nomura - 25-07-2017, 03:41 PM - Forum: Obi Cloth
- Replies (1)
|
|
sorry i'm not good to english..
I read this document(http://obi.virtualmethodstudio.com/tutor...thing.html) and try.
Collision worked fine when I moved Unity chan as an animator.
but, If I change the rotation of each joint directly like below, the collision does not seem to work...
```
// Apply the processing below to each joint
Transform t = animator.GetBoneTransform(boneId);
t.localRotation = Quaternion.Slerp(t.localRotation,initialRotations[bone]*modifiedRotation, smoothFactor * Time.deltaTime);
```
Is there a way to enable cloth collision while rotating the relation directly?
|
|
|
|