mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-03-30 22:35:15 -05:00
42 lines
905 B
C#
42 lines
905 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace RotateParticle
|
|
{
|
|
public class ParticleRuntimeState
|
|
{
|
|
public Vector3 Current;
|
|
public Vector3 Prev;
|
|
|
|
public ParticleRuntimeState(SimulationEnv env, Transform transform)
|
|
{
|
|
if (env.Center == null)
|
|
{
|
|
Prev = transform.position;
|
|
Current = transform.position;
|
|
}
|
|
else
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
|
|
public void Update(Transform t)
|
|
{
|
|
Current = t.position;
|
|
}
|
|
|
|
public void Apply(in Vector3 newPos, bool zeroVelocity = false)
|
|
{
|
|
if (zeroVelocity)
|
|
{
|
|
Prev = newPos;
|
|
}
|
|
else
|
|
{
|
|
Prev = Current;
|
|
}
|
|
Current = newPos;
|
|
}
|
|
}
|
|
} |