Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Softbody for Vehicles?
#8
(08-02-2019, 01:59 AM)StudioTatsu Wrote: The bugfix worked... kinda.

The mesh no longer deforms at the start but is caused 2 new issues:
1. The Skin Mesh Render Bounds Center is Offset
2. The Softbody Gameobject vanishes when you zoom in closer to it. (Not because of clipping planes)


To Repro:
Open DeformableBarrels scene.
Look in the scene window after you press play you will see the skinning mesh render box offset
Zoom in closer to the gameobject it will vanish (it does not do this with the original code)

Hi,

My apologies, didn't have the bounds into account for the fix. Leave the lines in ObiActor.cs as they were:

Code:
if ((data & ParticleData.REST_POSITIONS) != 0 && restPositions != null && i < restPositions.Length)
                solver.restPositions[k] = restPositions[i];

            if ((data & ParticleData.REST_ORIENTATIONS) != 0 && restOrientations != null && i < restOrientations.Length)
                solver.restOrientations[k] = restOrientations[i];

And replace line 117 in ObiShapeMatchingConstraintsBatch.cs with this:
Code:
orientations = new AlignedQuaternionArray(ConstraintCount,constraints.Actor.ActorLocalToSolverMatrix.rotation);

This is much cleaner and considers the skinned mesh renderer bounds.
Reply


Messages In This Thread
Softbody for Vehicles? - by StudioTatsu - 06-02-2019, 04:46 PM
RE: Softbody for Vehicles? - by josemendez - 06-02-2019, 06:48 PM
RE: Softbody for Vehicles? - by StudioTatsu - 06-02-2019, 08:56 PM
RE: Softbody for Vehicles? - by josemendez - 07-02-2019, 10:39 AM
RE: Softbody for Vehicles? - by josemendez - 07-02-2019, 05:37 PM
RE: Softbody for Vehicles? - by StudioTatsu - 08-02-2019, 01:59 AM
RE: Softbody for Vehicles? - by josemendez - 08-02-2019, 08:23 AM
RE: Softbody for Vehicles? - by StudioTatsu - 07-02-2019, 06:52 PM
RE: Softbody for Vehicles? - by StudioTatsu - 08-02-2019, 01:21 PM