Latest Threads |
Broken scripts with updat...
Forum: Obi Rope
Last Post: hariedo
23-12-2024, 05:44 PM
» Replies: 2
» Views: 152
|
Garment explodes on Andro...
Forum: Obi Cloth
Last Post: CptnFabulous
19-12-2024, 07:16 AM
» Replies: 4
» Views: 692
|
Calculating and Reproduci...
Forum: Obi Fluid
Last Post: ZacharyP
18-12-2024, 05:49 PM
» Replies: 2
» Views: 794
|
Null Reference, actor not...
Forum: Obi Rope
Last Post: josemendez
13-12-2024, 12:39 PM
» Replies: 1
» Views: 192
|
Issue with Grasping ObiRo...
Forum: Obi Rope
Last Post: josemendez
12-12-2024, 12:00 PM
» Replies: 5
» Views: 505
|
Changing extruded rendere...
Forum: Obi Rope
Last Post: aderae
10-12-2024, 07:35 PM
» Replies: 2
» Views: 264
|
Baking a rope is causing ...
Forum: Obi Rope
Last Post: josemendez
10-12-2024, 11:06 AM
» Replies: 6
» Views: 688
|
Barrier belt - changing l...
Forum: Obi Rope
Last Post: josemendez
10-12-2024, 10:42 AM
» Replies: 1
» Views: 243
|
Path editor gizmo's appea...
Forum: Obi Rope
Last Post: josemendez
10-12-2024, 09:50 AM
» Replies: 1
» Views: 234
|
Problems when using multi...
Forum: Obi Cloth
Last Post: Cat3Man
09-12-2024, 03:17 AM
» Replies: 2
» Views: 314
|
|
|
Liquid sloshing in tanker |
Posted by: garyjforeman - 26-04-2018, 08:38 PM - Forum: Obi Fluid
- Replies (2)
|
|
I've seen examples of containers affecting the physics of a liquid but not the other way round.
Is it possible to simulate liquid sloshing around in a tanker vehicle and have it affect the physics of the vehicle.
Thanks in advance,
g.
|
|
|
shader particles not compiling in PS4 |
Posted by: nahuel36 - 25-04-2018, 10:24 PM - Forum: Obi Cloth
- Replies (1)
|
|
hello!
when i try to compile for PS4 there are a error with Obi/Particles shader
exactly it say this:
Shader error in 'Obi/Particles': Program 'frag', 'COLOR' is not a valid semantic for pixel shader output 'frag.color' at Assets/Obi/Resources/ObiMaterials/ObiParticles.cginc(23) (on ps4)
Compiling Fragment program with DIRECTIONAL SHADOWS_SCREEN
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_RGBM_ENCODING
the line of the error is:
half4 color : COLOR;
thanks!
|
|
|
Change particle mass via script |
Posted by: leonrdo - 20-04-2018, 08:15 PM - Forum: Obi Rope
- Replies (3)
|
|
Using ObiRope 3.3, I'm trying to change the mass of a single particle via script following the tutorial http://obi.virtualmethodstudio.com/tutor...icles.html
but its not working the way I think is supposed to work.
For example, calling this code, after a key is pressed,
Code: float[] mass = new float[1];
mass[0] = 0.0f;
Oni.SetParticleInverseMasses(rope.Solver.OniSolver, mass, 1, rope.particleIndices[1]);
its not keeping the second particle fixed, as I supposed it would make.
Did I miss anything?
Thanks in advance
|
|
|
Scaling Obi Objects |
Posted by: darkcser - 19-04-2018, 09:41 PM - Forum: Obi Cloth
- Replies (2)
|
|
It seems like scaling objects with Obi Cloth and Obi Rope components causes issues with the simulation. What is the workflow for scaling Obi Cloth objects? Do the mesh topology and the Obi Cloth objects have to have the same scale? Does this mean I have to figure out the scale in my 3D modeller before I export to Unity?
I had a fbx of a belt mesh that I tried to turn into an Obi Cloth object but no matter what I did with the distance constraint and distance iterations in the solver it just sagged like a super elastic silk ribbon. Eventually I realized that the belt in Unity was scaled to 0.01 so I duplicated it and scaled it to 1, and the cloth simulation looked better. Of course now I have a belt 100x bigger than desired.
Out of curiosity I followed the flag demo, and then tried to resize the flag by scaling up. It looked odd as well. (I fixed it horizontally instead of vertically, so the oddity is how it stretches the top.)
I had similar issues regarding scaling with Obi Rope that I posted in the rope section.
|
|
|
Chain Scale Issue |
Posted by: darkcser - 19-04-2018, 02:10 AM - Forum: Obi Rope
- Replies (2)
|
|
I'm trying to create a chain with fairly small links so that it is in scale with other objects in my VR scene. My Obi Rope resolution is already set to the max of 1 but when I reduce the link scale on the default chain link prefabs to 1, the links no longer touch one another.
I can change the link scale so that the chain links touch each other but when I scale the Obi Rope object itself so the chain is in scale with the rest of my scene, the rope simulation becomes very odd in that it becomes very elastic with the links being very far from one another.
Am I missing something obvious?
Thanks.
|
|
|
Play swinging sound? |
Posted by: zhuchun - 18-04-2018, 08:54 AM - Forum: Obi Rope
- Replies (1)
|
|
Hi, I have a steel chain attached to an iron ball and want to play a swinging sound when it's moving. Is there anything like HingeJoint.Velocity to handle this?
|
|
|
Questions about Obi Rope |
Posted by: Hypeviper - 17-04-2018, 05:38 PM - Forum: Obi Rope
- Replies (2)
|
|
Hi Obi,
I have 2 questions about Obi Rope.
In the following thread http://obi.virtualmethodstudio.com/forum...hp?tid=378
You say that next platform support will be UWP and Linux, is UWP supported yet?
Because i am building something for the Hololens.
Second question:
Does the rope automaticly account for objects between the 2 points if you add them in runtime?
So it will path around those objects?
Thanks!
|
|
|
Issues with handles and scripted particles |
Posted by: khalvr - 17-04-2018, 02:18 PM - Forum: Obi Rope
- Replies (2)
|
|
I'm trying to make a script which snaps rope particles within a radius to their initial position on the spline, so that it places itself nicely when plugs are attached. I'm exposing the curve variable separately so that you can have two separate (identical) cords fitting to the same spot. The script works as expected when snapping to the ropes initial position, but when using the replacement cord with an overriding curve (which has a different starting position), it works well enough except with one small kink - some particles which are attached to handles will move to an area close to their starting location for the duration of the coroutine. What's even weirder is that snapping one plug into place can cause the cord on a completely different rope object (which is still a part of same cord) to exhibit this behavior with its particle handles. Once the coroutine finishes, the particles with handles will return to their expected position.
Before you say anything - yes, this script will not work properly if you call SnapNearbyParticles twice with overlapping radii. But other than that, what am i doing wrong?
Code: using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Obi;
public class RopeParticleSnapping : MonoBehaviour {
protected ObiRope rope;
public ObiCurve targetCurve;
protected Dictionary<int, float> particleMasses = new Dictionary<int, float>();
// Use this for initialization
void Start()
{
rope = GetComponent<ObiRope>();
if (rope != null && targetCurve == null)
targetCurve = rope.ropePath;
//float mu = rope.ropePath.GetMuAtLenght(interParticleDistance * i);
//positions[i] = transform.InverseTransformPoint(rope.ropePath.transform.TransformPoint(rope.ropePath.GetPositionAt(mu)));
/*
* int numSegments = rope.UsedParticles - (closed ? 0:1);
if (numSegments > 0)
interParticleDistance = rope.RestLength/(rope.UsedParticles-1);
else
interParticleDistance = 0;
*
*
* */
}
public IEnumerator MoveParticles(Vector3 target, float radius)
{
rope.Solver.RequireRenderablePositions();
yield return null;
Dictionary<int, Vector3> affectedParticles = new Dictionary<int, Vector3>();
Debug.DrawRay(target, Vector3.up*0.1f, Color.red, 10.0f);
for (int i = 0; i < rope.positions.Length; i++)
{
float mu = targetCurve.GetMuAtLenght(rope.InterparticleDistance * i);
Vector3 startPosition = targetCurve.transform.TransformPoint(targetCurve.GetPositionAt(mu));
Debug.DrawRay(startPosition, Vector3.up*0.1f, Color.green, 10.0f);
if (Vector3.Distance(startPosition, target) < radius)
{
Debug.Log("Particle " + i + " inside distance!");
affectedParticles[i] = startPosition;
rope.velocities[i] = Vector3.zero;
if (!particleMasses.ContainsKey(i)) // We don't want to risk overwriting the stored mass with 0, in case of overlap!
particleMasses[i] = rope.invMasses[i];
rope.invMasses[i] = 0.0f;
}
}
rope.PushDataToSolver(ParticleData.INV_MASSES | ParticleData.VELOCITIES);
while (affectedParticles.Count > 0)
{
List<int> remove = new List<int>();
foreach(KeyValuePair<int, Vector3> particle in affectedParticles)
{
if (Vector3.Distance(rope.GetParticlePosition(particle.Key), particle.Value) < 0.001f)
{
remove.Add(particle.Key);
} else
{
rope.positions[particle.Key] = rope.transform.InverseTransformPoint(Vector3.Lerp(rope.GetParticlePosition(particle.Key), particle.Value, Time.deltaTime*10.0f));
}
}
foreach (int i in remove)
affectedParticles.Remove(i);
rope.PushDataToSolver(ParticleData.POSITIONS);
yield return null;
}
rope.Solver.RelinquishRenderablePositions();
}
public IEnumerator UnsnapParticles(Vector3 target, float radius)
{
rope.Solver.RequireRenderablePositions();
yield return null;
for (int i = 0; i < rope.positions.Length; i++)
{
float mu = targetCurve.GetMuAtLenght(rope.InterparticleDistance * i);
Vector3 startPosition = targetCurve.transform.TransformPoint(targetCurve.GetPositionAt(mu));
if (Vector3.Distance(startPosition, target) < radius)
{
Debug.Log("Releasing particle!");
particleMasses.TryGetValue(i, out rope.invMasses[i]);
rope.velocities[i] = Vector3.zero;
}
}
rope.PushDataToSolver(ParticleData.VELOCITIES | ParticleData.INV_MASSES);
rope.Solver.RelinquishRenderablePositions();
}
public void SnapNearbyParticles(Vector3 target, float radius)
{
StartCoroutine(MoveParticles(target, radius));
}
public void UnsnapNearbyParticles(Vector3 target, float radius)
{
StartCoroutine(UnsnapParticles(target, radius));
}
}
|
|
|
|