Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Rope Particle Positioning C#
#2
(12-11-2019, 03:30 AM)VirtualCucumber Wrote: Generally when moving I would set the ropes particle invMass[] to 0 and the positions[] to the position I want through that ropes solver but with this new projec I want these ropes all under one solver and would like to assign the positions of these rope particles when I need to using ObiRope.positions[] type instead of ObiSolver.positions[] since I want to refer to a certain rope instead of the solver that controls all.

When I do this however it acts weird like its operating on local positioning (IDK relative to what, maybe solver positioning). Was wondering more details on this matter, why it acts like this and if this is the not thee way of doing this, if there was a way. I would like to access certain ropes/actors and their particles positions/mass when they are all under one solver.

particle positions/velocities/etc in the actor's arrays (actor.positions, actor.velocities...) are expressed in the actor's local space. These are converted to solver space when you call PushToSolver(), so solver.positions, solver.velocities... are expressed in solver space.

Solver space can either be world space  (if the solver has "simulate in local space" disabled), or the solver's local space (if the solver has "simulate in local space" enabled).

Easiest and most efficient way to change per-actor particles is to find out what their index in the solver is, then directly modifying the solver data:
Code:
var solverIndex = actor.particleIndices[index];
actor.solver.positions[solverIndex] = <your position in world or local (solver) space>.
Reply


Messages In This Thread
Rope Particle Positioning C# - by VirtualCucumber - 12-11-2019, 03:30 AM
RE: Rope Particle Positioning C# - by josemendez - 12-11-2019, 09:20 AM
RE: Rope Particle Positioning C# - by josemendez - 04-12-2019, 07:13 PM