(08-08-2025, 06:33 PM)Qriva0 Wrote: Hi, I have got several quesions about scripting rods.1. You can refer to the tear method of the rope. It shows how to read the "force" value of the rope/rod. But please note the value you read is from Obi engine, which is different from unity physics engine. As an example, if a rod is connected a cube with a unity joint, the force read from joint is most likely different from the value you read from Obi constraints. The difference depends on the amount of constraints , the mass ratios between objects , and the frequency ratio
- Is there valid way to calculate rod tension? For example I need to know if rod is pressed against the wall and it's being compressed. I tried to compare compressed distances, but with chain constraint it does not work.
- Is there way to calculate pressure against softbody or get it from softbody directly?
- Is it possible to make different parts of rod have different elasticity? There is rotational mass, but it's hard to balance and there can't be huge difference in mass (1:10). Sometimes even if difference is not huge, the rod becomes wiggly and can't stop.
- Is there way to damp rod without touching solver main parameter (damping)? I guess I could write script just for rod to reduce velocities every step, but it also affects other forces.
- What is difference between changing particle velocity and externalForces?
- Is it possible to change rod default (initial) shape during runtime? There are various properties like startPositions, endPositions, restPositions, any many other, but some of them has no effect and others are not what would be expected. I would expect particle delta to show something, but I think they are reset during simulation.
- Is there way to "pin" my burst job to main job queue? I wish I could just add my job handle to be executed with all other stuff without need to complete job instantly.
2. I think yes but as I have no experience in softbody so leave this question to Obi dev.
3. Adjust rotational mass should be the way to go. Why it's hard to balance? There probably be something else wrongly configured when you see weird behavior.
4. No but you can reduce particle's velocity by yourself to get a customized damper effect.
5. Same as unity addForce (Velocity v.s Force)
6. Rest shape is defined by blueprint I don't think you can do that. If you mean change the shape as soon as rod/rope is initialized I think it's doable. Or you may create new blueprint every time do do that.
7. What's your "burst job" actually do? The solver has some event handlers in its lifecycle that you may hook so maybe you don't need that?