Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  add vector to obi cloth
#6
(06-03-2019, 09:58 AM)Richard Wrote: I thought that it is specific problem of obi cloth, because tutorial(http://obi.virtualmethodstudio.com/tutor...icles.html) writes "velocities" I cannot find out in documentĀ , not velocity. If thatĀ is a trivial question, I say sorry.

The array is called "velocities". There's an example in that page that reads from it:

Code:
// solver index of the first particle in the actor.
int particleSolverIndex = actor.particleIndices[0];

// use it to get the particle's current velocity.
Vector3 velocity = solver.velocities[particleSolverIndex];

Writing is done in exactly the same way:

Code:
// solver index of the first particle in the actor.
int particleSolverIndex = actor.particleIndices[0];

// use it to set the particle's current velocity.
solver.velocities[particleSolverIndex] = new Vector3(1,0,0);

Quote:"positions" or "velocities" arrays means putting all particle in an array and multiply by transform.position or vector3.velocity?

No. All particle properties are already put in arrays by Obi, all you need to do is access these arrays to write to or read from them.
Also, multiplying by transform.position doesn't make any sense (maybe adding or setting, but not multipliying. If you multiply a position by another position, you're scaling it.)

Vector3.velocity doesn't even exist:
https://docs.unity3d.com/ScriptReference/Vector3.html

You got Vector3.one, Vector3.left, Vector3.up...etc, but no Vector3.velocity.

These are all extremely basic general programming questions. Please make sure you understand them before attempting more advanced stuff.
Reply


Messages In This Thread
add vector to obi cloth - by Richard - 05-03-2019, 03:50 PM
RE: add vector to obi cloth - by josemendez - 05-03-2019, 04:00 PM
RE: add vector to obi cloth - by Richard - 05-03-2019, 04:05 PM
RE: add vector to obi cloth - by josemendez - 05-03-2019, 04:14 PM
RE: add vector to obi cloth - by Richard - 06-03-2019, 09:58 AM
RE: add vector to obi cloth - by josemendez - 06-03-2019, 11:57 AM