예제 #1
0
            public override void Capture()
            {
                if (m_target == null)
                {
                    return;
                }

                // create buffer
                int count_max = m_target.main.maxParticles;

                if (m_buf_particles == null || m_buf_particles.Length != count_max)
                {
                    m_buf_particles = new ParticleSystem.Particle[count_max];
                    m_buf_positions.Resize(count_max);
                    m_buf_rotations.Resize(count_max);
                }

                // copy particle positions & rotations to buffer
                int count = m_target.GetParticles(m_buf_particles);

                for (int i = 0; i < count; ++i)
                {
                    m_buf_positions[i] = m_buf_particles[i].position;
                }
                for (int i = 0; i < count; ++i)
                {
                    var a = m_buf_particles[i].axisOfRotation;
                    m_buf_rotations[i].Set(a.x, a.y, a.z, m_buf_particles[i].rotation);
                }

                // write!
                var data = new aePointsData();

                data.positions = m_buf_positions;
                data.count     = count;
                m_abc.WriteSample(ref data);
                m_prop_rotatrions.WriteArraySample(m_buf_rotations, count);
            }
예제 #2
0
 [DllImport("abci")] public static extern void        aePointsWriteSample(aeObject obj, ref aePointsData data);
예제 #3
0
 [DllImport("abci")] static extern void aePointsWriteSample(IntPtr self, ref aePointsData data);
예제 #4
0
 public void WriteSample(ref aePointsData data)
 {
     aePointsWriteSample(self, ref data);
 }